cyberine
Providers

Anthropic Claude API (Messages)

  • Kind: raw API (Messages format)
  • Official docs: https://platform.claude.com/docs/en/api/messages (redirected from docs.anthropic.com)
  • Cyberine usage: reached three ways — the native AnthropicAgentAdapter (key-only, no gateway/CLI), the LiteLLM gateway (anthropic/claude alias), and as the API behind the Claude Code CLI.
  • Researched/verified: 2026-06-07 — confidence high (live docs).

Base URL & auth

Base URLhttps://api.anthropic.com/v1/messages
Auth headerx-api-key: <ANTHROPIC_API_KEY>
Required headeranthropic-version: 2023-06-01 (omit → 400)
Beta featuresanthropic-beta: <feature> (e.g. output-300k-2026-03-24, fast-mode-2026-02-01)

Endpoints

Method + pathPurpose
POST /v1/messagesCreate a message. Primary surface.
POST /v1/messages/count_tokensCount tokens without generating.
GET /v1/modelsList models + capabilities.
POST /v1/messages/batches, GET /v1/messages/batches/{id}Async batch (50% off).

Models (Jul 2026)

Model idNotes
claude-fable-5-1Current Fable tier (Claude Code v2.1.257; kmq47 sweep 2026-09-04). 1M ctx, $10/$50 — the SAME base rate as claude-fable-5, verified live on the pricing table, not taken from the release note. What differs is the cache: a cache HIT costs $0.25/MTok (0.025x base input) where every other model uses 0.1x, so Fable 5 charges $1/MTok for the identical read. Writes unchanged ($12.50 5m / $20 1h); batch $5/$25. NOT live-probed against the API from this repo.
claude-fable-5Previous Fable tier. 1M ctx, 128K out, $10/$50, cache hits $1/MTok. Thinking always on ({type:"disabled"} 400s — omit it); requires 30-day retention. Released 2026-07-02.
claude-sonnet-5-5Current Sonnet tier (Claude Code v2.1.284, 2026-09-28: "now the default Sonnet model on the Anthropic API"; kvhxs 2026-10-01). 1M ctx, 128K out, $2/$10 standard; cache writes $2.50 (5m) / $4 (1h), hits $0.20 (the standard 0.1x); batch $1/$5. Adaptive thinking (not always on), default effort high. Reliable knowledge cutoff Jun 2026; retirement not sooner than 2027-09-28. Verified live 2026-10-01 against platform.claude.com/docs/en/about-claude/{pricing,models/overview}. Cyberine default since 2026-10-01 (native adapter ANTHROPIC_MODEL + claude CLI worker CYBERINE_CLAUDE_MODEL).
claude-sonnet-5Legacy since Sonnet 5.5 (listed under "Legacy models (still available)" on the models overview, 2026-10-01); Cyberine default until 2026-10-01. Best speed/intelligence; near-Opus coding/agentic. 1M ctx, 128K out, $2/$10 (launched as intro pricing through 2026-08-31; made the permanent standard price -- the scheduled 2026-09-01 increase to $3/$15 "will not occur", verified live 2026-08-21). Adaptive thinking on by default. New tokenizer (~30% more tokens vs Sonnet 4.6). Cyberine default (native adapter + claude CLI worker) as of 2026-07-01.
claude-opus-5-5Current Opus tier (CC v2.1.280: "now the default Opus model"; kdhbf 2026-09-25). 1M ctx, 128K out, $4/$20 standard; cache hits $0.20/MTok (0.05x base input), writes $5 (5m) / $8 (1h); fast mode $8/$40; batch $2/$10. Adaptive thinking always on, default effort medium. Reliable knowledge cutoff Jun 2026; retirement not sooner than 2027-09-22. Verified live 2026-09-25 against platform.claude.com/docs/en/about-claude/pricing and /docs/en/models/overview.
claude-opus-5Previous Opus tier (replaced 4-8 as "the default Opus model", CC v2.1.219, 2026-07-24). 1M ctx, 128K out, $5/$25 standard (fast mode $10/$50 -- see Gotchas). Adaptive thinking. Reliable knowledge cutoff May 2026. Verified live 2026-08-21 against platform.claude.com/docs/en/docs/about-claude/{pricing,models}.
claude-opus-4-8Previous Opus tier. 1M ctx, 128K out, $5/$25. Adaptive thinking. Cutoff Jan 2026.
claude-opus-4-71M ctx, 128K out, $5/$25. New tokenizer (~35% more tokens).
claude-opus-4-61M ctx, 128K out, $5/$25. No real fast mode: speed: "fast" is accepted but runs at standard speed and bills standard rates (live pricing page, 2026-08-21).
claude-opus-4-5-20251101Legacy. 200K ctx, 64K out, $5/$25.
claude-sonnet-4-6Previous-gen Sonnet. 1M ctx, 64K out, $3/$15. Cutoff Aug 2025.
claude-sonnet-4-5-20250929Legacy. 200K ctx, 64K out, $3/$15.
claude-haiku-4-5-20251001Fastest. 200K ctx, 64K out, $1/$5.
claude-opus-4-{0,1}-*, claude-sonnet-4-20250514DEPRECATED; -opus-4-0/-sonnet-4-20250514 past retirement (Jun 15 2026), -opus-4-1 retires Aug 5 2026. Do not use as a default.

