APIMart
Back to all models

Claude Sonnet 4.6 API

AnthropicModel ID claude-sonnet-4-6Text modelReleased February 17, 2026

Use Claude Sonnet 4.6 to fix a failing test with the smallest change, fill in a multi-step web form from a request, or answer a question across a long contract.

Max input
1,000,000 tokens
Max output
128,000 tokens
Input → output
Text, Image → Text
Knowledge cutoff
August 2025
  • Image input
  • Streaming
  • Cached input pricing
  • OpenAI SDK compatible

Claude Sonnet 4.6 API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on Claude Sonnet 4.6.

Try Claude Sonnet 4.6 with your own material

Fixing failing tests

Give Claude Sonnet 4.6 the failing test, the error and the function under test, and have it propose the smallest fix. Rerun the full test suite before merging.

Example: Why does this test fail?

Material

Test
expect(slugify('Hello, World!')).toBe('hello-world')
Function
const slugify = (s) => s.toLowerCase().replace(/ /g, '-');
Error
Expected 'hello-world', received 'hello,-world!'

PromptExplain why the test fails and give the smallest change that fixes it.

Sample answer · written by hand to show the reasoning

The function only replaces spaces, so the comma and exclamation mark stay in the result. Remove anything that is not a letter, digit or space first: s.toLowerCase().replace(/[^a-z0-9 ]/g, '').trim().replace(/ +/g, '-'). That returns 'hello-world' and also collapses double spaces.

About the Claude Sonnet 4.6 API

  • Close to Opus 4.6 on many tests

    Anthropic released Claude Sonnet 4.6 on February 17, 2026 as its most capable Sonnet yet, close to Opus 4.6 on coding and computer use at a lower price.

  • 1M context at standard prices

    The whole 1M-token context window is billed at standard prices, enough for a large codebase or a long contract in one request, with up to 128K output tokens.

  • Sonnet 5.5 costs a third less

    Anthropic now lists Sonnet 4.6 as legacy and recommends Claude Sonnet 5.5. Workloads validated on Sonnet 4.6 can stay, with retirement not before February 17, 2027.

  • Claude Sonnet 4.6 API key and access

    You don’t need a separate Claude Sonnet 4.6 API key: one APIMart key works for every model. Check the Claude Sonnet 4.6 pricing table on this page, then call an OpenAI Chat Completions-compatible endpoint with the model ID claude-sonnet-4-6.

Claude Sonnet 4.6 official benchmark results

Selected results Anthropic published at launch.

  • SWE-bench Verified

    79.6%

    Real GitHub issues. Up from 77.2% for Sonnet 4.5, close to Opus 4.6 (80.8%) and GPT-5.2 (80.0%).

  • OSWorld-Verified

    72.5%

    Completing tasks by operating a computer. Up from 61.4% for Sonnet 4.5 and on par with Opus 4.6 (72.7%).

  • GDPval-AA

    1,633 Elo

    Knowledge work across occupations, rated in Elo. Ahead of Opus 4.6 (1,606), GPT-5.2 (1,462) and Sonnet 4.5 (1,276).

  • ARC-AGI-2

    58.3%

    Novel visual reasoning puzzles. Up from 13.6% for Sonnet 4.5 and ahead of GPT-5.2 (54.2%); Opus 4.6 scores 68.8%.

  • Terminal-Bench 2.0

    59.1%

    Agentic coding tasks in a terminal. Up from 51.0% for Sonnet 4.5; Opus 4.6 scores 65.4% and GPT-5.2 64.7%.

  • Humanity’s Last Exam (with tools)

    49.0%

    Hard questions across many disciplines. Up from 33.6% for Sonnet 4.5; GPT-5.2 scores 50.0% and Opus 4.6 53.0%.

How to call the Claude Sonnet 4.6 API

To call Claude Sonnet 4.6, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "claude-sonnet-4-6",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

Claude Sonnet 4.6 access details

Model IDclaude-sonnet-4-6
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

Claude Sonnet 4.6 API request parameters

Claude Sonnet 4.6 uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use claude-sonnet-4-6 for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

Claude Sonnet 4.6 API pricing

The Claude Sonnet 4.6 API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input24Credits~$2.422.8Credits~$2.2821.6Credits~$2.1630Credits~$320%
Cached input2.4Credits~$0.242.28Credits~$0.2282.16Credits~$0.2163Credits~$0.320%
Output120Credits~$12114Credits~$11.4108Credits~$10.8150Credits~$1520%

Prices are for reference only. View full pricing

