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

# Vision

> Send images to a vision model and get text back.

Multimodal (vision) models accept images alongside text and respond with text —
for describing, analyzing, or answering questions about an image. Vision goes
through the **same** `/v1/chat/completions` endpoint as text chat; you just send
image content parts instead of a plain string.

## Sending an image

Set a message's `content` to an **array** of parts. Use `{"type": "text", ...}`
for text and `{"type": "image_url", "image_url": {"url": "..."}}` for an image.
The `url` can be a public `https` URL or a `data:image/...;base64,...` data URI.

<CodeGroup>
  ```python Python (URL) theme={null}
  resp = client.chat.completions.create(
      model="Qwen/Qwen2.5-VL-72B-Instruct",
      messages=[
          {
              "role": "user",
              "content": [
                  {"type": "text", "text": "What's in this image?"},
                  {
                      "type": "image_url",
                      "image_url": {"url": "https://example.com/photo.jpg"},
                  },
              ],
          }
      ],
  )

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

  ```python Python (base64) theme={null}
  import base64

  with open("photo.jpg", "rb") as f:
      b64 = base64.b64encode(f.read()).decode()

  resp = client.chat.completions.create(
      model="Qwen/Qwen2.5-VL-72B-Instruct",
      messages=[
          {
              "role": "user",
              "content": [
                  {"type": "text", "text": "Describe this image."},
                  {
                      "type": "image_url",
                      "image_url": {"url": f"data:image/jpeg;base64,{b64}"},
                  },
              ],
          }
      ],
  )

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

  ```javascript JavaScript theme={null}
  const resp = await client.chat.completions.create({
    model: "Qwen/Qwen2.5-VL-72B-Instruct",
    messages: [
      {
        role: "user",
        content: [
          { type: "text", text: "What's in this image?" },
          {
            type: "image_url",
            image_url: { url: "https://example.com/photo.jpg" },
          },
        ],
      },
    ],
  });

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

  ```bash cURL theme={null}
  curl https://gateway.omnia-voice.com/v1/chat/completions \
    -H "Authorization: Bearer $OMNIA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "Qwen/Qwen2.5-VL-72B-Instruct",
      "messages": [{
        "role": "user",
        "content": [
          { "type": "text", "text": "What'\''s in this image?" },
          { "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } }
        ]
      }]
    }'
  ```
</CodeGroup>

<Tip>
  Use an `https` URL when the image is already hosted somewhere the model can
  reach; use a base64 data URI for local files or images you don't want to expose
  publicly. You can include multiple `image_url` parts in one message to ask about
  several images at once.
</Tip>

## Choosing a model

Only vision-capable models accept images. Which models support vision is
discoverable via [`GET /v1/models`](/concepts/models), for example
`Qwen/Qwen2.5-VL-72B-Instruct`. Sending an image to a text-only model has no
effect on the image content.

## The response

The response is a standard chat completion: text `content` plus a `usage`
object:

```json theme={null}
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "Qwen/Qwen2.5-VL-72B-Instruct",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "A cat sitting on a windowsill." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 264, "completion_tokens": 8, "total_tokens": 272 }
}
```

## Billing

Vision requests are billed on prompt and completion tokens like any chat request;
the image contributes to the `prompt_tokens` count. Because everything runs
through `/v1/chat/completions`, vision requests also support
[streaming](/inference/streaming), [tool calling](/inference/tools), and
[structured output](/inference/structured-output).
