OneProvider
API reference

Vision

Send images to Claude through /v1/messages as base64 or a URL. See the request format, supported file types, size limits and which model to pick.

All Claude models accept images. Pass them inline as base64 or as a URL inside an image content block.

All models, capabilities, and prices Documentation index for AI agents: https://oneprovider.dev/docs/llms.txt

Image content block

Mix text and image blocks inside the same content array. The model treats them as a single ordered stream.

json
{
"model": "claude-sonnet-5-5",
"max_tokens": 512,
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Describe this image in one sentence." },
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "iVBORw0KGgoAAAANSUhEUgAAA..."
}
}
]
}
]
}

URL source

The API also accepts a public HTTPS URL: we fetch the image server-side and pass it to the model.

json
{
"type": "image",
"source": {
"type": "url",
"url": "https://example.com/diagram.png"
}
}

Formats & limits

  • Media types: image/jpeg, image/png, image/gif, image/webp.
  • Up to 20 images per request and 5 MB per image before base64-encoding.
  • Animated GIFs are decoded to the first frame.
  • Vision tokens are billed as input tokens — a typical 1024×1024 image runs ~1600 tokens.

Python (file → base64)

python
import base64, mimetypes
from anthropic import Anthropic
client = Anthropic(base_url="https://api.oneprovider.dev")
def encode_image(path: str):
with open(path, "rb") as f:
data = base64.standard_b64encode(f.read()).decode("ascii")
return {
"type": "base64",
"media_type": mimetypes.guess_type(path)[0] or "image/png",
"data": data,
}
msg = client.messages.create(
model="claude-sonnet-5-5",
max_tokens=512,
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What's in this screenshot?"},
{"type": "image", "source": encode_image("./screen.png")},
],
}],
)
print(msg.content[0].text)

Picking a model for vision

  • OCR and dense text — claude-opus-5-5 when accuracy matters more than cost.
  • Object and scene description — claude-sonnet-5-5 as the balanced default.
  • Simple diagrams and UI screenshots — claude-haiku-5-5 for low-cost batch processing; move complex cases to Sonnet or Opus.
No image generation Vision is input-only. Claude does not generate images on this endpoint. If you need image generation, pair OneProvider with a separate provider (Replicate, fal.ai, OpenAI) — both APIs can sit side-by-side in the same app.

Quick answers

Which base URL do I use?

Claude Code and Anthropic SDKs use https://api.oneprovider.dev. OpenAI SDKs and OpenAI-compatible clients use https://api.oneprovider.dev/v1. One key works behind both; the model list is on the models page ; rates are on the pricing page .

How do I authenticate?

Send the raw sk-… key in x-api-key or Authorization: Bearer: one of them, never both. Keep the key in an environment variable, not in a file that gets committed. More on authentication .

Where do I get a key?

Open your cabinet in the Telegram bot @oneprovider_robot or at app.oneprovider.dev, top up the balance and press “Issue a key”. Each key can carry its own spend limit. Cabinet & API keys .

What do 401, 404 and 429 mean?

401: the key is missing, mistyped or sent in the wrong header; paste the whole key without quotes or spaces. 404: usually a wrong base URL, for example a missing or doubled /v1. 429 with “Insufficient balance”: the cabinet balance or the key’s spend limit is used up, so top up instead of retrying; any other 429 is a rate limit, so wait for Retry-After. Details: error codes and troubleshooting .

Why do streams cut off or reset?

VPN and VLESS proxies often buffer SSE or break HTTP/2 negotiation. OneProvider has no regional restrictions and does not buffer streams, so turn the proxy off and retry.

Where do I ask if this is not enough?

Message @Oneproviderhelpbot on Telegram or open “Support” in the web cabinet, with the HTTP status code and the exact error message. How support works .

Last updated: 2026-10-05 Found a bug? @Oneproviderhelpbot