---
title: Claude Sonnet API Access
description: "Claude Sonnet API access via apiToken.sale: Sonnet 5 and 4.6 model IDs, Messages API examples and prompt caching at a flat 50% off official rates."
url: https://apitoken.sale/docs/learn/claude-sonnet-api
language: en
---

# Claude Sonnet API access: Sonnet 5 and Sonnet 4.6

The Claude Sonnet API is the default tier for daily coding and agent work — fast enough for interactive edits, strong enough for real tool-use loops. This guide covers the live model IDs, a working Messages API call, streaming, prompt caching and what Sonnet costs on apiToken.sale at a flat 50% off official pricing.

## Claude Sonnet API: models, IDs and limits

The Claude Sonnet API is Anthropic's balanced model tier, served over the standard Messages API: you POST a model ID and a list of messages to /v1/messages and get back text, tool calls and token usage. On apiToken.sale you reach it at the same protocol shape — point any Anthropic-compatible client at the router base URL, authenticate with x-api-key, and nothing else in your code changes. Two Sonnet generations are live on one prepaid balance: claude-sonnet-5 and claude-sonnet-4-6.

| Model ID | Context | Max output | Official in / out ($ per 1M) | Here (−50%) |
| --- | --- | --- | --- | --- |
| claude-sonnet-5 | 1M tokens | 128K tokens | $2 / $10 | $1 / $5 |
| claude-sonnet-4-6 | 1M tokens | 128K tokens | $3 / $15 | $1.50 / $7.50 |

## Make your first Sonnet call

If you have ever called Anthropic's Messages API, this is the same request with a different base URL and key. One apiToken.sale key covers every supported Claude, GPT, Gemini and Kimi model, so the call below is also the template for everything else on the platform.

1. Create an account and generate a key from the dashboard — it looks like sk-pool-… and works the moment it is issued.
2. Send POST /v1/messages to https://router.apitoken.sale with the x-api-key and anthropic-version headers, exactly as you would against Anthropic.
3. Set the model field to claude-sonnet-5 (or claude-sonnet-4-6) and read the usage object in the response — spend is drawn from your prepaid balance at the official rate minus 50%.

```
curl https://router.apitoken.sale/v1/messages \
  -H "x-api-key: sk-pool-•••" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Refactor this function for readability."}
    ]
  }'
```

## Sonnet 5 or Sonnet 4.6: which ID to send

They do not share a list price: Sonnet 5 is $2/$10, Sonnet 4.6 is $3/$15. Sonnet 5 is the stronger coding and agentic model and the right default for anything new. It also runs adaptive thinking by default when you omit the thinking parameter, so reasoning depth scales with the task instead of a fixed budget. Sonnet 4.6 supports the same adaptive thinking with effort defaulting to high, and remains the right pick when your prompts, evals and regression baselines are pinned to it.

- New project or no strong preference: claude-sonnet-5.
- Prompts and eval suites tuned against 4.6 behavior: stay on claude-sonnet-4-6 until you re-baseline.
- Same context window and output ceiling — migrating later is a one-line model-ID change. Sonnet 5 is also cheaper.

[Claude Sonnet 4.6 on the model catalog](/models/claude-sonnet-4-6)

## Token pricing

Sonnet 5's official rate is $2 per 1M input tokens and $10 per 1M output tokens; here that is $1 / $5 after the flat 50% discount. Sonnet 4.6 stays at $3 / $15 ($1.50 / $7.50 after the discount). Anthropic cancelled the 2026-09-01 flip of Sonnet 5 to $3 / $15, so $2 / $10 is the current standard rate. Output tokens cost five times input tokens, which is why response length discipline matters more than prompt trimming on chatty workloads.

> Anthropic cancelled the planned Sonnet 5 increase to $3 / $15, so the $2 / $10 official rate does not expire. Sonnet 4.6 remains $3 / $15.

