Switch language

Vision Language Models

Send images to vision-language models for understanding, description, and analysis.

Vision-Language Models (VLMs) can process both image and text inputs. Use the image_url content type in the messages array to pass images alongside text.

Supported models

Model IDProvider
moonshotai/Kimi-K2.6Moonshot AI
Qwen/Qwen3.5-397B-A17BAlibaba Qwen
nvidia/Nemotron-3-Nano-Omni-30B-A3BNVIDIA

The full model list is in the Model Catalog.

Image via URL

from openai import OpenAI

client = OpenAI(
    base_url="https://api-inference.bitdeer.ai/v1",
    api_key="YOUR_API_KEY",
)

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.6",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/photo.jpg"},
                },
                {
                    "type": "text",
                    "text": "Describe what you see in this image.",
                },
            ],
        }
    ],
    max_tokens=512,
)

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

Image via Base64

import base64

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

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.6",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {"url": f"data:image/jpeg;base64,{b64}"},
                },
                {
                    "type": "text",
                    "text": "What text is present in this image?",
                },
            ],
        }
    ],
    max_tokens=512,
)

Multiple images

You can send multiple images in a single request:

response = client.chat.completions.create(
    model="moonshotai/Kimi-K2.6",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "image_url", "image_url": {"url": "https://example.com/img1.jpg"}},
                {"type": "image_url", "image_url": {"url": "https://example.com/img2.jpg"}},
                {"type": "text", "text": "Compare these two images."},
            ],
        }
    ],
    max_tokens=512,
)

Notes

  • Base64-encoded images should ideally be under 1 MB to avoid timeouts.
  • Image tokens count toward billing together with text tokens.
  • Streaming is supported with vision inputs.

Last updated on

On this page

Vision Language Models · Bitdeer AI