Image and video input

Send images and video to a vision model by URL or as base64, and the limits of each request.

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

ModelImagesVideo
qwen/qwen3.8-27bYesYes
zai-org/glm-5.3-flashYesYes
deepseek-ai/deepseek-v4.1-flash-1017YesNo
deepseek-ai/deepseek-v4-flashNoNo
aleph-alpha/kolibri-1NoNo
google/gemma-4-12bNoNo

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

pip install openai
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

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

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

npm install openai
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

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.

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

pip install anthropic
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

LimitValue
Images in one request8
Videos in one request1
Size of one image10 MiB
Size of one video24 MiB
All media in one request32 MiB
Frames that the model reads32
Image formatsJPEG, PNG, WebP, GIF, BMP, TIFF, AVIF
Video formatsMP4, WebM, QuickTime, Matroska, AVI, a JPEG frame sequence
Error (400)Cause
too many image inputs, too many video inputsMore than 8 images, or more than one video.
media exceeds the configured byte limitA file, or all media together, is above the limit.
media format does not match a supported content typeThe format is not in the list, or the data URL type is wrong.
too many video framesA JPEG frame sequence has more than 32 frames.
media URL is unavailable or not permittedMunito 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 and the chat reference.