Claude Sonnet 5 vs Claude Sonnet 5.5: API price and setup
This page compares the exact API IDs `claude-sonnet-5` and `claude-sonnet-5-5`. Both are Claude Code models, so the client setup is shared; only the model value and token rates change. Prices come from the live catalog.
Short answer
Input and output rates match at $0.50/$2.50; Claude Sonnet 5.5 has the lower cache-read rate ($0.025 vs $0.05 per 1M tokens). For cached input, that is the only price difference shown.
Token and monthly figures are arithmetic from the current catalog, not a forecast or a measured benchmark. The monthly example excludes cache writes, tools and actual usage differences.
Token prices on the same basis
All values are USD per 1M tokens. Code By AI prices already include the published multiplier. Vendor list prices are shown only when verified. The 5-minute and 1-hour cache writes apply only to Claude and use each platform’s own input rate.
| Model | Metric | Code By AI | Official list | OpenRouter |
|---|---|---|---|---|
| Claude Sonnet 5claude-sonnet-5 | Input | $0.50 | $2.00 | $2.00 |
| Cache read | $0.05 | $0.20 | $0.20 | |
| Cache write (5 min) | $0.625 | $2.50 | $2.50 | |
| Cache write (1 hour) | $1.00 | $4.00 | $4.00 | |
| Output | $2.50 | $10.00 | $10.00 | |
| Claude Sonnet 5.5claude-sonnet-5-5 | Input | $0.50 | $2.00 | $2.00 |
| Cache read | $0.025 | $0.10 | $0.10 | |
| Cache write (5 min) | $0.625 | $2.50 | $2.50 | |
| Cache write (1 hour) | $1.00 | $4.00 | $4.00 | |
| Output | $2.50 | $10.00 | $10.00 |
OpenRouter standard endpoint (verified): anthropic/claude-sonnet-5 · anthropic · anthropic/claude-sonnet-5-20260630 ·
OpenRouter standard endpoint (verified): anthropic/claude-sonnet-5.5 · anthropic · anthropic/claude-sonnet-5.5-20260928 ·
OpenRouter cells show a number only when the exact provider model ID and rate basis were checked against this catalog row. Cells marked Not verified have no such evidence. Credit-purchase fees and other OpenRouter plans are separate and are never added to the per-token prices here. OpenRouter pricing and FAQ · FAQ
OpenRouter: Anthropic provider, Standard variant, 1M-token context, regular synchronous API. Verified base input, output and cache-read rates matched the catalog vendor fields and are recorded here. Fast, Batch, regional endpoints and credit fees are excluded. /pricing
Monthly arithmetic example
At 20M input and 2M output tokens per month, priced at catalog rates:
| Model | Official list / month | Code By AI / month |
|---|---|---|
| Claude Sonnet 5claude-sonnet-5 | $60.00 | $15.00 |
| Claude Sonnet 5.5claude-sonnet-5-5 | $60.00 | $15.00 |
Which choice fits which work?
Rows restate catalog arithmetic and official guidance. They are not Code By AI benchmarks or measured speed and quality results.
| Kind of work | Starting point | Basis |
|---|---|---|
| Work already configured for Claude Code | Either model; change only `model` | The base URL, auth and protocol are shared. |
| Input-heavy requests: long prompts, large context, repeated instructions | Either | Both list $0.50 per 1M tokens for this metric. |
| Output-heavy requests: long code or document generation | Either | Both list $2.50 per 1M tokens for this metric. |
| Cache-read-heavy requests: repeated prefixes and reused context | Claude Sonnet 5.5 | Cache read rate: Claude Sonnet 5 $0.05 vs Claude Sonnet 5.5 $0.025 per 1M tokens. |
How the integration differs
These are wire-level settings readers must configure, not capability claims.
| Model IDs | claude-sonnet-5 / claude-sonnet-5-5 |
|---|---|
| Claude Code setup | ANTHROPIC_BASE_URL=https://www.codebyai.net/api/agent · ANTHROPIC_AUTH_TOKEN=<key> · model: claude-sonnet-5 |
| Protocol | Claude Code: Anthropic Messages |
| Key and balance | Both use the same base URL, auth variable and prepaid balance. |
| What changes | Only the `model` value; the client configuration is unchanged. |
| Billing | Both debit the same prepaid wallet at the per-1M-token rates above. Code By AI does not charge the official list price. |
FAQ
- Which model is cheaper on Code By AI?
- Input and output rates match at $0.50/$2.50; Claude Sonnet 5.5 has the lower cache-read rate ($0.025 vs $0.05 per 1M tokens). For cached input, that is the only price difference shown.
- Are these the exact API model IDs?
- Yes. Use `claude-sonnet-5` and `claude-sonnet-5-5` exactly. The page does not derive IDs by splitting the slug.
- Do both models use the same key and endpoint?
- Yes. Both are Claude Code models on the same endpoint; only the model value changes.
- How are the OpenRouter prices obtained?
- The OpenRouter cells show recorded base rates that matched the catalog vendor fields when checked. The dates are listed with the sources below the table. OpenRouter cells show a number only when the exact provider model ID and rate basis were checked against this catalog row. Cells marked Not verified have no such evidence. Credit-purchase fees and other OpenRouter plans are separate and are never added to the per-token prices here.
- Does this page measure quality or speed?
- No. The scenarios describe client protocols and token mix, not measured quality, speed or SLA results.
Next step
Create a Code By AI account, top up the prepaid wallet and create an API key. Then call the model with the ID and endpoint above.
Code By AI is a third-party prepaid API gateway. It is not an official vendor product.