temperature, top_p and top_k return a 400 in API version 2026-10-21
Returns 400
Applies to claude-* on the Anthropic Messages API with anthropic-version: 2026-10-21.
Anthropic's docs describe this error but don't quote the exact message, so we don't either.
How to fix it
Remove temperature, top_p and top_k from every request, on every model, when you send anthropic-version: 2026-10-21.
Before
{
"max_tokens": 1024,
"messages": [
{
"content": "Summarize this ticket.",
"role": "user"
}
],
"model": "claude-opus-4-8",
"temperature": 1
}After (Claude Opus 4.8 (API version rules only))
{
"max_tokens": 1024,
"messages": [
{
"content": "Summarize this ticket.",
"role": "user"
}
],
"model": "claude-opus-4-8"
}Official source
In2026-10-21, a request that sendstemperature,top_p, ortop_kreturns a 400 error, even at the parameter’s default value.
https://platform.claude.com/docs/en/api/migration-2026-10-21 (last checked 2026-11-02)
Other changes for the same models
FAQ
How do I fix this when moving to claude-*?
Remove temperature, top_p and top_k from every request, on every model, when you send anthropic-version: 2026-10-21.
Where is this documented?
In Anthropic’s official docs: https://platform.claude.com/docs/en/api/migration-2026-10-21, last checked 2026-11-02.