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

# Vision

> Send images to models that take image input. Inline base64 data URLs only.

# Vision

Images go **inline, as base64 data URLs** (`data:image/png;base64,...`).
Remote `https://` image URLs are not fetched.

Models that accept images have `"vision": true` in
[`GET /v1/models`](https://docs.refuseless.com/api/models). The [Models](https://docs.refuseless.com/models.md) page lists them too.

## Chat completions

```bash theme={null}
curl https://api.refuseless.com/v1/chat/completions \
  -H "Authorization: Bearer $REFUSELESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-flash-abliterated",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What is in this image?"},
        {"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgo..."}}
      ]
    }]
  }'
```

```python theme={null}
import base64
from openai import OpenAI

client = OpenAI(base_url="https://api.refuseless.com/v1", api_key="abl_...")
b64 = base64.b64encode(open("shot.png", "rb").read()).decode()

resp = client.chat.completions.create(
    model="glm-5.3-flash-abliterated",
    messages=[{"role": "user", "content": [
        {"type": "text", "text": "What is in this image?"},
        {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}},
    ]}],
)
```

## Responses and Messages

* **`/v1/responses`:** an `input_image` part with `image_url` set to a data URL.
* **`/v1/messages`:** an `image` block with a `base64` source. See [Messages](https://docs.refuseless.com/api/messages.md).

## Rules

| Case | What happens |
| - | - |
| Remote image URL on `/v1/chat/completions` or `/v1/responses` | `400 bad_request`: `Remote image URLs are not supported. Send images inline as base64 data: URLs.` `param` points at the image. |
| `url` image source on `/v1/messages` | The image is left out and the call still runs. |
| Image sent to a model with `"vision": false` | Each image is replaced by a short note and the call runs on the text. |
| More images than the model takes | The latest images are kept; earlier ones are dropped. |
| Formats | PNG, JPEG, GIF and WebP. A data URL with a missing or wrong MIME type is repaired from the bytes when it can be. |
| Images inside tool results (agent screenshots) | Moved out of the tool text and sent to the model as images. |

Images count toward the request body limit and the prompt's token count.


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