Claude Sonnet 5

by Anthropic

Anthropic balanced model with near-flagship coding and agentic quality at Sonnet pricing, a 1M context window, and up to 128K output tokens.

Parameters
Sonnet
Context Length
1M
Category
chat
Available Serverless

Run queries immediately, pay only for usage

$3.15in|$15.75out

Per 1M Tokens

Try this modelView documentation

About this model

Claude Sonnet 5 brings near-flagship coding and agentic quality to the Sonnet tier, with a 1M-token context window and up to 128K output tokens. It is the default choice for production workloads that need Claude quality without Opus cost. Note that Sonnet 5 uses a new tokenizer that produces roughly 30 percent more tokens for the same text than Sonnet 4.6, so budget accordingly when migrating: the per-token price is the same, but the same document costs more to process. Available on the DOS.AI gateway with one API key and unified billing.

Capabilities

Advanced reasoningCode generationVisionTool callingLong context (1M)

Use Cases

  • Production agents
  • Code development
  • Customer support
  • Long-document analysis

Model Details

Provider
Anthropic
Model ID
claude-sonnet-5
Parameters
Sonnet
Context Length
1M tokens
Category
chat

API Usage

Use the DOS API to integrate Claude Sonnet 5into your applications. Our API is compatible with OpenAI's client libraries for easy migration.

Model ID

claude-sonnet-5

Python

python
from dos import DOS

client = DOS()

response = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[
        {"role": "user", "content": "Hello, how are you?"}
    ]
)

print(response.choices[0].message.content)

cURL

bash
curl https://api.dos.ai/v1/chat/completions \
  -H "Authorization: Bearer $DOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
      {"role": "user", "content": "Hello, how are you?"}
    ]
  }'

Node.js

javascript
import DOS from 'dos-ai';

const client = new DOS();

const response = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [
    { role: "user", content: "Hello, how are you?" }
  ]
});

console.log(response.choices[0].message.content);