> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Vision

> Send images and PDFs to vision-capable Mixlayer models

Vision lets supported models answer questions about images and PDFs. Use it for image understanding, screenshots, diagrams, scanned pages, and document summaries.

Mixlayer supports vision input through both [Chat Completions](/api-reference/inference-ap-is/chat-completions/chat-completions) and [Responses](/api-reference/inference-ap-is/responses/responses). Use a model documented as supporting vision; text-only models return `invalid_media` when media is included.

## Request Shapes

#### Chat Completions

```json
{
  "model": "your-vision-model",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "What is in this image?" },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/photo.png",
            "detail": "auto"
          }
        }
      ]
    }
  ]
}
```

#### Responses

```json
{
  "model": "your-vision-model",
  "input": [
    {
      "type": "message",
      "role": "user",
      "content": [
        { "type": "input_text", "text": "Summarize this document." },
        {
          "type": "input_file",
          "file_url": "https://example.com/report.pdf",
          "filename": "report.pdf"
        }
      ]
    }
  ]
}
```

## Supported Media

| Source     | Supported values                                                                                                           |
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
| Remote URL | `https://` only. Redirects are followed up to 3 hops.                                                                      |
| Data URL   | Base64 `data:` URL. Chat Completions uses it in `image_url`; Responses uses it in `image_url`, `file_data`, or `file_url`. |
| MIME types | `image/jpeg`, `image/png`, `image/webp`, `application/pdf`.                                                                |
| `detail`   | Optional: `low`, `high`, `auto`, or `original`.                                                                            |

## Limits

| Limit                         | Default                                                                |
| ----------------------------- | ---------------------------------------------------------------------- |
| Media parts per request       | 8                                                                      |
| Bytes per media item          | 20 MiB                                                                 |
| Total media bytes per request | 80 MiB                                                                 |
| HTTPS fetch timeout           | 10 seconds                                                             |
| JSON request body             | 160 MiB  (we recommend supplying media via a remotely retrievable URL) |
| PDF pages processed           | First 20 pages, rasterized at 150 DPI                                  |