Why call Claude Sonnet 4.6 API through APIMart

  • 20% below official pricing

    Claude Sonnet 4.6 API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below Anthropic's official prices, and cached input costs just $0.24 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    Claude Sonnet 4.6, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try Claude Sonnet 4.6 with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which Anthropic model should you choose?

Base prices per 1M tokens (USD). Your Claude Sonnet 4.6 API key works for every model in the table; just change the model parameter.

Differences between Anthropic models
ComparisonClaude Sonnet 4.6 CurrentClaude Sonnet 4.5Claude Haiku 4.5Claude Opus 4.5Claude Opus 4.6Claude Opus 4.7Claude Opus 4.8Claude Fable 5Claude Sonnet 5Claude Opus 5Claude Haiku 5.5Claude Sonnet 5.5Claude Opus 5.5Claude Fable 5.1Claude Fable 5.2
Best forCoding, Computer use, 1M contextCoding and agents, Computer use, 200K contextSmall model, Sub-agents and bulk tasks, 200K contextCoding and agents, Adjustable effort, 200K contextCoding and code review, Knowledge work, 1M contextHard coding tasks, High-resolution images, Long agentic runsLarge code migrations, Legal and knowledge work, Computer useLong-running agents, Software engineering, Knowledge work and scienceCoding, Research agents, Computer useCoding, Agents, Knowledge workClassification & routing, Data extraction, Sub-agent tasksEveryday coding, Agentic tasks, Data analysisAgentic coding, Large-scale refactoring, Knowledge workCode review, Long-running coding, Documents and spreadsheetsHard coding problems, Scientific research, Financial modeling
Max input1,000,000 tokens200,000 tokens200,000 tokens200,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens1,000,000 tokens
Max output128,000 tokens64,000 tokens64,000 tokens64,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens
Knowledge cutoffAugust 2025January 2025February 2025May 2025May 2025January 2026January 2026January 2026January 2026May 2026June 2026June 2026June 2026June 2026June 2026
Input price$2.4$2.4$0.8$4$4$4$4$8$1.6$4$0.08$1.6$3.2$8$6.4
Output price$12$12$4$20$20$20$20$40$8$20$0.4$8$16$40$32

Claude Sonnet 4.6 FAQ

Should I use Claude Sonnet 4.6 or Claude Sonnet 5.5?

Start new projects on Claude Sonnet 5.5: Anthropic now recommends it to Sonnet 4.6 users, and its official input and output prices are a third lower ($2 / $10 vs. $3 / $15 per million tokens). Keep in mind that Sonnet 5 and later use a newer tokenizer that produces about 30% more tokens for the same text, so compare cost on your own prompts. Workloads already validated on Sonnet 4.6 can stay on it; on APIMart you only change the model parameter.

How does Claude Sonnet 4.6 compare with Claude Opus 4.6?

In Anthropic’s system card the two are close on many tests, such as 79.6% vs. 80.8% on SWE-bench Verified and 72.5% vs. 72.7% on OSWorld-Verified, while Opus 4.6 leads on harder reasoning such as ARC-AGI-2 (68.8% vs. 58.3%). Anthropic says Opus 4.6 remains the stronger choice for the deepest reasoning, such as large refactors and coordinating several agents. Sonnet 4.6 costs 40% less per token.

What is the training cutoff of Claude Sonnet 4.6?

Anthropic lists a reliable knowledge cutoff of August 2025 for Claude Sonnet 4.6, and a training data cutoff of January 2026. The model knows most about events up to August 2025; for later events, pass the relevant documents in the request or use a web search tool.

Does input over 200K tokens cost more?

No. Anthropic’s current pricing docs say Claude 4.6 and later models include the full 1M-token context window at standard prices, so a long request is billed at the same per-token rate as a short one. The pricing table on this page covers the whole window.

Is Claude Sonnet 4.6 being retired?

Not yet. Anthropic lists claude-sonnet-4-6 as an active legacy model, with retirement not sooner than February 17, 2027. Legacy means it no longer receives updates and may be deprecated later; this page will show a notice and a replacement link if that happens.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select Claude Sonnet 4.6 in the text category to start exploring.

Which model ID does the Claude Sonnet 4.6 API use?

Set model to claude-sonnet-4-6. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of Claude Sonnet 4.6?

On APIMart, Claude Sonnet 4.6 accepts up to 1,000,000 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

Claude Sonnet 4.6 can output up to 128,000 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the Claude Sonnet 4.6 API cost?

The Claude Sonnet 4.6 API on APIMart is billed by token, and prices depend on your membership tier. Gold: $2.4 per million input tokens and $12 per million output tokens. Diamond: $2.16 per million input tokens and $10.8 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.