claude-sonnet-5 API
Claude Sonnet 5 is a previous-generation Sonnet model with adaptive thinking and an official migration path to Sonnet 5.5.
Request preview
{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "A quiet mountain lake at sunrise, soft morning light."
}
],
"stream": true
}Your next idea starts here.
Run the model to preview your result.Build with this model
The example follows your Playground parameters.
curl --no-buffer --request POST 'https://newrouters.com/v1/messages' \
--header 'Content-Type: application/json' \
--header "x-api-key: $MODEL_API_KEY" \
--header 'anthropic-version: 2023-06-01' \
--data '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "A quiet mountain lake at sunrise, soft morning light."
}
],
"stream": true
}'Set MODEL_API_KEY in your environment. Keep your secret key on the server. Full documentation ↗
claude-sonnet-5 capabilities
- Context window
- 128,000 tokens
- Max output
- 64,000 tokens
- Reasoning effort
- max · xhigh · high · medium · low · none (default high)
- Supports
- Tool calling
- Streaming
- Reasoning
- Structured output
- Endpoints
/v1/messages/v1/messages/count_tokens
API Usage Examples
API documentation ↗curl 'https://newrouters.com/v1/messages' \
-H "Content-Type: application/json" \
-H "x-api-key: $MODEL_API_KEY" \
-H "anthropic-version: 2023-06-01" \
--data '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Explain how an HTTP request works in three concise steps."
}
],
"stream": false
}'const apiKey = process.env.MODEL_API_KEY;
const response = await fetch("https://newrouters.com/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
"anthropic-version": "2023-06-01"
},
body: JSON.stringify({
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Explain how an HTTP request works in three concise steps."
}
],
"stream": false
})
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());import os
import json
import requests
response = requests.post(
"https://newrouters.com/v1/messages",
headers={
"Content-Type": "application/json",
"x-api-key": os.environ["MODEL_API_KEY"],
"anthropic-version": "2023-06-01"
},
json=json.loads("{\"model\":\"claude-sonnet-5\",\"max_tokens\":1024,\"messages\":[{\"role\":\"user\",\"content\":\"Explain how an HTTP request works in three concise steps.\"}],\"stream\":false}"),
timeout=300,
)
response.raise_for_status()
print(response.text)Set MODEL_API_KEY in your server environment. Requests use this model’s native API and your account pricing.
All parameters and combination rules
Protocol & capabilities
claude · claude-sonnet-5
- Context limit
- 128000
- Maximum output
- 64000
tools · stream · reasoning · structured_output
Pricing
claude-sonnet-5 pricing
Estimate one request, then choose a budget for your workflow.
| Usage | Quantity | Rate | Cost |
|---|---|---|---|
| tokens | $0.6/ 1M | $0.0006 | |
| tokens | $0.06/ 1M | $0 | |
| tokens | $0.75/ 1M | $0 | |
| tokens | $1.2/ 1M | $0 | |
| tokens | $3/ 1M | $0.0015 | |
| tokens | $3/ 1M | $0 |
Public USD estimate. Your account rate and final recorded usage determine the actual charge.
All specifications and prices
| Specification | Our price | Official reference |
|---|---|---|
| Input | $0.6 / 1M tokens | $2 About 70% less than official |
| Cached input | $0.06 / 1M tokens | $0.2 About 70% less than official |
| Cache write · 5m | $0.75 / 1M tokens | $2.5 About 70% less than official |
| Cache write · 1h | $1.2 / 1M tokens | $4 About 70% less than official |
| Output | $3 / 1M tokens | $10 About 70% less than official |
| Reasoning | $3 / 1M tokens | $10 About 70% less than official |
Compare claude-sonnet-5 with related models
| Specification | claude-sonnet-5 | Claude Fable 5 | Claude Fable 5.1 |
|---|---|---|---|
| Provider | Anthropic | Anthropic | Anthropic |
| Input → output | TextText | TextText | TextText |
| Selection basis | Current model | Same claude protocol · Same billing units | Same claude protocol · Same billing units |
| Context / max output | 128,000 / 64,000 | 1,000,000 / 128,000 | 1,000,000 / 128,000 |
| Starting price | $0.6 / 1M tokens | $3 / 1M tokens | $3 / 1M tokens |
Choose by the input types, output settings and billing unit your workflow needs. Try the same prompt across models to compare results for your own use case.
What Is claude-sonnet-5?
Claude Sonnet 5 is a previous-generation Sonnet model with adaptive thinking and an official migration path to Sonnet 5.5.
Official model information ↗ · 2026-10-14
claude-sonnet-5 Platform specifications
| Specification | claude-sonnet-5 |
|---|---|
| Model ID | claude-sonnet-5 |
| Provider | Anthropic |
| API | /v1/messages |
| Context window | 128,000 tokens |
| Maximum output | 64,000 tokens |
| Declared capabilities | Tools · Streaming · Reasoning · Structured output |
claude-sonnet-5 API · Common Questions
Everything you need to know about API access, pricing and model capabilities.
How is claude-sonnet-5 billed?
Charges depend on the recorded token usage and your account rates. Input, output and supported cache or reasoning categories are listed separately in the pricing table. The calculator uses public USD prices; the final usage receipt determines the charge.
How do I get an API key?
Choose “Get API access” to open the integration guide. Sign in to your NewRouters account, prepare a key with access to this model and copy an API example.
Which API endpoints can I use?
Supported endpoints: /v1/messages、/v1/messages/count_tokens. Choose an endpoint in the API examples to see its native request format.
Does the model support streaming?
The current model route declares streaming support. Use the native endpoint’s streaming option and consume its events. Usage already completed may still be billed if the connection is interrupted.
Can I use tools or structured output?
Tools: supported. Structured output: supported. Request fields follow the selected native endpoint.
Where can I check usage and charges?
Keep the request ID and open your account’s LLM usage records to inspect request status, token counts and charges. Prompt and answer content are not a conversation history in this view.