Introduction
Claude Sonnet 5 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 writes up to 64,000 in one reply, so a long session can travel in full on every turn.
Reasoning effort takes low, medium or high, with medium as the default. Sampling is fixed by the model, so temperature and top_p are not accepted; message content is text and images, and up to 128 tools and SSE streaming are available on the same call.
Key features & highlights
A million-token session memory
Hundreds of original turns fit under the 1,000,000-token ceiling. Send them back in order and the model reads what each character actually said, which is where most of what people call consistency comes from.
Reasoning you raise only when it pays
low, medium and high share one request body. Ordinary back-and-forth runs well on low and comes back sooner; raise it when threads have to converge or several characters share the room. A higher setting thinks longer and usually produces more output tokens.
A request body without sampling knobs
Because temperature and top_p are fixed by the model, a request copied from an older integration should drop them: sending either one fails validation instead of being silently ignored, so a stray setting never changes behaviour behind your back.
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 or high, default medium. Run ordinary exchanges at low and raise it for the scene that has to land. |
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 |
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 $1.90 / Output $9.50 per 1 million tokens
Use cases
Long companion conversations
Keep the running conversation in the messages array session after session. At a million tokens even a long relationship arc fits without a summarisation layer, and the character refers back to real lines instead of paraphrased ones.
Three or four voices in one scene
Write each character's diction and hard limits into the system message and let the user turns carry only the action. With every earlier turn still in the window, who said what stays on record and the voices do not bleed into each other.
Dice, inventory and lore as tools
Define functions for dice rolls, inventory checks or lore lookups and let tool_choice decide when they run. Their results arrive as tool messages in the same thread, so the story resolves an action without stepping outside the conversation.
Prompt guide & pro tips
low for ordinary turns, high for the scene that matters
Back-and-forth exchanges are usually fine at low, and what you save is time as much as tokens. Raise the setting when threads have to converge; it is one string on the same request.
Set max_tokens to the length you want
The default of 4,096 covers a solid scene. Thinking comes out of the same budget, so a small cap can be spent on reasoning before the answer starts; leave real room when effort is high, up to the 64,000 ceiling.
Limits to plan around
Video and audio parts are rejected, a conversation cannot end on an assistant message to prefill the reply, and there is no response_format - for machine-readable output, force a tool whose parameters are your JSON schema. Tool results share the window with the conversation, so a very long session eventually needs trimming.
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-5/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.














