Vision & Bildeingabe

Senden Sie Bilder an 58 Vision-Modelle.

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"}},
        ],
    }],
)

Image from local file (base64)

import base64

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."},
            {"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.

OCR & document extraction

Models tagged OCR (GLM-4V, Qwen-VL-Max, GPT-5) handle scanned documents, receipts, and handwriting well.

Cost notes

→ Strukturierte Ausgabe → Streaming-Antworten Vision & Bildeingabe