> ## Documentation Index
> Fetch the complete documentation index at: https://docs.antarah.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Images

> Send images to models that accept them.

Models whose `input_modalities` include `image` (today: `a2`) accept images in user messages. Send an `https:` URL or a base64 data URL.

```python Chat Completions theme={null}
reply = client.chat.completions.create(
    model="a2",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What's in this picture?"},
            {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}},
        ],
    }],
)
```

```python Messages theme={null}
import base64

data = base64.b64encode(open("photo.png", "rb").read()).decode()
message = client.messages.create(
    model="a2",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": data}},
            {"type": "text", "text": "What's in this picture?"},
        ],
    }],
)
```

| Rule | Limit |
| - | - |
| URLs | `https:` only. The model runtime fetches the image; Antara never does |
| Data URLs | `data:image/png`, `jpeg`, `webp`, or `gif` with `;base64`, at most 10 MiB decoded |
| Request body | At most 20 MiB in all (`413 payload_too_large`) |
| Other media | Video, audio, file, and PDF / `document` parts are rejected (`400 unsupported_modality` or `400 unsupported_parameter`) |
| Text-only models | An image gets `400 unsupported_modality` |

The console's Playground also takes image uploads. Uploaded images are kept for 24 hours, then deleted.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.