Claude Sonnet 4.6
anthropic/claude-sonnet-4-6 — a llm model by Anthropic. Call it through the gateway’s standard OpenAI-compatible door using the catalog slug; the full parameter schema is reproduced in full below.
| Catalog slug | anthropic/claude-sonnet-4-6 |
| Kind | llm |
| Vendor | Anthropic |
| Context window | 1,000,000 tokens |
| Native model id | claude-sonnet-4-6 |
How to call
Section titled “How to call”Through the Sociaro SDK / OpenAI-compatible door
Section titled “Through the Sociaro SDK / OpenAI-compatible door”This is an Anthropic model. When you call chat.completions.create, the SDK automatically translates the request to the Anthropic Messages format and sends it to POST /v1/messages. Calling the gateway directly (without the SDK) must use POST /v1/messages — POST /v1/chat/completions returns 400 for Anthropic models (that door serves OpenAI-format models only).
from sociaro_ai import Sociaro
client = Sociaro(api_key="gw_live_...") # base_url defaults to https://api.sociaro.com
resp = client.chat.completions.create( model="anthropic/claude-sonnet-4-6", # always the catalog slug messages=[{"role": "user", "content": "Hello"}], # any parameter from the schema below is passed through unchanged)print(resp.choices[0].message.content)TypeScript: client.chat.completions.create({ model: "anthropic/claude-sonnet-4-6", messages: [...] }) — see the TypeScript SDK.
Through Anthropic’s native API (advanced)
Section titled “Through Anthropic’s native API (advanced)”Optional: send Anthropic’s native request to the /anthropic prefix, using the native model id claude-sonnet-4-6. The gateway injects the upstream Anthropic credential and forwards the body unchanged (catalog, pricing and entitlements still apply).
curl https://api.sociaro.com/anthropic/v1/messages \ -H "x-api-key: $SOCIARO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", ... }'The exact path, request body and response shape are documented in full in the schema below.
Parameters — full schema
Section titled “Parameters — full schema”The complete, one-to-one API schema for this model, transcribed from the official source. Nothing omitted. Examples in the schema may use a representative model of the family — for this model use the slug anthropic/claude-sonnet-4-6 (or the native id claude-sonnet-4-6 for the native API) as shown in How to call above.
Coverage map (model enum)
Section titled “Coverage map (model enum)”The model field is an enum, and free-string dated aliases are also accepted.
| Model id | Tagline |
|---|---|
claude-fable-5 | Next generation of intelligence for the hardest knowledge work and coding problems |
claude-mythos-5 | Most capable model for cybersecurity and biology research |
claude-mythos-preview | New class of intelligence, strongest in coding and cybersecurity |
claude-opus-4-8 | Frontier intelligence for long-running agents and coding |
claude-opus-4-7 | Frontier intelligence for long-running agents and coding |
claude-opus-4-6 | Frontier intelligence for long-running agents and coding |
claude-opus-4-5, claude-opus-4-5-20251101 | Premium model combining maximum intelligence with practical performance |
claude-opus-4-1, claude-opus-4-1-20250805 | Exceptional model for specialized complex tasks |
claude-opus-4-0, claude-opus-4-20250514 | Powerful model for complex tasks |
claude-sonnet-4-6 | Best combination of speed and intelligence |
claude-sonnet-4-5, claude-sonnet-4-5-20250929 | High-performance model for agents and coding |
claude-sonnet-4-0, claude-sonnet-4-20250514 | High-performance model with extended thinking |
claude-haiku-4-5, claude-haiku-4-5-20251001 | Fastest model with near-frontier intelligence |
Additional dated/legacy aliases (e.g. claude-3-haiku-20240307) are accepted as free strings. For gateway slugs anthropic/claude-* the native prefix is transparent: these parameters pass through to /v1/messages one-to-one.
Critical per-model differences
Section titled “Critical per-model differences”-
Sampling params are deprecated.
temperature,top_p,top_kare marked Deprecated. Models released after Claude Opus 4.6 do not support setting them:temperature: only1.0is accepted (backwards compatibility); any other value returns HTTP 400.top_p: only>= 0.99is accepted (backwards compatibility); any other value returns HTTP 400.top_k: any value is rejected with HTTP 400.
-
Extended thinking mode varies by model (source: extended-thinking guide):
claude-fable-5,claude-mythos-5: extended thinking is always on and cannot be disabled. Manualthinking:{type:"enabled", budget_tokens:N}is not supported (HTTP 400), andthinking:{type:"disabled"}returns an error. Use adaptive thinking and control depth withoutput_config.effort.claude-opus-4-8,claude-opus-4-7: manualthinking:{type:"enabled"}is not supported (HTTP 400). Usethinking:{type:"adaptive"}withoutput_config.effort; the model decides whether and how much to think.claude-mythos-preview: adaptive is the default;type:"enabled"is also accepted;type:"disabled"is not supported.displaydefaults to"omitted"here (not"summarized") — passdisplay:"summarized"to receive summaries.claude-opus-4-6,claude-sonnet-4-6: adaptive thinking is recommended; manualtype:"enabled"(including interleaved) is deprecated but still functional.- Other current models (
haiku-4-5,sonnet-4-5/4-0,opus-4-5/4-1/4-0): manual extended thinking (type:"enabled", budget_tokens:N) is supported. In summary, manual thinking is supported on all current models except Fable 5, Mythos 5, Opus 4.8, and Opus 4.7, where it returns HTTP 400.
-
output_config.effortcontrols reasoning depth for adaptive-thinking models (Opus 4.8/4.7, Fable 5, Mythos 5, Mythos Preview); pairs withthinking:{type:"adaptive"}. -
Priority Tier (
service_tier) is supported on all models exceptclaude-mythos-previewandclaude-mythos-5. -
max_tokensmaximum differs per model (see the Models overview).0is legal (warms the prompt cache without generating).
Endpoint
Section titled “Endpoint”- Create:
POST https://api.anthropic.com/v1/messages - Token-counting twin:
POST https://api.anthropic.com/v1/messages/count_tokens— same body params (no sampling/output-generation effect); returns{ "input_tokens": N }. - Send a structured list of input messages (text and/or image/document content); the model generates the next message. Usable for single queries or stateless multi-turn conversations.
Request HTTP headers
Section titled “Request HTTP headers”| Header | Required | Value / notes |
|---|---|---|
x-api-key | yes | Your Anthropic API key. |
anthropic-version | yes | API version, e.g. 2023-06-01. Send it on every request. |
content-type | yes | application/json. |
anthropic-beta | no | Comma-separated beta feature flags (fine-grained tool streaming, extended cache TTL, etc.). |
When service_tier="auto" and a model has a Priority Tier commitment, the response also returns rate headers: anthropic-priority-input-tokens-limit/-remaining/-reset and anthropic-priority-output-tokens-limit/-remaining/-reset.
Request body — top-level parameters
Section titled “Request body — top-level parameters”| Name | Type | Required | Default | Allowed / range | Description |
|---|---|---|---|---|---|
model | Model (string enum or free-string alias) | yes | — | See coverage map enum | The model that will complete your prompt. |
messages | array of MessageParam {content, role} | yes | — | — | Input messages. Models operate on alternating user/assistant turns; consecutive same-role turns are merged. A trailing assistant turn is continued (prefill). |
max_tokens | integer | yes | — | minimum 0 (model-specific maximum) | Max tokens to generate before stopping. The model may stop earlier. 0 warms the prompt cache without generating a response. Different models have different maximums. |
system | string OR array of TextBlockParam {text, type, cache_control, citations} | no | — | — | System prompt (context/instructions/role). There is no "system" role in messages; use this top-level field. |
stop_sequences | array of string | no | — | — | Custom text sequences that stop generation. On match, response stop_reason = "stop_sequence" and stop_sequence = the matched string. |
stream | boolean | no | false | true/false | Incrementally stream the response via server-sent events. |
temperature | number | no | 1.0 | 0.0–1.0 | Deprecated. Amount of randomness. Models released after Opus 4.6 do not support setting it — only 1.0 is accepted for backwards compatibility; other values return HTTP 400. Even 0.0 is not fully deterministic. |
top_p | number | no | — | 0.0–1.0 | Deprecated. Nucleus sampling. Models released after Opus 4.6 reject it — only >= 0.99 is accepted for backwards compatibility; other values return HTTP 400. Advanced use only. |
top_k | number | no | — | minimum 0 | Deprecated. Sample only from top-K tokens. Models released after Opus 4.6 reject any value with HTTP 400. Advanced use only. |
tools | array of ToolUnion | no | — | — | Tool definitions the model may call (tool_use blocks). Includes custom client tools and server tools. See shapes below. |
tool_choice | ToolChoice (union) | no | auto (when tools present) | {type:"auto"|"any"|"tool"|"none"} | How the model uses tools. auto = model decides; any = must use some tool; tool (+name) = must use the named tool; none = no tools. auto/any/tool accept optional disable_parallel_tool_use (boolean, default false). |
thinking | ThinkingConfigParam (union) | no | — | enabled / disabled / adaptive (see below) | Configuration for extended thinking. See the per-model matrix above and the dedicated section below. |
metadata | Metadata {user_id} | no | — | user_id maxLength 512 | Metadata about the request. user_id: opaque external user id (uuid/hash) for abuse detection — must not contain name/email/phone. |
service_tier | string (enum) | no | "auto" | "auto", "standard_only" | Whether to use priority capacity (if available) or standard. auto may use priority then fall back; standard_only forces standard. |
output_config | OutputConfig {effort?, format?} | no | — | see below | Output options: reasoning effort and/or structured-output JSON schema. |
container | string | no | — | — | Container identifier for reuse across requests (code execution tool). |
inference_geo | string | no | workspace default_inference_geo | — | Geographic region for inference processing. |
MCP is not configured through a top-level request field on this endpoint; there is no mcp_servers parameter in the request body.
thinking — ThinkingConfigParam (discriminated union)
Section titled “thinking — ThinkingConfigParam (discriminated union)”type discriminates three variants. display is present only on enabled and adaptive; it is absent on disabled (ThinkingConfigDisabled properties = {type} only).
| Variant | Shape | Fields |
|---|---|---|
ThinkingConfigEnabled | {type:"enabled", budget_tokens, display?} | type="enabled". budget_tokens (number, minimum 1024, must be < max_tokens; counts toward max_tokens). display: "summarized" (default) or "omitted". |
ThinkingConfigDisabled | {type:"disabled"} | type="disabled" only. No display field. |
ThinkingConfigAdaptive | {type:"adaptive", display?} | type="adaptive". display: "summarized" (default) or "omitted". Model picks its own budget. |
display semantics: "summarized" → thinking returned normally; "omitted" → thinking content redacted but a signature is returned for multi-turn continuity. Defaults to "summarized" (except claude-mythos-preview, where it defaults to "omitted").
output_config — OutputConfig
Section titled “output_config — OutputConfig”| Field | Type | Required | Allowed | Notes |
|---|---|---|---|---|
effort | string enum | no | "low", "medium", "high", "xhigh", "max" | Reasoning effort level (adaptive-thinking models). |
format | JSONOutputFormat {schema, type} | no | type="json_schema"; schema=JSON Schema | Structured-outputs JSON schema for Claude’s output format. |
tool_choice — ToolChoice (union)
Section titled “tool_choice — ToolChoice (union)”| Variant | Shape |
|---|---|
ToolChoiceAuto | {type:"auto", disable_parallel_tool_use?} — model decides; disable_parallel_tool_use default false, if true outputs at most one tool use. |
ToolChoiceAny | {type:"any", disable_parallel_tool_use?} — must use some tool; if disable_parallel_tool_use=true, outputs exactly one tool use. |
ToolChoiceTool | {name, type:"tool", disable_parallel_tool_use?} — name (string) = the tool to use; if disable_parallel_tool_use=true, exactly one tool use. |
ToolChoiceNone | {type:"none"} — model not allowed to use tools. |
cache_control — CacheControlEphemeral
Section titled “cache_control — CacheControlEphemeral”Applied per-block (text/image/document/tool/tool_result/system blocks) to set a prompt-cache breakpoint.
| Field | Type | Required | Allowed | Default |
|---|---|---|---|---|
type | string | yes | "ephemeral" | — |
ttl | string | no | "5m" (5 minutes), "1h" (1 hour) | "5m" |
messages[].content — block types (request side, ContentBlockParam)
Section titled “messages[].content — block types (request side, ContentBlockParam)”content is a string (shorthand for one text block) OR an array of typed blocks. Each input message: { "role": "user"|"assistant", "content": ... }. Block type values:
Block type | Key fields | Notes |
|---|---|---|
text | text (string); optional cache_control, citations (array of TextCitationParam) | Plain text. |
image | source: base64 {data, media_type} (image/jpeg/png/gif/webp), or url, or file | Vision input. |
document | source: base64 PDF {data, media_type:"application/pdf"}, url, file, text, or content; optional citations {enabled}, title, context, cache_control | PDF / document input. |
tool_use | id, name, input | Model-generated tool call (assistant turns). |
tool_result | tool_use_id, content (string or blocks), is_error?, cache_control? | Result returned to the model. |
thinking / redacted_thinking | thinking/data, signature | Extended-thinking blocks — echo back for multi-turn continuity. |
search_result | content, source, title; optional citations {enabled}, cache_control | Search-result content. |
server_tool_use, web_search_tool_result, web_fetch_tool_result, code_execution_tool_result, bash_code_execution_tool_result, text_editor_code_execution_tool_result, container_upload | varies | Server-tool / container blocks. |
Most blocks accept optional cache_control: {type:"ephemeral", ttl:"5m"|"1h"}.
tools[] item shape — custom client tool (Tool)
Section titled “tools[] item shape — custom client tool (Tool)”| Field | Type | Required | Constraints / values | Notes |
|---|---|---|---|---|
name | string | yes | minLength 1, maxLength 128 | How the model calls the tool (also appears in tool_use blocks). |
input_schema | object {type:"object", properties?, required?} | yes | JSON Schema (draft 2020-12); properties = object map; required = array of string | Shape of the tool input. |
description | string | no | — | Strongly recommended; more detail → better tool-use quality. |
type | string | no | "custom" | Custom tool marker. |
cache_control | CacheControlEphemeral {type, ttl?} | no | ttl "5m"/"1h" | Cache breakpoint at this tool. |
allowed_callers | array of string | no | "direct", "code_execution_20250825", "code_execution_20260120" | Who may call the tool. |
defer_loading | boolean | no | — | If true, tool loaded lazily via tool-search tool_reference. |
eager_input_streaming | boolean | no | — | Stream tool input incrementally (fine-grained streaming). |
input_examples | array | no | — | Example inputs. |
strict | boolean | no | — | Guarantee schema validation on tool names/inputs. |
Server-tool variants (ToolUnion, discriminated by type with a fixed dated version)
Section titled “Server-tool variants (ToolUnion, discriminated by type with a fixed dated version)”Each has its own fixed name and config; some support strict, cache_control, allowed_callers, and a user_location {city?, country?, region?, timezone?} (web search/fetch):
- Bash:
bash_20250124 - Code execution:
code_execution_20250522,code_execution_20250825,code_execution_20260120 - Web search:
web_search_20250305,web_search_20260209 - Web fetch:
web_fetch_20250910,web_fetch_20260209,web_fetch_20260309 - Text editor:
text_editor_20250124,text_editor_20250429,text_editor_20250728(plus thetext_editor_code_executionresult block family) - Memory:
memory_20250818 - Tool search / clear-tool-uses: dated context-management tool variants (
tool_search, withtool_referencefor deferred-loaded tools)
Response body (HTTP 200) — Message object
Section titled “Response body (HTTP 200) — Message object”Message {id, container, content, model, role, stop_reason, stop_sequence, stop_details, type, usage}.
| Field | Type | Notes |
|---|---|---|
id | string | Unique object id (e.g. msg_…). Format/length may change. |
container | Container {id, expires_at} or null | Code-execution container info: id (string), expires_at (string, expiry time). |
content | array of ContentBlock | Generated content (text, tool_use, thinking, server-tool blocks, …). Continues from a trailing assistant prefill if present. |
model | string (Model enum) | The model that handled the request. |
role | "assistant" | Always "assistant". |
stop_reason | StopReason enum or null | "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal". Non-null in non-streaming; null only in message_start for streaming. |
stop_sequence | string or null | Matched custom stop sequence, if any. |
stop_details | RefusalStopDetails {category, explanation, type} or null | On refusal. category: "cyber"/"bio"/"reasoning_extraction" or null (when the refusal doesn’t map to a named category). explanation: string (not guaranteed stable; null if unavailable). type: "refusal". |
type | "message" | Always "message". |
usage | Usage object | Billing / rate-limit token counts (below). |
stop_reason values (StopReason)
Section titled “stop_reason values (StopReason)”"end_turn"— model reached a natural stopping point."max_tokens"— exceeded requestedmax_tokensor the model’s maximum."stop_sequence"— one of your customstop_sequenceswas generated."tool_use"— the model invoked one or more tools."pause_turn"— a long-running turn was paused; pass the response back as-is in a subsequent request to continue."refusal"— streaming classifiers intervened for a potential policy violation.
Response content blocks (ContentBlock)
Section titled “Response content blocks (ContentBlock)”Each has a type. Includes:
TextBlock {citations, text, type:"text"}.citationsis an array; citation variants depend on cited document type:CitationCharLocation {cited_text, document_index, document_title, end_char_index, file_id, start_char_index, type:"char_location"}(plain text)CitationPageLocation {cited_text, document_index, document_title, end_page_number, file_id, start_page_number, type:"page_location"}(PDF)CitationContentBlockLocation {cited_text, document_index, document_title, end_block_index, file_id, start_block_index, type:"content_block_location"}(content document)CitationsWebSearchResultLocation {cited_text, encrypted_index, title, type:"web_search_result_location", url}CitationsSearchResultLocation {cited_text, end_block_index, search_result_index, source, start_block_index, title, type:"search_result_location"}
ToolUseBlock {id, name, input, type:"tool_use"}ThinkingBlock {thinking, signature, type:"thinking"}/RedactedThinkingBlock {data, type:"redacted_thinking"}- Server-tool / container result blocks (
server_tool_use,web_search_tool_result,web_fetch_tool_result,code_execution_tool_result,container_upload, …).
usage object (Usage)
Section titled “usage object (Usage)”Total input tokens = input_tokens + cache_creation_input_tokens + cache_read_input_tokens. output_tokens is non-zero even for empty output and is the authoritative billing total.
| Field | Type | Notes |
|---|---|---|
input_tokens | number | Non-cached input tokens used. |
output_tokens | number | Output tokens used. Inclusive, authoritative billing total. |
cache_creation_input_tokens | number | Tokens used to create the cache entry. |
cache_read_input_tokens | number | Tokens read from the cache. |
cache_creation | CacheCreation {ephemeral_1h_input_tokens, ephemeral_5m_input_tokens} | Cached-token breakdown by TTL. |
output_tokens_details | OutputTokensDetails {thinking_tokens} | thinking_tokens = output tokens spent on internal reasoning (including thinking-block delimiter tokens); read-only decomposition, ≤ output_tokens. Reflects raw reasoning, not the possibly-shorter summarized text. |
server_tool_use | ServerToolUsage {web_fetch_requests, web_search_requests} | Server-tool request counts. |
service_tier | enum "standard" / "priority" / "batch" | The tier actually used. |
inference_geo | string | Region where inference ran. |
Streaming (when stream: true)
Section titled “Streaming (when stream: true)”Server-sent events; RawMessageStreamEvent is one of:
message_start (carries the initial Message with null stop_reason), message_delta ({delta, type, usage} — cumulative usage, top-level stop_reason/stop_sequence deltas), message_stop, content_block_start, content_block_delta, content_block_stop, plus ping and error events.
Minimal request example
Section titled “Minimal request example”curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "anthropic-version: 2023-06-01" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [ {"role": "user", "content": "Hello, Claude"} ] }'Full request example — adaptive thinking + structured output + tools
Section titled “Full request example — adaptive thinking + structured output + tools”curl https://api.anthropic.com/v1/messages \ -H 'content-type: application/json' \ -H 'anthropic-version: 2023-06-01' \ -H "x-api-key: $ANTHROPIC_API_KEY" \ --max-time 600 \ -d '{ "model": "claude-opus-4-8", "max_tokens": 4096, "system": [{"type": "text", "text": "Today is 2026-06-01."}], "messages": [ {"role": "user", "content": "What is the weather in SF? Reply as JSON."} ], "thinking": { "type": "adaptive", "display": "summarized" }, "output_config": { "effort": "high", "format": { "type": "json_schema", "schema": { "type": "object", "properties": {"city": {"type": "string"}, "temp_c": {"type": "number"}}, "required": ["city", "temp_c"] } } }, "tools": [ { "name": "get_weather", "description": "Get current weather for a location.", "input_schema": { "type": "object", "properties": {"location": {"type": "string"}, "unit": {"type": "string"}}, "required": ["location"] } } ], "tool_choice": { "type": "auto", "disable_parallel_tool_use": false }, "service_tier": "auto", "metadata": { "user_id": "9f2b...opaque-hash" } }'For opus-4-8, opus-4-7, fable-5, and mythos-5, manual thinking:{type:"enabled", budget_tokens:N} returns HTTP 400 — use type:"adaptive" with output_config.effort as above. For sonnet-4-6 and opus-4-6, manual enabled still works but is deprecated. For haiku-4-5 and the 4-5/4-1/4-0 generations, manual enabled is fully supported. temperature/top_p/top_k are deprecated and rejected on models newer than Opus 4.6 (except the backwards-compatibility values temperature=1.0 and top_p>=0.99).
Response example (HTTP 200)
Section titled “Response example (HTTP 200)”{ "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF", "container": { "id": "id", "expires_at": "2019-12-27T18:11:19.117Z" }, "content": [ { "citations": [ { "cited_text": "cited_text", "document_index": 0, "document_title": "document_title", "end_char_index": 0, "file_id": "file_id", "start_char_index": 0, "type": "char_location" } ], "text": "Hi! My name is Claude.", "type": "text" } ], "model": "claude-opus-4-6", "role": "assistant", "stop_details": { "category": "cyber", "explanation": "explanation", "type": "refusal" }, "stop_reason": "end_turn", "stop_sequence": null, "type": "message", "usage": { "cache_creation": { "ephemeral_1h_input_tokens": 0, "ephemeral_5m_input_tokens": 0 }, "cache_creation_input_tokens": 2051, "cache_read_input_tokens": 2051, "inference_geo": "inference_geo", "input_tokens": 2095, "output_tokens": 503, "output_tokens_details": { "thinking_tokens": 0 }, "server_tool_use": { "web_fetch_requests": 2, "web_search_requests": 0 }, "service_tier": "standard" }}Token-counting twin response example
Section titled “Token-counting twin response example”{ "input_tokens": 2095 }