# Claude Sonnet 5 API

https://getmegabrain.com/models/anthropic/claude-sonnet-5 · prices from the live MegaBrain catalogue

> Sonnet 5 is Anthropic's most capable Sonnet-class model, with frontier performance across coding, agents, and professional work. It supports adaptive thinking with selectable reasoning effort levels (low, medium, high, max,...

| | |
|---|---|
| Model ID | `anthropic/claude-sonnet-5` |
| Provider | Anthropic |
| Context window | 1,000,000 tokens |
| Input tokens | $1.02 per 1M tokens |
| Output tokens | $5.13 per 1M tokens |
| Official Anthropic API input | $2 per 1M tokens (MegaBrain is 49% less) |
| Official Anthropic API output | $10 per 1M tokens (MegaBrain is 48.7% less) |
| Cache read | $0.1 per 1M tokens |
| Cache write | $1.27 per 1M tokens |
| Accepts | Text, Images, Files, and pdf |
| Produces | Text |
| Max output tokens | 128,000 |

## Call it

```python
from openai import OpenAI

client = OpenAI(base_url="https://getmegabrain.com/api/gateway/v1", api_key="YOUR_MEGABRAIN_KEY")
reply = client.chat.completions.create(
    model="anthropic/claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)
```

## FAQ

**How much does the Claude Sonnet 5 API cost?**

$1.02 per 1M input tokens and $5.13 per 1M output tokens, charged from a prepaid US-dollar balance for the tokens actually used. There is no subscription.

**Is the Claude Sonnet 5 API cheaper than the official Anthropic API?**

Yes: $1.02 per 1M input tokens instead of $2 (−49%) and $5.13 per 1M output tokens instead of $10 (−48.7%). It is the same model, called with one MegaBrain key and paid from prepaid credits, with no subscription.

**What is the context window of Claude Sonnet 5?**

1,000,000 tokens (1M), with up to 128,000 tokens in one reply.

**How do I call Claude Sonnet 5 through the API?**

Send an OpenAI-compatible request to https://getmegabrain.com/api/gateway/v1/chat/completions with "model": "anthropic/claude-sonnet-5" and your MegaBrain API key as a Bearer token. The official OpenAI SDKs, LangChain and any client with a base URL setting work; the same key also reaches image and video models.

**What input does Claude Sonnet 5 accept?**

It accepts Text, Images, Files, and pdf and produces Text.

**Can I try Claude Sonnet 5 before paying?**

Sign-up is free and open to everyone. Adding a card (nothing is charged) gives $1.00 of credit to try any model; after that every model is charged from a balance you top up by card.
