Claude Sonnet 5 arrived with the new model generation and settled into the familiar mid-tier slot. It is faster and cheaper than the flagship, yet strong enough for most production work.
What it costs
claude-sonnet-5 costs $0.3 per million input tokens and $0.3 per million output tokens. The flagship claude-opus-5 costs exactly the same.
At high volume those cents add up, but a gap this small is rarely a good reason to pick one model over the other. The real question is whether Sonnet can do your task without Opus.
Where Sonnet 5 holds its own against Opus
- Everyday agentic coding: edits across several files, tests, refactors that follow a clear plan.
- API integrations and client code generated from documentation.
- Answers over a large context: PR review, ticket summaries, questions about a codebase.
- Routine agent steps where the task is stated clearly.
Sonnet 5 keeps long context in view and doesn't lose track of instructions. For most pipelines that is enough.
When to reach for Opus
The flagship pays off when a task can't be split into clear steps in advance: an unfamiliar architecture you have to understand as a whole, a race condition with no working hypothesis, planning under a pile of conflicting constraints. Opus reasons deeper there, and since the price is identical, there is nothing to trade off.
If you're unsure, start with Sonnet. It either solves the task or fails visibly, and switching to Opus afterwards costs one extra call.
Example call
Anthropic Messages API:
from anthropic import Anthropic
client = Anthropic(
api_key="sk_cdx_your_key_here",
base_url="https://api.codexkey.online",
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Split this PR into logical commits."}],
)
print(message.content[0].text)
The same key also works with OpenAI Chat Completions:
from openai import OpenAI
client = OpenAI(api_key="sk_cdx_your_key_here", base_url="https://api.codexkey.online/v1")
resp = client.chat.completions.create(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "Split this PR into logical commits."}],
)
print(resp.choices[0].message.content)
Both formats run on one endpoint with one key, so you don't have to rebuild your infrastructure around a particular SDK.
Sonnet 5 versus Sonnet 4.6
Sonnet 4.6 has left the codexkey catalog, so anyone still using it has to move: set model to claude-sonnet-5, same price. If your prompts were tuned for 4.6, run your typical requests on Sonnet 5 and compare the results on your own metric. The full walkthrough is in moving off Sonnet 4.6.
Testing it on your own workload
Use the calculator on the site to compare models at your input and output volumes. Usage is tracked separately for each named key. The dashboard key API does not expose per-key budgets, so cap automated workloads in your client.
In short
Sonnet 5 covers most production traffic at $0.3 per million tokens. Opus is for tasks where it isn't obvious where to begin. The price is the same, so choose by the task, not by the bill.