SunsetDiff

temperature is deprecated for this model

A request to claude-sonnet-5-5 that sets a non-default temperature, top_p, or top_k comes back as HTTP 400. Remove those fields.

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.

Error text

temperature is deprecated for this model

Anthropic's Sonnet 5.5 migration guide says a non-default temperature, top_p, or top_k returns a 400 error. Remove them. Claude Sonnet 4.6 and earlier, and Claude Haiku 4.5, still accept those fields. Source: Claude Sonnet 5.5 migration guide, checked October 20, 2026.

Affected models

Models named on the official page for this failure.
Model idWhat the source says
claude-sonnet-5-5 Returns 400 when temperature, top_p, or top_k is set to a non-default value.

Fix

Raw SDK

Call the Messages API without temperature, top_p, or top_k. The migration guide's working request leaves those fields out.

Python

import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=16000,
    messages=[{"role": "user", "content": "Hello"}],
)

TypeScript

import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const message = await client.messages.create({
  model: "claude-sonnet-5-5",
  max_tokens: 16000,
  messages: [{ role: "user", content: "Hello" }],
});

Source: Claude Sonnet 5.5 migration guide, checked October 20, 2026.

LiteLLM

Do not send temperature, top_p, or top_k. LiteLLM's drop_params setting removes a field only when LiteLLM already lists that field as unsupported for the model. To remove temperature and top_p on this call, pass additional_drop_params.

Python

import litellm
response = litellm.completion(
    model="anthropic/claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Hello"}],
    additional_drop_params=["temperature", "top_p"],
)

Source: LiteLLM drop unsupported params, checked October 20, 2026.

Vercel AI SDK

Leave temperature, topP, and topK unset on generateText and streamText. The AI SDK passes those values through to the provider.

TypeScript

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.

Switch guides

More request errors

All request errors

Questions

Which model returns this 400?

claude-sonnet-5-5. Anthropic's migration guide says a non-default temperature, top_p, or top_k returns a 400 error on that model. Claude Sonnet 4.6 and earlier, and Claude Haiku 4.5, still accept those fields.

What should the request send instead?

Omit temperature, top_p, and top_k. The same guide says thinking budgets are replaced by output_config.effort. The switch guide lists each request change: claude-sonnet-4-5-20250929 to claude-sonnet-5-5.

Deprecation alerts

We email you before models shut down. Unsubscribe anytime.

Deprecation alert signup
Providers (optional)