{"slug": "claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade", "title": "Claude API Version 2026-10-21: What Breaks and How to Upgrade", "summary": "Anthropic released Claude API version 2026-10-21 on 21 Oct 2026, the first new Claude API version since 2023-06-01, and requests that send temperature, top_p or top_k now return a 400 error \"even at the parameter's default value,\" per Anthropic's migration guide. The release ships new major SDK versions (Python 2.0.0, TypeScript 1.0.0, Go 2.0.0, Java 3.0.0, C# 13.0.0, PHP 1.0.0, Ruby 2.0.0 and ant CLI 2.0.0) that send anthropic-version: 2026-10-21 by default and are licensed under Apache 2.0 instead of MIT, while older SDKs keep sending 2023-06-01 until upgraded. The version also rejects document blocks placed directly in assistant messages and text blocks with a non-empty citations array in user messages, and renames Admin API fields: workspace_id becomes scope.workspace_id, RBAC role name becomes display_name, and group_type becomes group.type.", "body_md": "# Claude API Version 2026-10-21: What Breaks and How to Upgrade\n\nClaude API version 2026-10-21 removes temperature, top_p and top_k and ships new SDK majors. What returns a 400 now, what breaks proxies, and how to upgrade.\n\nClaude API version 2026-10-21 is the first new Claude API version since 2023-06-01. Anthropic released it on 21 Oct 2026 with new major versions of every SDK. It removes `temperature`, `top_p` and `top_k`, rejects two odd message shapes, renames fields in the Admin API, and the new SDKs send your key in a different header.\n\nThis page sums up Anthropic’s [versions page](https://platform.claude.com/docs/en/api/versioning), [migration guide](https://platform.claude.com/docs/en/api/migration-2026-10-21) and API release notes, opened on 22 Oct 2026, with the Python changes in most detail. If you run coding agents rather than call the API yourself, [Munder Difflin](https://harnessmd.com/download) is free and open source: a desktop app that runs a team of coding agents such as Claude Code, Codex and Gemini CLI on your own computer. Our [install guide](https://munderdiffl.in/blog/how-to-install-and-use-munder-difflin/) covers setup.\n\n## What changed in Claude API version 2026-10-21? [#](#what-changed-in-claude-api-version-2026-10-21)\n\nThree Messages API requests that used to work now return a 400 error, and each SDK has a new major version that sends `anthropic-version: 2026-10-21` by default. An SDK keeps the API version that was current when its major version came out, so code on an older SDK keeps sending 2023-06-01 until you upgrade.\n\n| SDK or tool | First version on 2026-10-21 | \n|---|---|\n| Python | 2.0.0 | \n| TypeScript | 1.0.0 | \n| Go | 2.0.0 | \n| Java | 3.0.0 | \n| C# | 13.0.0 | \n| PHP and Ruby | 1.0.0 and 2.0.0 | \n| ant CLI | 2.0.0 | \n\nThe release notes add that the new SDK and CLI versions are licensed under Apache 2.0 instead of MIT, and the versions page says 2026-10-21 runs on the Claude API, Claude Platform on AWS, Microsoft Foundry and Google Cloud. On Amazon Bedrock it covers Claude 4.7 and later models only.\n\n## Why do temperature, top_p and top_k return a 400? [#](#why-do-temperature-top-p-and-top-k-return-a-400)\n\nThey are removed. Anthropic’s migration guide says a request on 2026-10-21 that sends `temperature`, `top_p` or `top_k` “returns a 400 error, even at the parameter’s default value.” That covers Message Batch requests and token counting too.\n\nThe fix is to delete the three parameters; the new SDK majors no longer have them:\n\n```\n# anthropic 1.x sends 2023-06-01: temperature is accepted\nclient.messages.create(model=\"claude-opus-5-5\", max_tokens=1024,\n                       temperature=1.0, messages=messages)\n\n# anthropic 2.0 sends 2026-10-21 and has no temperature, top_p or top_k\nclient.messages.create(model=\"claude-opus-5-5\", max_tokens=1024,\n                       messages=messages)\n```\n\nA request without them samples at the defaults, a `temperature` of 1.0, the same as a 2023-06-01 request that leaves them out. Models that already accept only the defaults, “such as Claude 4.7 and later models,” sample as before. On a model that accepts other values, such as Claude Sonnet 4.6, a request that lowered `temperature` for steadier output loses that effect, and the guide says: “No other setting replaces it.” Such a request can stay on 2023-06-01.\n\n## What other requests now fail? [#](#what-other-requests-now-fail)\n\nTwo message shapes, plus renamed fields outside the Messages API. A `document` block placed directly in an `assistant` message returns a 400; send documents in `user` messages instead. A `text` block with a non empty `citations` array in a `user` message, directly or inside a `search_result` block, also returns a 400. Citations on Claude’s own replies that you send back are still accepted.\n\nIn the Admin API, API key entries no longer return `workspace_id` (use `scope.workspace_id`), RBAC roles return `display_name` instead of `name`, and rate limit entries return `group.type` instead of `group_type`. The Claude Enterprise Analytics reports drop `actor.email` for `actor.email_address`. Dashboards built on those fields need the new names.\n\n## What changes in the Anthropic Python SDK 2.0? [#](#what-changes-in-the-anthropic-python-sdk-20)\n\nMost code that writes messages as plain dicts needs no change. The main ones for Python, from the guide:\n\n- `MessageParam` is now a union of`UserMessageParam` ,`AssistantMessageParam` and`SystemMessageParam` . Calling`MessageParam(role=\"user\", content=\"Hello\")` raises a`TypeError` ; write the dict instead.\n- `client.models.list()` and`retrieve()` no longer take`betas` . Use`client.beta.models.list(betas=[...])` .\n- The API key goes out as `Authorization: Bearer <key>` , not`X-Api-Key` .\n- A client holds one credential. Passing both `api_key` and`auth_token` now raises a`ValueError` ; version 1 sent both.\n- With no credential in code, the client takes the first of `ANTHROPIC_API_KEY` ,`ANTHROPIC_AUTH_TOKEN` , the profile`ANTHROPIC_PROFILE` names, the workload identity federation variables and the active profile on disk, and logs a warning when the first two are both set.\n\n## Will a proxy or gateway break? [#](#will-a-proxy-or-gateway-break)\n\nIt will if it reads `X-Api-Key`. The Claude API accepts a key in either header, so code that talks to the API directly is fine. A company gateway, a logging proxy or a router that looks for `X-Api-Key` will see a request with no key once your app moves to the new SDK. Change it to read `Authorization`, or move the key back with the `auth` function on the HTTP client that the guide shows. If you relied on sending a gateway token and an API key together, the guide’s answer is to pass the token as `auth_token`, set `X-Api-Key` in `default_headers`, and have the gateway remove its `Authorization` header before it forwards the request. For a proxy of another kind, one that routes Claude Code to other providers, see our [Claude Code Router guide](https://munderdiffl.in/blog/claude-code-router/).\n\n## How do you upgrade safely? [#](#how-do-you-upgrade-safely)\n\nDo it in one release, as the guide’s steps say: upgrade the SDK, fix the breaking changes, test against 2026-10-21, ship together. In practice:\n\n1. Search your code for `temperature` ,`top_p` and`top_k` , including Message Batch jobs and prompt templates that pass them through.\n2. Check any proxy, gateway or test double that reads `X-Api-Key` .\n3. Upgrade the package, such as `pip install \"anthropic>=2.0.0\"` , and run your type checker for`MessageParam` and`betas` errors.\n4. Keep calls to older Bedrock models on your current SDK until they move to Claude 4.7 or later.\n\nClaude Code 2.1.307, released on 21 Oct, added a `/claude-api api-version` command to move Claude API code to 2026-10-21; its release notes do not say what it edits. Our view: the sampling change is the one most likely to slip through, because a call that sets `temperature` to its default looks harmless and still fails. For background on building agents on this API, read [what the Claude Agent SDK is](https://munderdiffl.in/blog/what-is-claude-agent-sdk/).\n\n## FAQ\n\nIs temperature removed from the Claude API?\n\nYes, in API version 2026-10-21. Anthropic's migration guide says a request that sends temperature, top_p or top_k returns a 400 error, even at the parameter's default value. Requests on 2023-06-01 keep working with them. The new SDK majors, such as Python 2.0.0, no longer have the three parameters.\n\nWhich SDK versions use API version 2026-10-21?\n\nPython SDK 2.0.0, TypeScript SDK 1.0.0, C# SDK 13.0.0, Go SDK 2.0.0, Java SDK 3.0.0, PHP SDK 1.0.0, Ruby SDK 2.0.0 and the ant CLI 2.0.0, per Anthropic's API release notes of 21 Oct 2026. Older SDK versions keep sending 2023-06-01.\n\nDo I have to upgrade to 2026-10-21 now?\n\nAnthropic's versions page recommends the latest API version whenever possible, and it gives no end date for 2023-06-01 on 22 Oct 2026. The migration guide says a request that relies on a non default temperature can stay on 2023-06-01.\n\nWhy does my proxy reject requests after upgrading the Anthropic SDK?\n\nThe new SDKs send your API key as Authorization: Bearer instead of the X-Api-Key header. A proxy or gateway that reads X-Api-Key finds no key. Change it to read Authorization, or set X-Api-Key yourself on the client, as Anthropic's migration guide shows.\n\nDoes API version 2026-10-21 work on Amazon Bedrock?\n\nOnly for Claude 4.7 and later models. Anthropic's migration guide says calls to older models on Bedrock should stay on the SDK version or API version you use today, or move to a Claude 4.7 or later model first.", "url": "https://wpnews.pro/news/claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade", "canonical_source": "https://munderdiffl.in/blog/claude-api-version-2026-10-21/", "published_at": "2026-10-22 00:00:00+00:00", "updated_at": "2026-10-22 04:13:13.859573+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "developer-tools"], "entities": ["Anthropic", "Claude API", "Claude 4.7", "Claude Sonnet 4.6", "Claude Platform on AWS", "Microsoft Foundry", "Google Cloud", "Amazon Bedrock"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade", "markdown": "https://wpnews.pro/news/claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade.md", "text": "https://wpnews.pro/news/claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade.txt", "jsonld": "https://wpnews.pro/news/claude-api-version-2026-10-21-what-breaks-and-how-to-upgrade.jsonld"}}