Claude API 400 error after an SDK update? temperature, top_p and top_k are gone
Ship ItChecked against the official source
Source checked 2 Nov 2026 · Published 2 Nov 2026 · Last reviewed 2 Nov 2026 · By Ctrl+Z Therapy (how we test)
The short answer
Anthropic released API version 2026-10-21 on October 21, 2026, and new SDK versions send it by default: Python SDK 2.0.0 (the anthropic package) and TypeScript SDK 1.0.0 (@anthropic-ai/sdk). In 2026-10-21, a request that sends temperature, top_p, or top_k returns a 400 error, even at the parameter's default value. The new SDKs and the CLI no longer have the three parameters, so remove them from your requests.
What to do
- Check which SDK version your app uses. If you use an SDK, your requests use the API version that was current when your SDK's major version was released.
- Remove temperature, top_p and top_k from every Claude request in your code.
- Go through the other breaking changes in Anthropic's migration guide, then test against the new version before you release.
Good to know
- Models that already accept only the defaults, such as Claude 4.7 and later models, sample as before.
- On models that accept other values, such as Claude Sonnet 4.6, a request that lowered temperature for more consistent output loses that effect, and no other setting replaces it.
- The new SDKs also send your API key as Authorization: Bearer. If a proxy or gateway in front of your app reads the old X-Api-Key header, update it too.
Source
Checked on 2 Nov 2026. Prices, limits and settings change, so check the source before you rely on them.