Is the error sentence the same as the temperature error?
The migration guide does not print one. It says a non-default temperature, top_p, or top_k returns a 400. The temperature sentence is documented on temperature is deprecated for this model.
The Sonnet 5.5 migration guide groups top_p and top_k with temperature: a non-default value returns a 400. It does not print a separate error sentence for top_p or top_k.
API version 2026-10-21: sending temperature, top_p, or top_k returns a 400 on every model, even at the default value. API version 2026-10-21 sampling parameters. Source: Claude API versioning, checked 2026-10-22.
Anthropic's Sonnet 5.5 migration guide does not print a separate error sentence for top_p or top_k. It says a non-default top_p or top_k returns a 400 error on claude-sonnet-5-5. Remove the field.
The same guide says Claude Sonnet 4.6 and earlier models and Claude Haiku 4.5 accept temperature, top_p, and top_k. On claude-sonnet-5-5, remove the non-default values. The temperature sentence is on its own page. Source: Claude Sonnet 5.5 migration guide, checked October 20, 2026.
| Model id | What the source says |
|---|---|
claude-sonnet-5-5 | A non-default top_p or top_k returns a 400. The guide does not quote a distinct sentence. |
claude-sonnet-4-6 | The migration guide says Claude Sonnet 4.6 and earlier still accept top_p and top_k. |
Call the Messages API without top_p or top_k. The migration guide says to remove them.
client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
top_p=0.9,
top_k=40,
messages=[{"role": "user", "content": "Hello"}],
)
client.messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
Source: Claude Sonnet 5.5 migration guide, checked October 20, 2026.
Do not send top_p or top_k. additional_drop_params drops fields you name. drop_params only drops a field LiteLLM already lists as unsupported, so name top_p yourself.
import litellm
response = litellm.completion(
model="anthropic/claude-sonnet-5-5",
messages=[{"role": "user", "content": "Hello"}],
additional_drop_params=["top_p", "top_k"],
)
Source: LiteLLM drop unsupported params, checked October 20, 2026.
Leave topP and topK unset. generateText says topP is passed through to the provider, and it documents topK as its own option.
import { anthropic } from "@ai-sdk/anthropic";
import { generateText } from "ai";
const { text } = await generateText({
model: anthropic("claude-sonnet-5-5"),
prompt: "Hello",
});
Source: AI SDK generateText, checked October 20, 2026.
The migration guide does not print one. It says a non-default temperature, top_p, or top_k returns a 400. The temperature sentence is documented on temperature is deprecated for this model.