Skip to content
RU

Claude Sonnet 5

Claude Sonnet 5 (anthropic/claude-sonnet-5) is Anthropic’s most capable Sonnet: coding, agents and professional work, with adaptive thinking support. Besides the OpenAI-compatible POST /v1/chat/completions, the model is reachable through the Anthropic-protocol POST /v1/messages — so it runs in Claude Code and the Anthropic SDK directly, with no adapters.

Capability Value
model anthropic/claude-sonnet-5 (or the short claude-sonnet-5)
Image input Yes — image_url with a data: URL in the last message
File input Yes — PDF, DOCX, TXT, CSV, XLSX, PPTX, up to 5 per request
Reasoning reasoning_effort: low, medium, high, xhigh, max; disabled with off
Cache read 21.40 ₽ ($0.24) per 1M tokens
Cache write 267.40 ₽ ($3) per 1M tokens

Cache read is exactly one tenth of the input price (21.40 ₽ against 213.90 ₽), write is ×1.25; in a dense session sliding renewal keeps the cache alive from start to finish. Reasoning is billed as output tokens and eats into the max_tokens budget — see Context caching.

from openai import OpenAI
client = OpenAI(base_url="https://api.mixen.ai/v1", api_key="mxn-...")
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Analyze this crash log and find the root cause"}],
reasoning_effort="high",
)
print(resp.choices[0].message.content)
stream = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Draft a review checklist for Go pull requests"}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)

The same key and balance work over POST /v1/messages. The base URL carries no /v1 suffix: the SDK appends it to the path itself, unlike the OpenAI SDK.

from anthropic import AsyncAnthropic
client = AsyncAnthropic(
base_url="https://api.mixen.ai",
api_key="mxn-...", # the x-api-key header is supported
)
msg = await client.messages.create(
model="anthropic/claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hi!"}],
)
print(msg.content[0].text)

Claude Code assigns this model to ANTHROPIC_DEFAULT_SONNET_MODEL — the setup is covered in the Claude Code guide.

Per 1M tokens: input — 213.90 ₽ ($2.40), output — 1069.50 ₽ ($12). Context cache: read — 21.40 ₽ ($0.24), write — 267.40 ₽ ($3). Catalog prices track the exchange rate — take current values from the catalog.

  • Coding, agents and professional work — the model’s profile per Anthropic’s description.
  • Adaptive thinking per the model description; depth is regulated by reasoning_effort up to xhigh and max, disabled with off.
  • Claude Code and the Anthropic SDK connect directly — tool use, streaming, count_tokens and cache_control work.
  • Prompt caching: reading from cache costs exactly one tenth of the input price — the main saving on long sessions.
  • Reasoning eats into max_tokens; each file contributes up to 150,000 characters, no OCR.
  • Output at 1069.50 ₽ per 1M tokens is flagship territory; for high-volume routine Claude Haiku 4.5 is cheaper — 107 ₽ input / 534.80 ₽ output.

All models — in the catalog. The general text workflow — chat guide.