Naming change: 4.6+ ids are dateless pinned snapshots (claude-sonnet-4-6), not evergreen pointers. Pre-4.6 aliases resolve to dated snapshots.

Key request params

  • model, messages (role: user|assistant, content string or blocks), max_tokens (required)
  • system (string or blocks), stream, tools (with input_schema), tool_choice (auto/any/tool/none, disable_parallel_tool_use)
  • thinking: {type: enabled|disabled|adaptive, budget_tokens: ≥1024, display}
  • temperature (0–1), top_p, top_k, stop_sequences
  • cache_control ({type: ephemeral, ttl: 5m|1h}), service_tier, inference_geo (us/global), metadata.user_id

Notable features

  • Streaming SSE: message_start → content_block_start/delta/stop → message_delta → message_stop.
  • Tool use: custom tools (JSON Schema) + built-in server tools (web_search, web_fetch, code_execution, bash, str_replace_based_edit_tool, memory). Parallel tool use (toggle off via tool_choice.disable_parallel_tool_use).
  • Prompt caching: cache_control breakpoints; TTLs 5m (1.25x write / 0.1x read) and 1h (2x / 0.1x); max_tokens:0 to pre-warm.
  • Extended + adaptive thinking: thinking blocks carry a signature; on Opus 4.6/4.7/4.8 + Sonnet 4.6 the model decides how much to think.
  • Batch API (50% off), token counting, vision, document/PDF input, citations.
  • Fast mode (beta), extended output up to 300K (beta, Batch), Managed Agents (beta).

Gotchas

  • anthropic-version: 2023-06-01 required on every request.
  • Thinking blocks MUST be echoed back (with signature) on the next turn or multi-turn continuity breaks. (Compare: the Messages API thinking-block echo is analogous to the Kimi reasoning_content echo — but is a different field on a different API.)
  • 4.7+ uses a new tokenizer (~35% more tokens) — recalibrate cost.
  • max_tokens includes thinking tokens when thinking is on → set max_tokens > budget_tokens.
  • inference_geo: us = 1.1x price on all tokens; only on Opus 4.6 / Sonnet 4.6+ (older models 400 if the field is sent).
  • web_search is billed $10 / 1,000 searches (not token-only).
  • Fast mode not on AWS or Batch. Fast mode ($10/$50 per MTok) is only for Opus 5 / Opus 4.8 (speed: "fast"); Opus 4.7 errors on the param, Opus 4.6 accepts it but silently bills standard rate (no real fast mode).
  • claude-sonnet-4-20250514 / claude-opus-4-20250514 retire 2026-06-15.
  • Fable 5 / Mythos 5 refusal stop_reason: safety classifiers can return HTTP 200 with stop_reason: "refusal" (empty content pre-output, partial mid-stream — always check stop_reason before reading content[0]). Recovery is opt-in on the API (fallbacks + beta server-side-fallback-2026-06-01, falls back to claude-opus-4-8).

Pricing

