Direct
Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output | Cache read | Cache write |
|---|---|---|---|
| 3.00/M | 15.00/M | 0.20/M | 3.75/M |

claude-sonnet-5Sonnet 5 is Anthropic’s most powerful Sonnet-level model, with frontier performance in coding, agentic, and professional work. It supports adaptive thinking with selectable reasoning effort levels (low, medium, high, maximum, and ultra-high), a 1M token context window, and text, image, and file inputs. Sonnet 5 uses a newer tokenizer and includes real-time web protection measures that block certain high-risk dual-use activities.
The same model is available through multiple service channels — choose based on latency, reliability and cost.
Prices in $ / 1M tokensprovider field to the request body, for example "provider": { "channel": "direct" }. Valid values are direct / stable / economical; omit it to use the default channel.Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output | Cache read | Cache write |
|---|---|---|---|
| 3.00/M | 15.00/M | 0.20/M | 3.75/M |
A balanced route optimized for availability and speed — a good default for production traffic.
| Input | Output | Cache read | Cache write |
|---|---|---|---|
| 3.002.40/M | 15.0012.00/M | 0.200.16/M | 3.753.00/M |
Claude Sonnet 5 is Anthropic's strongest Sonnet-tier model to date, pushing the Sonnet tier to near-Opus levels in coding, agents, and professional work. It comes with adaptive thinking enabled by default, supports five levels of reasoning Effort from low to max, a 1M token context window, and text, image, and file input.
For production workloads that need to balance quality, speed, and cost, Sonnet 5 is usually a more cost-effective choice than the flagship tier: it approaches Opus-level performance on most coding and agentic tasks, but with higher throughput and lower per-unit cost.
SeaWhale AI offers both the Anthropic-native Messages API and an OpenAI-compatible interface, so tool calling, thinking control, caching, and multimodal input are all directly available.
Get API Key · Model ID:
claude-sonnet-5
low / medium / high / xhigh / max, giving precise control over intelligence and cost based on task difficultyThe biggest improvements in Sonnet 5 over the previous generation are in coding and agentic tasks. It can understand cross-file dependencies, complete multi-file feature development, perform repository-level refactoring, and remain stable across long chains of tool calls.
The model decides the depth of thinking based on the task; you only need to set an Effort level. Use medium for everyday tasks to save tokens, switch to xhigh for tough problems to get stronger reasoning, and drop to low for latency-sensitive scenarios.
high, balancing quality and costxhigh is for the hardest coding and agentic tasksWithin the full 1M token window, instruction following, tool calling, and reasoning quality remain stable, making it suitable for large codebase analysis, long-document Q&A, and cross-session agent memory.
Supports text, image, and file input; with high-resolution vision up to 2576 pixels on the long edge, chart transcription, UI replication, and PDF and technical drawing analysis are all more accurate.
| Scenario | Description |
|---|---|
| Production-grade coding assistant | High-throughput code completion, refactoring, and review at a lower cost than the flagship tier |
| Agentic workflows | Multi-step tool calling, result verification, and autonomous execution |
| Long-document analysis | Process research materials, contracts, and technical documents within a 1M token window |
| Multimodal tasks | Chart reading, UI understanding, and information extraction from scanned documents |
| Customer service and conversational products | Controllable latency at low Effort, with quality still significantly better than the previous generation |
| Batch processing pipelines | Extraction, classification, and structured output at high concurrency |
| Capability | Claude Sonnet 5 | Claude Sonnet 4.6 | Claude Opus 4.8 |
|---|---|---|---|
| Model ID | claude-sonnet-5 |
claude-sonnet-4-6 |
claude-opus-4-8 |
| Positioning | Best balance of speed and intelligence | Balanced tier of the previous generation | Flagship long-horizon agent |
| Context window | 1M tokens | 1M tokens | 1M tokens |
| Max output | 128K tokens | 128K tokens | 128K tokens |
| Thinking mode | Adaptive, enabled by default | Adaptive, requires explicit enabling | Adaptive, requires explicit enabling |
| Effort levels | low → max (including xhigh) | low → max | low → max |
| Vision resolution | High resolution (2576px) | Standard (1568px) | High resolution (2576px) |
For specific billing, refer to the real-time price card at the top of the page.
1. Create a SeaWhale AI API key Generate an API key in the console and top up your balance.
2. Choose your calling method
Anthropic-native capabilities (thinking, cache_control, anthropic-beta) go through /v1/messages; projects that already use the OpenAI SDK can directly use /v1/chat/completions.
3. Make a request
curl -X POST https://api.seawhaleai.com/v1/messages \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 16000,
"thinking": {"type": "adaptive"},
"output_config": {"effort": "high"},
"messages": [
{"role": "user", "content": "梳理这个仓库的模块依赖,指出循环依赖并给出拆解方案。"}
]
}'
What's the difference between Claude Sonnet 5 and Sonnet 4.6?
Coding and agentic capabilities have improved substantially, adaptive thinking is now enabled by default, a new xhigh Effort level has been added, and high-resolution vision is supported at the Sonnet tier for the first time.
When should I choose Opus instead of Sonnet 5? Choose the Opus tier when you need the longest-horizon autonomous execution, the deepest reasoning, or the highest one-shot delivery quality. For the vast majority of production coding, analysis, and agentic work, Sonnet 5 is sufficient and more cost-effective.
How should I set Effort?
Default to high; use xhigh for the hardest coding and agentic tasks; use medium for cost-sensitive batch tasks; and use low for simple tasks such as classification and extraction.
How much context and output does it support? A 1M token context window, with up to 128K output tokens per request. For larger outputs, streaming is recommended.
Can I get the thinking content?
The full thinking text is not returned by default. If you need to show the reasoning process to users, set thinking.display to summarized to get a summary.
What input modalities are supported? Text, images, and files. The visual long edge is up to 2576 pixels, and coordinates correspond one-to-one with pixels.
claude-sonnet-5https://api.seawhaleai.com/v2/"provider": { "channel": "direct" }SeaWhale AI is compatible with the OpenAI API protocol, so you can call it with the OpenAI SDK or plain HTTP requests. Streaming is enabled by default.
About the provider parameter (optional, a SeaWhale AI extension): most models are served over several channels that differ slightly in price and reliability. Add a provider field to the request body to pick one; omit it and the system selects the default channel — normal calls are unaffected.
provideris not part of the official OpenAI protocol — it is a SeaWhale AI extension that only takes effect on this platform. The OpenAI SDK allows custom fields like this to pass through; see the examples below.
| Value | Channel | Best for |
|---|---|---|
direct | Direct | The official upstream link, for native behavior and the full context window |
stable | Preferred | Balanced availability and speed — a good default for production traffic |
economical | Economy | Cost first, well suited to batch processing and price-sensitive workloads |
Available channels and their prices are listed under "Pricing" above (channels vary by model). Additional notes:
"provider": { "channel": "direct" }.extra_body; in Node.js put it directly on the request object and it passes through. In TypeScript projects, add a // @ts-expect-error line to skip the type check.curl https://api.seawhaleai.com/v2/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "claude-sonnet-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"provider": { "channel": "direct" },
"stream": true
}'
# provider is optional — remove this line to use the default channelfrom openai import OpenAI
client = OpenAI(
base_url="https://api.seawhaleai.com/v2",
api_key="<API_KEY>",
)
stream = client.chat.completions.create(
model="claude-sonnet-5",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"},
],
stream=True,
# Optional: pick a service channel; omit to use the default
extra_body={"provider": {"channel": "direct"}},
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.seawhaleai.com/v2',
apiKey: '<API_KEY>',
})
const stream = await client.chat.completions.create({
model: 'claude-sonnet-5',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' },
],
stream: true,
// Optional: pick a service channel; omit to use the default
// @ts-expect-error provider is a SeaWhale AI extension, not in the OpenAI SDK types
provider: { channel: 'direct' },
})
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '')
}