plaingateway
Overview

Image inputs

Send images in chat completions and Messages requests.

Check that image is in the model's architecture.input_modalities in GET /models before sending images. The whole request body can be at most 32 MiB.

Chat completions

Use a content array with a text part and an image_url part. The URL can be a public https:// link or a data: URL with base64 data.

sh
curl https://api.plaingateway.com/api/v1/chat/completions \
  -H "Authorization: Bearer $PLAINGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-5.6-luna", "messages": [{"role": "user", "content": [{"type": "text", "text": "What is in this image?"}, {"type": "image_url", "image_url": {"url": "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"}}]}]}'

For a local file, send "url": "data:image/png;base64,<base64 data>".

Messages

Use an image content block with a base64 or url source:

json
{"role": "user", "content": [
  {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "<base64 data>"}},
  {"type": "text", "text": "What is in this image?"}
]}

When the host serves the other API shape, the gateway converts the image between these two forms.