claude-sonnet-5
Claude Sonnet 5 pairs a million-token context window with the fastest comparative latency in its generation, which is what makes it the working default rather than an economy option. It matches the Opus tier on window size and output ceiling while answering noticeably quicker, and adaptive thinking is on by default with five effort levels controlling how deep it goes. One integration detail separates it from most models in this catalogue: sampling parameters are rejected outright. Send a temperature, a top-p, or a top-k at anything other than its default and the request returns an error rather than quietly ignoring it — so output variation is shaped through effort and prompting instead.

Claude Sonnet 5
The fast tier of Anthropic's current generation, with the same million-token window as the Opus model above it. Released June 2026.
Sampling Parameters Are Rejected
Start here, because it breaks working code rather than degrading it.
Setting temperature, top_p, or top_k to anything other than its default returns a 400. Not
ignored, not clamped — refused.
Most OpenAI-compatible clients attach a temperature by default. A request that runs perfectly against every other model in this catalogue fails here for a parameter you never consciously set.
# Fails on this model
client.chat.completions.create(model=..., messages=..., temperature=0.7)
# Works
client.chat.completions.create(model=..., messages=...)Strip them explicitly from any shared request builder before routing traffic here.
So how do you control variation? Through the effort level and through the prompt. Lower effort for deterministic, repeatable work such as classification and extraction; higher effort where exploration helps. For tone, format, and register, instruct the model directly — that lever still works and is more precise than a sampling knob ever was.
The Window Is Not the Compromise
Worth stating plainly, because "fast tier" usually implies a smaller context.
This model carries the same 1M-token context window and the same 128K output ceiling as the Opus model in its generation. One million tokens is the default and the maximum — no smaller variant, no beta header, no surcharge for using the whole thing.
What you trade for the speed is depth on the hardest problems, not room to work.
Which changes where it fits. A long-document pipeline, a repository-scale analysis, or an agent accumulating a large history does not need to escalate tiers for capacity reasons. It escalates only when the reasoning itself falls short — and that is a question your evaluations answer, not an assumption to build around.
Effort, and Thinking by Default
Adaptive thinking runs unless you disable it, with high as the default effort on the API.
The five levels — low, medium, high, xhigh, max — set depth. On a fast-tier model the lower
end matters more than it does above: a model chosen for latency, run at maximum effort, has given
away the reason it was chosen.
Start at the default, then measure downward. For classification, routing, extraction, and
formatting, low frequently holds quality while returning substantially quicker.
Thinking tokens count against max_tokens, which bounds reasoning and answer together. A ceiling
sized for the answer alone truncates the model mid-reasoning and yields nothing usable.
Specifications
| Model ID | anthropic/claude-sonnet-5 |
| Context window | 1,000,000 tokens — default and maximum |
| Max output | 128,000 tokens |
| Thinking | Adaptive, on by default |
| Default effort | high |
| Comparative latency | Fast |
| Input → output | Text and images → text |
| Reliable knowledge cutoff | January 2026 |
| Released | 30 June 2026 |
| Sampling parameters | Rejected — non-default values return 400 |
Anthropic publishes no parameter counts, architecture, or weights for Claude models.
Capabilities
| Capability | Value |
|---|---|
input_types | text, image |
output_types | text |
audio_input | Not supported |
video_input | Not supported |
context_window | 1000000 |
max_output_tokens | 128000 |
reasoning | Adaptive — on by default |
effort_levels | low, medium, high, xhigh, max |
temperature | Not accepted |
top_p | Not accepted |
top_k | Not accepted |
streaming | Supported |
tool_calling | Supported |
structured_output | Supported |
requires_prompt | Yes — text prompt required, image optional |
Reading Responses
Because thinking is on by default, a response can begin with reasoning content rather than the answer. Code that grabs the first content block by position will find something it did not expect.
Read the fields explicitly:
message = reply.choices[0].message
trace = getattr(message, "reasoning_content", None)
if trace:
logger.debug("reasoning: %d characters", len(trace))
print(message.content)Keep the two apart. Merging reasoning into content breaks JSON parsing on structured paths and puts
a working draft in front of users who asked for a finished answer.
Using Claude Sonnet 5 on DEVUP AI
Base URL: https://api.devupai.com/v1 · Model ID: anthropic/claude-sonnet-5
First request — cURL
Note what is absent: no temperature, no top-p.
curl https://api.devupai.com/v1/chat/completions \
-H "Authorization: Bearer $DEVUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{
"role": "user",
"content": "A delivery webhook sometimes fires twice within the same second. Our handler marks the order shipped both times and sends two SMS notifications. Walk through the fixes in order of how little they change."
}
],
"max_tokens": 16384
}'A request builder that will not break here — Python
If one function serves several models, this is where the sampling restriction bites.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEVUP_API_KEY"],
base_url="https://api.devupai.com/v1",
)
# Models that reject non-default sampling values.
NO_SAMPLING = {"anthropic/claude-sonnet-5"}
def ask(model: str, prompt: str, *, temperature: float | None = None, max_tokens: int = 16384) -> str:
"""Send a request, omitting sampling parameters where the model refuses them."""
payload = {
"model": model,
"messages": [{"role": "user", "content": prompt}],
"max_tokens": max_tokens,
}
if temperature is not None and model not in NO_SAMPLING:
payload["temperature"] = temperature
reply = client.chat.completions.create(**payload)
return reply.choices[0].message.contentThe alternative is discovering the restriction from a 400 in production, on a parameter nobody remembers adding.
Low effort for volume — Python
Where a fast model earns its position.
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[
{
"role": "system",
"content": "Classify this ticket. Answer with one word: billing, delivery, technical, or other.",
},
{"role": "user", "content": ticket},
],
max_tokens=16,
extra_body={"output_config": {"effort": "low"}},
)Three settings working together: the fast tier, the lowest effort, and a ceiling matched to a one-word answer. Any one of them alone leaves most of the saving unclaimed.
Whole-document analysis — Python
The million-token window, used for what it is there for.
from pathlib import Path
contracts = "\n\n---\n\n".join(
f"### {path.name}\n{path.read_text(encoding='utf-8')}"
for path in sorted(Path("agreements").glob("*.txt"))
)
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[
{
"role": "system",
"content": (
"You are reviewing a set of supplier agreements. Find every obligation that appears "
"in one document and contradicts an obligation in another. Quote both clauses and "
"name both files. Report only conflicts you can quote."
),
},
{"role": "user", "content": contracts},
],
max_tokens=32768,
)
print(reply.choices[0].message.content)Passing the set whole is the point. A conflict between document three and document eleven is invisible to any pipeline that processes them one at a time, and finding exactly that kind of relationship is why the window exists.
A tool loop — Python
import json
TOOLS = [
{
"type": "function",
"function": {
"name": "lookup_order",
"description": "Return order status, line items, and notification history for an order ID.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
},
]
def lookup_order(order_id: str) -> dict:
"""Replace with your real data access layer."""
raise NotImplementedError
HANDLERS = {"lookup_order": lookup_order}
thread = [{"role": "user", "content": "Order 48213 shows as shipped twice. Find out what happened."}]
LIMIT = 15
for step in range(LIMIT):
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=thread,
tools=TOOLS,
max_tokens=16384,
)
message = reply.choices[0].message
thread.append(message)
if not message.tool_calls:
print(message.content)
break
for call in message.tool_calls:
handler = HANDLERS.get(call.function.name)
if handler is None:
outcome = {"error": "unknown tool", "name": call.function.name}
else:
try:
outcome = handler(**json.loads(call.function.arguments or "{}"))
except Exception as exc:
# Send the failure back as data — the model adapts to it.
outcome = {"error": type(exc).__name__, "detail": str(exc)}
thread.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(outcome)})
else:
print(f"Stopped at {LIMIT} steps without a conclusion.")Append the message object as returned rather than rebuilding it from content — reasoning travels
with the object, and reconstructing it discards what the next turn depends on.
LIMIT is the only thing that ends a loop that will not end on its own.
Reading an image — Python
import base64
with open("shipping_label.jpg", "rb") as handle:
encoded = base64.b64encode(handle.read()).decode("utf-8")
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{encoded}"}},
{
"type": "text",
"text": (
"Read the tracking number and destination address exactly as printed. "
"If any character is ambiguous, say which one rather than choosing."
),
},
],
}
],
max_tokens=2048,
)Asking it to flag ambiguous characters rather than resolve them is worth the extra sentence. A tracking number with one guessed digit looks identical to one read correctly, and fails silently downstream.
Node.js — DEVUP AI SDK
npm install devupaiimport DevupAI from "devupai";
const client = new DevupAI({
apiKey: process.env.DEVUP_API_KEY,
});
// No temperature, no top_p — this model refuses them.
const reply = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [
{
role: "system",
content:
"Summarise this support thread for a handover. State what was tried, what is still " +
"unresolved, and what the customer is waiting on.",
},
{ role: "user", content: thread },
],
max_tokens: 8192,
});
console.log(reply.choices[0]?.message?.content);Streaming
stream = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Explain why a shared Redis cart store makes sticky sessions unnecessary — or why it does not."}],
max_tokens=16384,
stream=True,
)
for chunk in stream:
if not chunk.choices:
if getattr(chunk, "usage", None):
print(f"\n\nin {chunk.usage.prompt_tokens} · out {chunk.usage.completion_tokens}")
continue
piece = chunk.choices[0].delta
if getattr(piece, "content", None):
print(piece.content, end="", flush=True)Reasoning precedes visible output even on a fast model. The gap is short at low and medium, real
at xhigh and max — worth accounting for in client timeouts if you run the upper end.
Choosing This Tier
Reach for it when latency shapes the experience: interactive assistants, support tooling, anything a person waits on. Also for volume work at low effort, and for long-document processing where the window matters more than the depth.
Escalate when a specific input has already failed here, or when your evaluations show the reasoning falling short rather than the speed. Failure on a real case is better evidence than a benchmark table.
Do not escalate for capacity. The window and the output ceiling are identical above; moving up buys reasoning depth and costs latency.
Limitations
Sampling parameters return errors. temperature, top_p, and top_k must be left at their
defaults.
Reasoning shares the output ceiling. Size max_tokens for thinking plus answer.
Responses may open with reasoning content. Select by field or type, never by position.
Knowledge stops in January 2026. Anything later needs retrieval or a search tool.
Text and images only. No audio, no video, no image generation.
Not the deepest reasoner in its generation. For the hardest analysis the Opus tier is stronger, at the cost of speed.
Internals are undisclosed — no parameter count, no architecture, no weights.
Output still requires review. Speed and a large window do not make a claim true; verify anything that will act on a system of record.