Upgraded the Claude SDK? Any request that sends temperature gets a 400

Claude API version 2026-10-21 removed temperature, top_p and top_k, and any request that sends them gets a 400, even at the default value. The new major SDK versions send this version on their own, so upgrading means changing your code.

Published Updated 5 min read#AI#Developer tools

If you have code that talks to the Claude API and you plan to upgrade your SDK, there's a new API version that changes what a request accepts. The API version is the value of the anthropic-version header sent with every request, and the SDK sets it for you. Anthropic released version 2026-10-21 on October 21, 2026, along with new major versions of every SDK that send it on their own. By the end of this article you'll know what breaks in your code, and whether to upgrade now or stay on 2023-06-01.

What changed in version 2026-10-21 of the Claude API?

Version 2026-10-21 of the Claude API removed temperature, top_p and top_k, so any request that sends one of them gets a 400 error on every model, even when the value is the default. On top of that, there are two new limits on where documents and citations can go, and renamed fields in the Admin API.

It's the first new version since 2023-06-01, according to the versions page. The Messages API changes also apply to token counting and to each request in a Message Batch created on the new version, according to the migration guide:

What you send

What happens on 2026-10-21

temperature, top_p or top_k

400 error, even at the default value

A document block directly in an assistant message

400 error. Send the document in a user message. A document nested inside another block (like a web fetch result) is still accepted

A text block with a non-empty citations array in a user message, directly or inside search_result

400 error. Citations in assistant messages are still accepted

Admin API

roles is now role_ids, group_id is now rbac_group_id, name on roles is now display_name, group_type is now group.type, and workspace_id on API keys is now scope.workspace_id

Claude Enterprise Analytics API

actor.email is now actor.email_address, and summaries is now data

Whose code breaks when they upgrade the SDK?

Every older SDK version sent 2023-06-01 with each request. The new major versions send 2026-10-21, so upgrading the library on its own moves all your requests to the new version.

These are the versions, per the October 21 release notes:

Library

First version that sends 2026-10-21

Python (anthropic)

2.0.0

TypeScript (@anthropic-ai/sdk)

1.0.0

C# (Anthropic)

13.0.0

Go (anthropic-sdk-go/v2)

2.0.0

Java (anthropic-java)

3.0.0

PHP (anthropic-ai/sdk)

1.0.0

Ruby (anthropic)

2.0.0

ant CLI

2.0.0

In these versions the three fields are gone from the SDK types and from the CLI flags, so code that passes them has to change in the same upgrade. In C# there's one case with no error at all: the IChatClient adapters now ignore Temperature, TopK and TopP silently.

The 400 shows up when a request is built outside the SDK types: code that sends HTTP directly with the header set to 2026-10-21, or a framework or gateway between your code and Anthropic that adds the values for you. If you have a gateway like LiteLLM in the middle, check what it actually sends in a real request log.

The new versions also have changes that have nothing to do with the API version: Text Completions is gone from the TypeScript, Go, Java and Ruby SDKs and from the CLI, the API key in the main client is now sent as Authorization: Bearer instead of X-Api-Key (watch out if you have a proxy that reads X-Api-Key), and the license is now Apache 2.0 instead of MIT. On Amazon Bedrock, the new version is only available for Claude 4.7 and later.

What happens to your model's output when you drop temperature?

A request without the three fields uses their default values, and temperature defaults to 1.0, the same as a 2023-06-01 request that leaves them out. On Claude 4.7 and later nothing changes, because those models already accept only the defaults.

The difference shows on models that accept other values, like Claude Sonnet 4.6. If you lowered temperature to get steadier output (classification, or JSON extraction), that effect goes away, and the migration guide says no other setting replaces it. The request will return 200 as usual, but the results may vary more than before.

So it's not enough to see that the requests went through. Take a sample of the requests that depend on steady output, run each one several times on both versions, and compare how much the results differ.

Should you upgrade now or stay on 2023-06-01?

Anthropic recommends the latest version whenever possible. But the versions page still lists 2023-06-01 with no sign that it's deprecated, and the migration guide itself says: a request that relies on a non-default value either stops sending it, or stays on 2023-06-01.

Your situation

What to do

You don't send the three fields, or you send the defaults

Upgrade, and remove the fields from your code

Your models are Claude 4.7 and later

Upgrade: the output won't change

You have requests that rely on a low temperature on a model like Sonnet 4.6

Keep those requests on 2023-06-01, and upgrade the rest

You call a model older than Claude 4.7 on Bedrock

Stay on your current SDK version

If you call the API without an SDK, the header is in your hands on every request. If you go through an SDK, the older library version keeps sending 2023-06-01. Whatever you choose, write it down in one place: which service is on which version, and why, because platforms are changing under you fast, like the models that left Copilot and Codex.

How do you upgrade to version 2026-10-21, in order?

The upgrade takes five steps, and the migration guide says to release the library upgrade together with your code fixes:

  1. Search for the three fields in your code, settings and wrappers. A text search won't catch values a framework adds at runtime, so also check a real request log:

grep -rn "temperature\|top_p\|top_k" --include="*.py" --include="*.ts" --include="*.js" --include="*.go" --include="*.java" --include="*.cs" --include="*.php" --include="*.rb" .
  1. Search for document blocks in assistant messages and citations in user messages, and fix them as in the table above.

  2. Upgrade the library to the version in the table. In TypeScript, if you use the platform packages (@anthropic-ai/bedrock-sdk, @anthropic-ai/vertex-sdk and the others), move them to v1 at the same time, or your package manager installs a second, older copy of @anthropic-ai/sdk. In Go, the import path now ends in /v2.

  3. If you work in Claude Code, version 2.1.307 (published to npm on October 21) added a /claude-api api-version command that moves Claude API code to the new version, according to the Claude Code changelog. /claude-api is a skill that ships with Claude Code; if you want to see what skills are and how they work, there are AI skills in the store. Run the command on a separate branch and review the diff before you merge.

  4. Test against 2026-10-21 before you release. Here's a test request without an SDK, from the migration guide:

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2026-10-21" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'

After you release, watch for 400 errors from Anthropic in the first few days. And in your code, how many requests still send temperature?

FAQ

If I never send temperature, does the change affect me?

Possibly. The same version has other changes: a document block in an assistant message, citations in a user message, and renamed Admin API fields. And if a framework or gateway builds the request for you, check what it actually sends.

Is version 2023-06-01 being shut down?

Nothing official says so. Anthropic's versions page still lists it with no sign that it's deprecated, and the migration guide suggests keeping requests that need a non-default temperature on it. But Anthropic recommends the latest version whenever possible.

Is there a new setting that replaces temperature?

No. The migration guide says plainly that no other setting replaces it. A request without it uses the default values, and temperature defaults to 1.0.

I use Claude on Amazon Bedrock. Can I upgrade?

Only with Claude 4.7 and later. On Bedrock, version 2026-10-21 is only available for those models, so if you call an older model there, stay on your current SDK version or on the version you send today.

Share

More articles