Vision & image input

58 models on MeshTok accept images: GPT-5 vision variants, Claude Sonnet/Opus, GLM-4V+, Qwen-VL, Gemini, and more. Send images as URLs or base64-encoded data URIs in the content array, alongside text.

Image from URL

from openai import OpenAI
client = OpenAI(base_url="https://meshtok.com/v1", api_key="sk-...")

resp = client.chat.completions.create(
    model="google/gemini-2.5-pro",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "What's in this image?"},
            {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}},
        ],
    }],
)
print(resp.choices[0].message.content)

Image from local file (base64)

import base64, httpx

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

resp = client.chat.completions.create(
    model="anthropic/claude-sonnet-5",
    messages=[{
        "role": "user",
        "content": [
            {"type": "text", "text": "Summarize this chart in 3 bullets."},
            {"type": "image_url", "image_url": {
                "url": f"data:image/png;base64,{b64}"
            }},
        ],
    }],
)

Multiple images

Pass multiple image_url blocks in one message — useful for comparing two screenshots, reading a multi-page document, or giving the model several angles of an object. Most models accept up to ~10 images per turn; check the model's detail page for the limit.

OCR & document extraction

Models tagged OCR (GLM-4V, Qwen-VL-Max, GPT-5) handle scanned documents, receipts, and handwriting well. For dense text, prefer the model's native document mode and prompt explicitly: "Transcribe this document verbatim, preserving layout."

Cost notes

→ Structured outputs → Streaming Browse vision models