Fable 5 $10/$50 · Opus 5 + 4.x $5/$25 (Opus 5 / Opus 4.8 fast mode $10/$50) · Sonnet 5 $2/$10 (permanent since 2026-08; the 2026-09-01 rise to $3/$15 was cancelled) · Sonnet 4.x $3/$15 · Haiku 4.5 $1/$5 (per MTok in/out). Cache writes 1.25x/2x, reads 0.1x. Batch 50% off. Page: https://platform.claude.com/docs/en/about-claude/pricing

Cyberine integration notes

  • Native adapter (added 2026-06-07): AnthropicAgentAdapter (src/adapters/AnthropicAgentAdapter.ts) speaks this Messages API directly via @anthropic-ai/sdk — the key-only, zero-install path to Claude that needs NO gateway/Docker and NO CLI. Build worker loop-claude-native-build (opt-in via CYBERINE_BUILD_FLEET) uses it with the sandbox-pinned implementer toolset; gated on ANTHROPIC_API_KEY, configured by ANTHROPIC_MODEL (default claude-sonnet-5 as of 2026-07-01) / ANTHROPIC_BASE_URL. The adapter pushes each assistant turn's FULL content blocks back into context, so thinking-block signature echo (the gotcha above) is preserved natively — no special handling needed.
  • Refusal handling + fallback (added 2026-07-01): the adapter always checks stop_reason === 'refusal' before reading response content and returns a clean Result (status: 'partial', empty output, error describing the refusal category — never a crash on empty/partial content). Opt-in fallback to claude-opus-4-8 on refusal is gated by CYBERINE_ANTHROPIC_FABLE_FALLBACK=1 (config.anthropicFableFallback, only meaningful when ANTHROPIC_MODEL is a Fable-tier model). The installed @anthropic-ai/sdk (0.102.0) has no typed fallbacks request param or BetaRefusalFallbackMiddleware, so the adapter re-issues the same request against the fallback model client-side (once per run) while also sending the anthropic-beta: server-side-fallback-2026-06-01 header as a good-faith opt-in for any backend that does support it server-side.
  • Also reachable via the LiteLLM gateway (litellm.md) using LOOP_MODEL_A=anthropic/claude (OpenAI-compat, needs Docker), and is the upstream for the Claude Code CLI worker (claude-code-cli.md) (needs the claude binary). Pick the native adapter when you want Claude key-only with full native features and no external infra.
  • The claude build worker's default model claude-sonnet-5 (CYBERINE_CLAUDE_MODEL, bumped from claude-sonnet-4-6 on 2026-07-01) is a confirmed current Anthropic id; the native adapter shares that default via ANTHROPIC_MODEL.
  • claude-sonnet-5-5 added and made the default (2026-10-01, kvhxs): catalog, pricing and strength rows added; ANTHROPIC_MODEL, the Anthropic provider default and the claude CLI worker's CYBERINE_CLAUDE_MODEL fallback moved from claude-sonnet-5. Why the default moved: the same list price, the newer model, and Sonnet 5 now listed as legacy. claude-sonnet-5 stays cataloged and priced for existing configs. The strength row is UNVERIFIED (inherits Sonnet 5's rank 4) until the next benchmark snapshot, so routing does not drop it to the unknown-model rank 3. Not moved: the OpenRouter re-ranker default anthropic/claude-sonnet-5 (an OpenRouter id this task did not verify).
  • claude-opus-5-5 added to the catalog + pricing table (2026-09-25, kdhbf): priced from the vendor pricing table above, including its 0.05x cache-hit rate in cachedInputCostPerMTok. claude-opus-5 stays cataloged. No default changed; Opus stays opt-in.
  • claude-opus-5 added to the catalog + pricing table (2026-08-21, k3kbw): claude-opus-4-8 stays cataloged (not superseded in place — existing runs/configs reference it); claude-opus-5 sits alongside it as the current Opus tier. No default changed — claude-sonnet-5 remains the claude worker's and ANTHROPIC_MODEL's default; Opus is opt-in only (explicit ANTHROPIC_MODEL=claude-opus-5 / CYBERINE_CLAUDE_MODEL=claude-opus-5 / catalog picker).

Sources