Switch language

Vision Q&A

Ask questions about an image with a self-deployed vision-language model.

Use a vision-capable model ID from the Model Catalog to understand images in chat completions. For parameters and limits, see the Vision guide.

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api-inference.bitdeer.ai/v1",
    api_key=os.environ["BITDEER_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)

JavaScript

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.BITDEER_API_KEY!,
  baseURL: 'https://api-inference.bitdeer.ai/v1',
});

const response = await 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,
});

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

Last updated on

On this page

Vision Q&A · Bitdeer AI