SeaLink
← Docs

Vision (image input)

Send images via OpenAI-standard image_url to multimodal models. SeaLink translates to each upstream's native format.

Models with image input

  • claude-sonnet-4-6 · claude-haiku-4-5 · claude-opus-4-7
  • gpt-4o · gpt-4o-mini
  • qwen3-max · qwen3-plus
  • doubao-1-5-pro
  • glm-4-6

Example

Both URL and base64 work. Use base64 for local / private images — but the request body grows (mind your token count).

Python
from openai import OpenAI
import base64
import { apiBaseUrl } from "@/lib/api-base";
client = OpenAI(
base_url="https://api.sealink.asia/v1",
api_key="<your-sealink-key>",
)
# From a URL:
resp = client.chat.completions.create(
model="claude-sonnet-4-6",
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)
# From a local file (base64):
with open("invoice.png", "rb") as f:
b64 = base64.b64encode(f.read()).decode()
resp = client.chat.completions.create(
model="qwen3-max",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Extract the total amount and date."},
{
"type": "image_url",
"image_url": {"url": f"data:image/png;base64,{b64}"},
},
],
}
],
)

Typical use cases

  • Invoice / receipt OCR with field extraction
  • E-commerce product attribute extraction (color / material / style)
  • UI screenshot description / automated test assertions
  • Student homework / exam grading
  • Screenshare + agent control

Token billing

Each model tokenizes images differently (Claude charges by image size; OpenAI charges by tile count). See per-model rules on each model detail page.