Claude API version 2026-10-21: temperature removed, new SDK majors (TS 1.0, Python 2.0)
Since 2026-10-21 the current Claude API version is `2026-10-21`. `temperature`, `top_p` and `top_k` are removed (400 on every model, even at the default). `@anthropic-ai/sdk` 1.0 and `anthropic` 2.0 send the new version, drop those parameters from their types, send the key as `Authorization: Bearer`, and accept one credential per client.
Claude API version 2026-10-21
As of: 2026-10-22 · Sources: API versions, migration guide
The SDK release notes only say "add support for new API version 2026-10-21". What changes:
Messages API (any client sending anthropic-version: 2026-10-21)
temperature,top_pandtop_kare removed. A request with any of them returns 400 on every model, even at the default value. Remove them. Requests sample with the defaults (temperature 1.0). Claude 4.7 and later models already accept only the defaults; on older models such as Claude Sonnet 4.6, code that lowered temperature loses that effect, and nothing replaces it. If a request truly needs a non-default value, keep that request on2023-06-01.- A
documentblock placed directly in anassistantmessage returns 400. Send documents inusermessages. - A
textblock with a non-emptycitationsarray in ausermessage (also insidesearch_result) returns 400. Citations in assistant messages, and"citations": {"enabled": true}on documents, still work.
For more consistent output without temperature: a JSON schema / structured output that only allows the valid values, a precise prompt, and caching identical inputs.
SDKs
| SDK | First version on 2026-10-21 |
|---|---|
TypeScript @anthropic-ai/sdk | 1.0.0 (v1 of the bedrock/vertex/foundry/aws/google-cloud packages needs v1 of the SDK) |
Python anthropic | 2.0.0 |
| Go | v2.0.0, module path github.com/anthropics/anthropic-sdk-go/v2 |
Java com.anthropic:anthropic-java | 3.0.0 |
C# Anthropic | 13.0.0 |
Ruby anthropic | 2.0.0 |
PHP anthropic-ai/sdk | 1.0.0 (composer require; composer update stays on the old constraint) |
CLI ant | 2.0.0 (go install path ends in /v2) |
Behaviour of the new majors:
temperature,top_p,top_kare gone from the types. Python 2.0 raisesTypeError: Messages.create() got an unexpected keyword argument 'temperature'before sending.- The API key goes out as
Authorization: Bearer <key>, notX-Api-Key(the API accepts both). Proxies, gateways and middleware that readx-api-keymust readauthorization. - One credential per client. Passing two (
api_key+auth_token,apiKey+credentials…) raisesValueError(Python) orTypeError(TypeScript). MessageParamis a union ofUserMessageParam | AssistantMessageParam | SystemMessageParam. Dict/object literals with a fixedroleneed no change; callingMessageParam(...)in Python raisesTypeError; a TypeScriptinterface X extends MessageParammust become a type alias.- Text Completions (
client.completions,HUMAN_PROMPT,max_tokens_to_sample) is removed (TS, Go, Java, Ruby, CLI). Useclient.messages.create. betasis removed from the non-beta Models methods: useclient.beta.models.list({ betas }).- TypeScript tool runner:
compactionControlis removed; use server-side compaction (context_managementwithcompact_20260112).
Watch out
pip install anthropic/npm install @anthropic-ai/sdkwithout a version now installs the new major. An unpinnedanthropicin requirements.txt upgrades on the next build.^0.xin package.json stays on 0.x.- On Amazon Bedrock, 2026-10-21 works only for Claude 4.7 and later; stay on the old SDK major (or the old header) for older Bedrock models.
- Raw HTTP clients that send
anthropic-version: 2023-06-01keep working on that version; switch the header and remove the parameters together.
Full write-up with the tests: Claude API 2026-10-21: what breaks when you upgrade.