Anthropic: claude-sonnet-4
claude-sonnet-4
Start building free
claude-sonnet-4 is a mid-tier large language model from Anthropic’s Claude 3.5-era “Sonnet” family, designed to balance strong intelligence with lower latency and cost than flagship models like Claude Opus. It targets a wide range of enterprise and developer use cases, including software development assistance, analytical reasoning, content generation, and customer support, with solid performance on complex tasks while remaining efficient enough for interactive and production workloads. As part of the Claude line, it is accessible via Anthropic’s APIs and partner platforms, and is positioned as a default, general-purpose model for many applications where a mix of speed, quality, and affordability is important.
Pricing
Current price per 1,000,000 tokens. Every request is billed automatically from its exact usage.
Included in plans
Statistics
Live performance and usage of this model, aggregated across all users.
Detailed statistics appear here as soon as this model starts receiving requests.
API
Call this model from any OpenAI-compatible client using your API token.
curl https://apiex.cloud/api/v1/chat/completions \
-H "Authorization: Bearer $NEW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4",
"messages": [
{
"role": "user",
"content": "Explain quantum entanglement in one paragraph."
}
],
"temperature": 0.7
}'
Authentication
Every request must include an Authorization: Bearer <TOKEN> header. Generate a token from your account's API Keys page — its access to models is set automatically from your active plans and redeemed codes, and you can set its rate limit and IP restrictions.
| Parameter | Type | Description |
|---|---|---|
model | string, required | This model's ID, exactly as shown above. |
messages | array, required | Conversation history as role/content objects (system, user, assistant). |
temperature | number, optional | Sampling randomness, typically 0–2. |
max_tokens | integer, optional | Upper limit on tokens generated in the reply. |
top_p | number, optional | Nucleus-sampling threshold, as an alternative to temperature. |
stream | boolean, ignored | Responses are always returned in full so the exact cost can be billed; streaming is not available. |
Replace YOUR_API_KEY with a token from your account, then see the full API reference for every parameter.
Frequently asked questions
What is claude-sonnet-4?
claude-sonnet-4 is a mid-tier large language model from Anthropic’s Claude 3.5-era “Sonnet” family, designed to balance strong intelligence with lower latency and cost than flagship models like Claude Opus. It targets a wide range of enterprise and developer use cases, including software development assistance, analytical reasoning, content generation, and customer support, with solid performance on complex tasks while remaining efficient enough for interactive and production workloads. As part of the Claude line, it is accessible via Anthropic’s APIs and partner platforms, and is positioned as a default, general-purpose model for many applications where a mix of speed, quality, and affordability is important.
How much does claude-sonnet-4 cost?
Input tokens are priced at $3,60 per 1,000,000 tokens and output tokens at $18,00 per 1,000,000 tokens. Pricing is billed automatically per request; no separate plan is required.
What is the context length of claude-sonnet-4?
claude-sonnet-4 supports a context window of up to 200,000 tokens.
Does claude-sonnet-4 support image input?
Yes, claude-sonnet-4 accepts image input in addition to text.
Which provider is claude-sonnet-4 from?
claude-sonnet-4 is developed by Anthropic and made available on this gateway through our routing infrastructure.
When was claude-sonnet-4 added to this gateway?
claude-sonnet-4 has been available on this gateway since September 23, 2026.
Is claude-sonnet-4 currently available?
Yes, claude-sonnet-4 is active and can be used right now through this gateway.