Skip to content
Docs Menu & Search

Documentation

Image Input (Vision)

Send images to vision models in a chat request — OpenAI's content-array format.

Vision models take images in the same /v1/chat/completions request as text. Make the messagecontent an array of parts: text parts and image_url parts. It’s the OpenAI format, so OpenAI SDKs work unchanged.

Plan: image input needs the Developer plan or higher (your first ₹500 recharge unlocks it); qwen2-5-vl-72b needs Pro. The Free plan’s model, gpt-oss-20b, reads text only.

import base64
from openai import OpenAI

client = OpenAI(api_key="nbh_your_key_here", base_url="https://api.nabh.cloud/v1")

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

response = client.chat.completions.create(
    model="qwen3-6-27b",
    max_tokens=1000,
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What is the total on this receipt?"},
            {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image_b64}"}},
        ],
    }],
)
print(response.choices[0].message.content)

Models That Accept Images

These are the models whose model page lists Image Input: Supported (filter thecatalog by “Image Input” for the live list). Sending an image to a text-only model fails or the image is ignored.

Model IDGood For
qwen3-6-27bGeneral image understanding with function calling and a 256K context.
medhaImages and documents: send a page and ask for its text, or for fields as JSON.
qwen2-5-vl-72bVisual Q&A, documents, charts and diagrams. Pro plan.
deepseek-v4-1-flashDeepSeek's fast, low-cost V4.1 variant — a 1M-token context window, image input, function calling and reasoning, for high-volume requests.
kimi-k2-7-codeMoonshot AI's Kimi K2.7, tuned for code — a 256K-token context window, image input and function calling, for writing, completing and refactoring code.
kimi-k3Moonshot AI's flagship Kimi K3 — a 1M-token context window, image input, function calling and reasoning, for work where quality matters most.
minimax-m3MiniMax's M3 — a reasoning model with a 512K-token context window, image input and function calling, for long-context chat.

Passing the Image

  • Base64 data URL (recommended) —data:image/png;base64,… or data:image/jpeg;base64,…. The image travels inside your request, so it works for private files and nothing has to be publicly reachable.
  • Public https URL — the model fetches it while handling your request. It must be reachable without login; if the fetch fails, the request fails.
  • Size. Keep each image to a few MB (base64 adds about a third); the whole request body is capped at 10 MB, and a larger one fails with 413 REQUEST_TOO_LARGE. Large images use more input tokens — downscale to the detail you need.
  • Several images — add more image_url parts to the same message.

Cost

Images are converted to input tokens by the model, so they’re billed as input tokens at the model’s input price. The usage.prompt_tokens in the response (and the request log) shows what an image cost you.

Download on the App StoreGet it on Google Play