Introduction
Claude Sonnet 4.6 is Anthropic's workhorse chat model, served here on one OpenAI-compatible endpoint at /v1/chat/completions. It reads up to 1,000,000 tokens per call and replies in up to 64,000, enough to carry several hundred roleplay turns forward verbatim instead of summarising them first.
Reasoning effort takes low, medium, high or max (medium by default), and temperature (0 to 1) and top_p stay adjustable. Message content is text and images; up to 128 tools and SSE streaming are available on the same request.
Key features & highlights
Several hundred turns, carried verbatim
1,000,000 tokens holds several hundred original turns. Skip the summary step and a character still remembers at turn three hundred what they agreed to at turn ten; start compressing and the first details to fall out are exactly the ones that kept them consistent.
Sixteen tokens read for every one written
The window is sixteen times the 64,000-token reply ceiling, and that shape suits conversation: a lot of history read on every turn, a scene or a chapter written back. When one deliverable would run past 64,000 tokens, split it by chapter.
Effort and sampling on the same body
low, medium, high and max sit next to temperature and top_p in one request body. Run everyday turns on low with a warm temperature, and send the turn that has to tie threads together at high or max.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Ordered conversation turns. Content is a string, or an array of text and |
max_tokens | No | Caps the reply at 64,000 - a sixteenth of the read window. Default 4,096. |
reasoning_effort | No | low, medium, high or max, medium by default. Raise it when the answer has to reconcile details before the model writes. |
stop | No | Up to 4 sequences, as a string or an array. The reply ends as soon as the model writes one of them, and the matched text itself is left out. at least 1 characters · at least 1 items · at most 4 items |
temperature | No | 0 to 1, default 1. Hold it at 0 whenever the reply is parsed by code. |
top_k | No | 1 to 500. Samples only from the k most likely next tokens: 1 makes replies close to repeatable, larger values loosen the choice. |
top_p | No | 0.01 to 1. Adjust this or temperature, never both in the same comparison. |
tools | No | Up to 128 function definitions per request. at most 128 items |
parallel_tool_calls | No | true or false, default true: the model may request several tool calls in one turn. Default: |
tool_choice | No | auto, none, required, or an object naming one function. |
Pricing
Input $3 / Output $15 per 1 million tokens
Use cases
Roleplay that survives several hundred turns
Send the full history back untouched, turn by turn. The character's promises, grudges and running jokes stay in the request, so consistency comes from the material itself rather than from a reminder in the prompt.
Interactive fiction with tools
Dice rolls, inventory checks and lore lookups fit as functions - up to 128 definitions governed by tool_choice. Results return as tool messages inside the same conversation, so a resolution never has to leave the scene.
Continuing a serial
Put the story so far into the request and ask for the next chapter. The 64,000-token ceiling covers a complete scene, and a serial never has to restate its premise because the premise is still in the window.
Prompt guide & pro tips
Pin the cast in the system message
Each character's manner of speech, relationships and hard limits belong in the system message, and the user turns carry only the plot. Branching the story then changes only the second half of the request.
Leave room for reasoning in max_tokens
The default is 4,096 tokens. Reasoning tokens are billed as output too, so at high or max give max_tokens headroom above the visible answer you expect, up to 64,000.
What the endpoint rejects
max_tokens above 64,000, video and audio parts and a conversation that ends on an assistant message to prefill the reply all fail. There is no response_format: for machine-readable output, force a tool whose parameters are your JSON schema. Tool results occupy the window like any other message, so a very long session eventually needs you to decide what to drop.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "anthropic/claude-sonnet-4.6/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.














