# Image and video input
URL: https://docs.munito.ai/vision

Munito AI vision models read images and video in a chat request. Send an image as an HTTPS URL or as a base64 data URL, next to your text.
Images work on Chat Completions, Responses and Messages. Video works on Chat Completions.

The OpenAI SDK uses the base URL `https://api.munito.ai/inference/v1`, and the Anthropic SDK uses `https://api.munito.ai/inference`. Both read the key from `MUNITO_API_KEY`.

## Models [#models]

| Model                                  | Images | Video |
| -------------------------------------- | ------ | ----- |
| `qwen/qwen3.8-27b`                     | Yes    | Yes   |
| `zai-org/glm-5.3-flash`                | Yes    | Yes   |
| `deepseek-ai/deepseek-v4.1-flash-1017` | Yes    | No    |
| `deepseek-ai/deepseek-v4-flash`        | No     | No    |
| `aleph-alpha/kolibri-1`                | No     | No    |
| `google/gemma-4-12b`                   | No     | No    |

An image or a video to a model without that input returns `400` with `'image' is not supported: not available for this model` (or `'video'`).

## An image by URL [#an-image-by-url]

```bash
pip install openai
```

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.munito.ai/inference/v1",
    api_key=os.environ["MUNITO_API_KEY"],
)
response = client.chat.completions.create(
    model="qwen/qwen3.8-27b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe this image in one sentence."},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png"},
                },
            ],
        }
    ],
    max_tokens=2048,
)
print(response.choices[0].message.content)
```

Munito AI downloads the URL once, before the model runs. The URL must use HTTPS on port 443 and answer within 15 seconds, with no redirect.
A URL that Munito AI cannot download returns `400` with `media URL is unavailable or not permitted`.

## An image as base64 [#an-image-as-base64]

Send a local file as a data URL: `data:<type>;base64,<data>`. The type must match the file.

```python
import base64
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.munito.ai/inference/v1",
    api_key=os.environ["MUNITO_API_KEY"],
)
with open("photo.png", "rb") as image:
    data = base64.b64encode(image.read()).decode()
response = client.chat.completions.create(
    model="qwen/qwen3.8-27b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is in this image?"},
                {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{data}"}},
            ],
        }
    ],
    max_tokens=2048,
)
print(response.choices[0].message.content)
```

## TypeScript [#typescript]

```bash
npm install openai
```

```ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.munito.ai/inference/v1",
  apiKey: process.env.MUNITO_API_KEY,
});
const response = await client.chat.completions.create({
  model: "zai-org/glm-5.3-flash",
  messages: [
    {
      role: "user",
      content: [
        { type: "text", text: "Describe this image in one sentence." },
        {
          type: "image_url",
          image_url: { url: "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png" },
        },
      ],
    },
  ],
  max_tokens: 2048,
});
console.log(response.choices[0].message.content);
```

## Video [#video]

Send a video as a `video_url` part, with an HTTPS URL or a base64 data URL. The model reads up to 32 frames of the video.

```python
import base64
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.munito.ai/inference/v1",
    api_key=os.environ["MUNITO_API_KEY"],
)
with open("clip.mp4", "rb") as video:
    data = base64.b64encode(video.read()).decode()
response = client.chat.completions.create(
    model="qwen/qwen3.8-27b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What happens in this video?"},
                {"type": "video_url", "video_url": {"url": f"data:video/mp4;base64,{data}"}},
            ],
        }
    ],
    max_tokens=2048,
)
print(response.choices[0].message.content)
```

You can also send frames that you choose: put JPEG frames in one data URL, separated by commas, as `data:video/jpeg;base64,<frame1>,<frame2>`. Send up to 32 frames.

## An image on Messages [#an-image-on-messages]

```bash
pip install anthropic
```

```python
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.munito.ai/inference",
    api_key=os.environ["MUNITO_API_KEY"],
)
message = client.messages.create(
    model="qwen/qwen3.8-27b",
    max_tokens=2048,
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image",
                    "source": {
                        "type": "url",
                        "url": "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
                    },
                },
                {"type": "text", "text": "Describe this image in one sentence."},
            ],
        }
    ],
)
print(next(block.text for block in message.content if block.type == "text"))
```

A base64 image on Messages uses `"source": {"type": "base64", "media_type": "image/png", "data": "..."}`.
On Responses, send an `input_image` part with `image_url` set to an HTTPS URL or a data URL.

## Limits [#limits]

| Limit                       | Value                                                      |
| --------------------------- | ---------------------------------------------------------- |
| Images in one request       | 8                                                          |
| Videos in one request       | 1                                                          |
| Size of one image           | 10 MiB                                                     |
| Size of one video           | 24 MiB                                                     |
| All media in one request    | 32 MiB                                                     |
| Frames that the model reads | 32                                                         |
| Image formats               | JPEG, PNG, WebP, GIF, BMP, TIFF, AVIF                      |
| Video formats               | MP4, WebM, QuickTime, Matroska, AVI, a JPEG frame sequence |

| Error (`400`)                                          | Cause                                                         |
| ------------------------------------------------------ | ------------------------------------------------------------- |
| `too many image inputs`, `too many video inputs`       | More than 8 images, or more than one video.                   |
| `media exceeds the configured byte limit`              | A file, or all media together, is above the limit.            |
| `media format does not match a supported content type` | The format is not in the list, or the data URL type is wrong. |
| `too many video frames`                                | A JPEG frame sequence has more than 32 frames.                |
| `media URL is unavailable or not permitted`            | Munito AI cannot download the URL.                            |

Each image and video uses input tokens. The `usage` of the response counts them in the input tokens, at the input price of the model.
See the [model catalog](https://docs.munito.ai/models) and the [chat reference](https://docs.munito.ai/api/createChatCompletion).
