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

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# Vision

> Analyze images with Venice vision models using multimodal content in chat completions.

Vision models can analyze images alongside text prompts. Use them for image understanding, extraction, classification, visual question answering, and multimodal reasoning.

Venice supports OpenAI-compatible multimodal chat messages. Put text and image blocks in the same user message, then send the request to a vision-capable model.

## Basic Usage

```python Python theme={"system"}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["VENICE_API_KEY"],
    base_url="https://api.venice.ai/api/v1",
)

response = client.chat.completions.create(
    model="qwen3-vl-235b-a22b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe this image in three bullets."},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://www.gstatic.com/webp/gallery/1.jpg"
                    },
                },
            ],
        }
    ],
)

print(response.choices[0].message.content)
```

```javascript Node.js theme={"system"}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.VENICE_API_KEY,
  baseURL: "https://api.venice.ai/api/v1",
});

const response = await client.chat.completions.create({
  model: "qwen3-vl-235b-a22b",
  messages: [
    {
      role: "user",
      content: [
        { type: "text", text: "Describe this image in three bullets." },
        {
          type: "image_url",
          image_url: {
            url: "https://www.gstatic.com/webp/gallery/1.jpg",
          },
        },
      ],
    },
  ],
});

console.log(response.choices[0].message.content);
```

```bash cURL theme={"system"}
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-vl-235b-a22b",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "Describe this image in three bullets."},
          {
            "type": "image_url",
            "image_url": {
              "url": "https://www.gstatic.com/webp/gallery/1.jpg"
            }
          }
        ]
      }
    ]
  }'
```

## Use Base64 Images

You can also pass a base64 data URL when the image is local or private:

```json theme={"system"}
{
  "type": "image_url",
  "image_url": {
    "url": "data:image/png;base64,<BASE64_ENCODED_IMAGE>"
  }
}
```

Replace `<BASE64_ENCODED_IMAGE>` with the complete base64 encoding of the image file, for example `base64.b64encode(open("photo.png", "rb").read()).decode()` in Python.

> [!NOTE]
>
> Base64 images must start with the `data:image/<type>;base64,` prefix (for example `data:image/jpeg;base64,`). Raw base64 without the prefix is rejected. SVG is not supported. Venice sets no minimum image size, but some models reject very small or very thin images. If an image is rejected, the error message states the reason.

## Send Multiple Images

`content` is an array, so one user message can include several `image_url` blocks alongside text. Use this to compare images or ask a question that spans more than one image:

```json theme={"system"}
{
  "model": "qwen3-vl-235b-a22b",
  "messages": [
    {
      "role": "user",
      "content": [
        {"type": "text", "text": "Compare these two images and list the differences."},
        {
          "type": "image_url",
          "image_url": {"url": "https://www.gstatic.com/webp/gallery/1.jpg"}
        },
        {
          "type": "image_url",
          "image_url": {"url": "https://www.gstatic.com/webp/gallery/2.jpg"}
        }
      ]
    }
  ]
}
```

Not every vision model accepts more than one image per request. Check `supportsMultipleImages` and `maxImages` under `model_spec.capabilities` in the [Models API](https://docs.venice.ai/api-reference/endpoint/models/list.md) response before sending several.

Each image also consumes context tokens. If a request with several images returns `TOO_MANY_TOKENS` (HTTP 400), send fewer images, shorten your instructions, or switch to a model with a larger context window.

## Choose a Vision Model

Use the [Text Models](https://docs.venice.ai/models/text.md) page or the [Models API](https://docs.venice.ai/api-reference/endpoint/models/list.md) to find models that support vision. Vision support is listed in model capabilities.

> [!TIP]
>
> For document-like inputs, use [File Inputs](https://docs.venice.ai/guides/features/file-inputs.md) when you want Venice to extract text from a file. Use vision when the visual layout or image content itself matters.

## Prompting Tips

* Tell the model what to focus on: objects, text, layout, safety, defects, or differences.
* Ask for structured output when your application needs fields you can parse.
* Keep image URLs accessible to the API, or use base64 data URLs for private images.
* Use a model with enough context if you combine images with long instructions.

## Related Resources

* [Chat Completions API](https://docs.venice.ai/api-reference/endpoint/chat/completions.md)
* [Text Models](https://docs.venice.ai/models/text.md)
* [File Inputs Guide](https://docs.venice.ai/guides/features/file-inputs.md)
* [Structured Responses Guide](https://docs.venice.ai/guides/features/structured-responses.md)


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