[Claude Sonnet 5 pricing in detail (cache rates, context, FAQ)](/models/claude-sonnet-5)

## Cut repeat-context cost with prompt caching

Agent loops re-send the same prefix on every turn: system prompt, tool definitions, repo context. The Messages API lets you mark that prefix with a cache_control breakpoint; Anthropic then holds it in a short-lived cache (five-minute TTL, refreshed on each hit) and bills subsequent reads of it at a fraction of the input price. On Sonnet workloads this is the single biggest cost lever, and it stacks with the 50% discount.

| Cache operation ($ per 1M) | Official | Here (−50%) |
| --- | --- | --- |
| 5-minute cache write | $2.50 | $1.25 |
| Cache read | $0.20 | $0.10 |

Put the breakpoint after the last stable block — system prompt plus tools plus retrieved context — and keep volatile per-turn content after it. A breakpoint on text that changes every call never hits and only costs you the write premium.

[Estimate a cached workload on the cost calculator](/tools/claude-api-cost-calculator)

## Streaming responses and long outputs

Set stream: true and the API returns server-sent events instead of one blocking response: message_start, a sequence of content_block_delta events carrying the text as it is generated, then message_delta and message_stop. Render the deltas incrementally in your UI and take the final token usage from the terminal events — that is the record your balance is billed on. Streaming changes latency perception, not price: the same tokens are metered either way.

The 128K output ceiling means a full file rewrite or a long structured extraction fits in one response. Use the headroom deliberately — a habit of unconstrained max_tokens plus verbose outputs is how a cheap Sonnet workload quietly becomes an expensive one.

> If a stream drops mid-generation, do not retry in a tight loop: issue one fresh request and reconcile spend from the terminal usage you did receive.

## One balance across Sonnet, Opus and Haiku

Sonnet shares its key and prepaid balance with the rest of the catalog, which makes model routing trivial: send bulk classification and extraction to Haiku, keep Sonnet as the default for coding and agents, and escalate only genuinely hard reasoning to Opus. Switching tiers is a model-ID change on the same request shape — no new credentials, no separate billing relationship, no waitlist between you and any tier.

## Frequently asked questions

### What is the model ID for Claude Sonnet 5 in the API?

claude-sonnet-5. Pass it as the model field of a Messages API request; the previous generation is claude-sonnet-4-6. Both work on the same apiToken.sale key.

### How much does the Claude Sonnet API cost per token?

Sonnet 5 is officially $2 per 1M input and $10 per 1M output tokens. apiToken.sale applies a flat 50% discount, so spend lands at $1 / $5. Sonnet 4.6 stays at $3 / $15 ($1.50 / $7.50 after the discount).

### Is Sonnet good enough for coding agents, or do I need Opus?

Sonnet 5 is the recommended default for everyday coding and agent workflows — near-Opus quality at a much lower token price. Reserve Opus for the hardest reasoning and long, high-stakes sessions.

### Can I use the Claude Sonnet API from Cursor, Claude Code or the Anthropic SDK?

Yes. Any Anthropic-compatible client works: set the base URL to the apiToken.sale router, authenticate with x-api-key, and keep the rest of your configuration unchanged.

### Does Sonnet support prompt caching and a 1M-token context?

Sonnet 5 offers a 1M-token context window, 128K max output and prompt caching — cache reads bill at $0.20 per 1M tokens officially, $0.10 after the discount. Sonnet 4.6 shares the output ceiling and caching, but on this endpoint it serves about 200K input tokens: above that Anthropic returns a long-context rate_limit_error, so send longer documents to Sonnet 5.

### How can I try the Claude Sonnet API for free?

Sign up with Google or GitHub and the account starts with $5 of platform bonus credit, usable on Sonnet and every other supported Claude, GPT, Gemini and Kimi model. Email/password accounts do not receive the bonus.

---
Get a key: https://apitoken.sale/register
More guides: https://apitoken.sale/docs/learn
