Skip to main content
Pass image URLs or base64-encoded images into chat completions to let the model see and reason about visual content. Auriko supports vision through the OpenAI-compatible image_url content part.

Prerequisites

  • An Auriko API key
  • Python 3.10+ with auriko SDK installed (pip install auriko)
    • OR Node.js 18+ with @auriko/sdk installed (npm install @auriko/sdk)
  • A vision-capable model (e.g., gpt-4o, claude-3.5-sonnet, gemini-2.0-flash)

Analyze an image from a URL

Pass an image URL as a content part in the user message:
import os
from auriko import Client

client = Client(
    api_key=os.environ["AURIKO_API_KEY"],
    base_url="https://api.auriko.ai/v1",
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is in this image?"},
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png"
                    },
                },
            ],
        }
    ],
    max_tokens=300,
)

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

Analyze a base64-encoded image

For local files or private images, encode the bytes as a data URL:
import base64
import os
from auriko import Client

client = Client(
    api_key=os.environ["AURIKO_API_KEY"],
    base_url="https://api.auriko.ai/v1",
)

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

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Summarize the trend in this chart."},
                {
                    "type": "image_url",
                    "image_url": {"url": f"data:image/png;base64,{b64}"},
                },
            ],
        }
    ],
    max_tokens=500,
)

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

Multiple images in one request

Send several images in a single request by adding multiple image_url content parts:
messages=[
    {
        "role": "user",
        "content": [
            {"type": "text", "text": "Compare these two charts."},
            {"type": "image_url", "image_url": {"url": "https://example.com/q1.png"}},
            {"type": "image_url", "image_url": {"url": "https://example.com/q2.png"}},
        ],
    }
]

Response shape

Vision responses use the standard ChatCompletionResponse shape. The model’s analysis appears in choices[0].message.content as text — there is no separate vision response schema.

Errors

SituationHTTPSDK error
Image URL unreachable400BadRequestError
Image too large for the model’s context window400BadRequestError
Model does not support vision400BadRequestError
Unsupported image format400BadRequestError
Check Supported parameters for the accepted content part types and see Error codes for the full error taxonomy.