Key takeaways
- Anthropic released API version 2026-10-21 on 21 October 2026, the first since 2023-06-01.
- On 2026-10-21, sending temperature, top_p or top_k returns a 400 error on every model, even at the default.
- Python SDK 2.0.0 and TypeScript SDK 1.0.0 send 2026-10-21; earlier majors send 2023-06-01.
- Anthropic lists no end date for 2023-06-01, so you can pin the old SDK major while you fix code.
- The new SDKs send API keys as Authorization: Bearer, so check proxies that read X-Api-Key.
Claude API 2026-10-21 is the first new API version Anthropic has released since 2023-06-01. It arrived on 21 October 2026 with new major versions of the seven official SDKs and the ant CLI, which send it by default.1 You don’t have to move yet. Requests that send anthropic-version: 2023-06-01 keep the old behaviour, and Anthropic hasn’t announced an end date for that version.2 Upgrading the SDK is what moves you, so start by pinning its major version.
Most teams will run into at least one of four changes. On 2026-10-21, a request that sends temperature, top_p or top_k returns a 400 error on every model, even at the default value.3 The new SDKs send the API key as Authorization: Bearer instead of X-Api-Key, which matters if a proxy or gateway reads the key. Each SDK client now accepts a single credential, so passing both a key and a token is an error. And MessageParam is now a union with one type per role, which breaks code that constructs or extends that type. Less often, a request fails because it puts a document block directly in an assistant message, or sends a user text block with citations.
We haven’t run this migration ourselves. Everything here comes from Anthropic’s Claude API migration guide, documentation and SDK repositories as of 26 October 2026. The order we recommend is to pin the SDK, ship the fixes that work under both versions, then upgrade the SDK and test the switch like a model change.
Do you have to move to Claude API 2026-10-21 yet?
You can stay on 2023-06-01 for now. Within an API version, Anthropic keeps existing input and output parameters, though it may add optional inputs, output values and enum variants.2 The versions page lists 2023-06-01 with no end date, and the migration guide names it as one option for requests that depend on a non-default temperature.3 On 21 October, ClaudeDevs, the X account that posts official updates for Claude developers, added that 2023-06-01 is not deprecated.4
The SDK decides which version you send. Each major version of an official SDK sends one API version, and each new API version comes with a new major.5 Python 1.x, TypeScript 0.x and the earlier majors of the other SDKs send 2023-06-01. The majors released on 21 October send 2026-10-21, including their Amazon Bedrock and Google Cloud clients.3 A dependency bump across a major version therefore changes the API version and the SDK’s types in one step.
So far, new SDK features ship only on the new majors. Every Python and TypeScript release since 21 October has been on the new majors, up to Python 2.3.0 and TypeScript 1.3.0 as of 26 October, with message threads among the additions.567 ClaudeDevs also said that Anthropic plans to release API versions more often, so that developers can deal with breaking changes before a new model requires them.4
On Amazon Bedrock, 2026-10-21 covers only Claude 4.7 and later models, and the other platforms on the versions page have no such limit.2 For older models on Bedrock, Anthropic advises keeping your current SDK version, or the version header you already send, until those calls move to Claude 4.7 or later.3
Claude API breaking changes in 2026-10-21
The request changes apply to the Messages API, token counting and each request in a Message Batch created with 2026-10-21, so a batch created under 2023-06-01 keeps the old rules.3 The table covers every API-level change in the migration guide, as of 26 October 2026.
| Change | Under 2023-06-01 | Under 2026-10-21 | What you see | Fix |
|---|---|---|---|---|
temperature, top_p, top_k |
Accepted; non-default values already rejected on Claude 4.7 and later | Removed; any value is rejected on every model | HTTP 400 | Delete them, or keep that request on 2023-06-01 |
A document block directly in an assistant message |
Accepted | Rejected | HTTP 400 | Send documents in user messages; nested documents, such as web fetch results, still work |
A text block with non-empty citations in a user message, directly or inside a search_result block |
Accepted | Rejected | HTTP 400 | Remove citations there; citations on assistant text and the citations setting on documents still work |
Admin API fields roles, group_id, name, group_type and API keys’ workspace_id |
Returned | Removed; use role_ids, rbac_group_id, display_name, group.type and scope |
No error; the field is missing | Read the new names |
Claude Enterprise Analytics API fields actor.email and summaries |
Returned | Removed; use actor.email_address and data |
No error; the field is missing | Read the new names |
A 400 here is the API’s invalid_request_error, raised as BadRequestError in the Python and TypeScript SDKs.8910 The guide doesn’t publish the error messages, so match on status code and error type in your monitoring.
The workspace_id rename also changes meaning. Under 2023-06-01 it is null for keys bound to the Default Workspace and for all-workspaces keys. Under 2026-10-21, the first kind gets the workspace’s real ID in scope.workspace_id, and the second a scope of type organization. Code that read null as the Default Workspace should compare against the ID that List Workspaces returns with include_default=true.3
What changed in Anthropic Python SDK 2.0 and TypeScript SDK 1.0
The new majors also carry breaking changes that don’t depend on the API version.3 These are the ones to check in Python and TypeScript.
- Sampling parameters are gone from the SDKs. TypeScript 1.0 removes
temperature,top_pandtop_kfrom its types. Python dropped them from its method signatures in 1.0.0, on 20 August 2026, and its v1 guide told teams on older models to pass them inextra_body.111 Python 2.0 sends 2026-10-21, so that route now ends in a 400 unless the request stays on 2023-06-01. - The API key travels as
Authorization: Bearer. The Claude API accepts a key in either header, but a proxy, gateway, log filter or test stub that readsX-Api-Keywon’t find it. The Foundry clients still sendX-Api-Key. If a gateway needs the old header, TypeScript can set it indefaultHeaderswithAuthorization: null, and Python can move it back with anauthfunction on the HTTP client.3 - A client holds one credential. Passing two of
api_key,auth_token,credentials,configandprofileraisesValueErrorin Python, and doing the same innew Anthropic()throwsTypeErrorin TypeScript. With none passed, it prefers an API key over an auth token and warns once if it finds both.3 MessageParamis a union ofUserMessageParam,AssistantMessageParamandSystemMessageParam. Messages written as dict or object literals need no change. In Python, calling or subclassingMessageParamraisesTypeError. In TypeScript, an interface can’t extend the union.3betasleft the non-beta Models methods. Send beta headers throughclient.beta.models.- In TypeScript only,
compactionControland the legacy Text Completions API are gone. The Bedrock, Vertex, Foundry, AWS and Google Cloud packages must move to 1.0 in the same upgrade, or the package manager installs a second, older copy of the core SDK for them.3
Anthropic’s guide shows the TypeScript fix for an interface that extended MessageParam.
// Before
interface StoredMessage extends Anthropic.MessageParam {
id: string;
}
// After
type StoredMessage = Anthropic.MessageParam & { id: string };
Python teams still on 0.x take both steps at once, so work through the v1 guide first. Version 1.0 raised the minimum to Python 3.10 and moved the HTTP layer to httpx2, and tracing or mocking tools that patch httpx can silently miss the SDK’s requests until they’re pointed at httpx2.11
Other SDKs, the ant CLI and the Apache 2.0 licence
The other SDKs get the same MessageParam split, credential rules and Authorization header. In C#, Go, Java, PHP and Ruby, single-value enum types also become constants.3 The table lists what else to check, as of 26 October 2026.5
| Tool | First version on 2026-10-21 | Latest on 26 October | Also check |
|---|---|---|---|
| C# | 13.0.0 | 13.3.0 | Role enums removed; a union’s Type becomes an enum; IChatClient adapters ignore Temperature, TopK and TopP without an error |
| Go | 2.0.0 | 2.3.0 | Imports move to the /v2 module path; Go 1.25 or later; vertex.DefaultVersion and bedrock.DefaultVersion removed; Text Completions removed |
| Java | 3.0.0 | 3.3.0 | MessageParam.builder() replaced by ofUser, ofAssistant and ofSystem; more getters return Optional; an interceptor that sets anthropic-version must call replaceHeaders |
| PHP | 1.0.0 | 1.3.0 | Upgrade with composer require, because composer update stays inside your version constraint; role is now the first argument of MessageParam::with() |
| Ruby | 2.0.0 | 2.3.0 | MessageParam.new takes keywords only; compaction_control: and Text Completions removed |
| ant CLI | 2.0.0 | 2.3.0 | --api-key and --auth-token removed; go install needs /v2 in the path, and the old path keeps installing v1 without a warning |
From these versions on, the SDKs and the CLI are licensed under Apache 2.0, while earlier versions stay under the MIT License. No code changes are needed, though Anthropic asks teams that track licences to update their records. The TypeScript and C# platform packages switch in their own 1.0.0 releases, and in Java the change covers every com.anthropic artifact.3 The Python and TypeScript READMEs add that earlier third-party contributions stay under MIT.12
Pin anthropic-version first, then upgrade
Without an SDK, your code sets the anthropic-version header, so keep it in one place. Moving means sending anthropic-version: 2026-10-21 on every request.3
With an SDK, pin the major version first, since it decides the header. Python’s v1 guide installs with pip install --upgrade "anthropic>=1,<2", a range that keeps you on 2023-06-01.11 In TypeScript, keep @anthropic-ai/sdk below 1.0. In Go the import path is the pin, because 2.0.0 lives under a module path ending in /v2.
Only the Python and TypeScript SDK pages document overriding the header itself, and both warn that it can lead to incorrect types or other unexpected behaviour.910 A 2.x or 1.x client’s types follow 2026-10-21, so we’d keep the dependency as the main pin and use the override only for a short list of named calls. Python takes default_headers on the client or extra_headers on a request. Here the override keeps one call to an older model, which still needs a lower temperature, on 2023-06-01.
# Before: SDK 1.x sends 2023-06-01, and the v1 guide's extra_body route works
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
extra_body={"temperature": 0.2},
)
# After: SDK 2.x sends 2026-10-21, which rejects temperature.
# Delete extra_body, or keep this one call on 2023-06-01:
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}],
extra_body={"temperature": 0.2},
extra_headers={"anthropic-version": "2023-06-01"},
)
TypeScript documents the override per request only.
// Before: SDK 0.x sends 2023-06-01 on every request
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Claude" }],
model: "claude-opus-5-5"
});
// After: SDK 1.x sends 2026-10-21 unless a request overrides the header
const pinned = await client.messages.create(
{
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Claude" }],
model: "claude-opus-5-5"
},
{ headers: { "anthropic-version": "2023-06-01" } }
);
The C#, Go, Java, PHP and Ruby pages say each major sends one API version and show no override, so in those languages the dependency is the only documented pin.13 The same goes for the CLI. Its quickstart doesn’t mention the API version, and the migration guide says ant can’t add a header of your own.3
With the pin in place, we’d work in this order.
- While still on 2023-06-01, ship the fixes that work under both versions. Drop sampling parameters from calls to Claude 4.7 and later models, send documents in user messages, and remove citations from user text blocks.
- Make Admin and Analytics API code read the new field names, falling back to the old ones until the switch.
- Upgrade the SDK in a branch and let the type checker find
MessageParam, credential andbetasproblems. - Test as described below, then release the upgrade with its remaining fixes, as Anthropic’s guide recommends.3
The Claude temperature error and what to use instead
After the switch, a request that sends temperature, top_p or top_k gets a 400 whatever the value. Leave them out and the request samples with the defaults, including a temperature of 1.0, as a 2023-06-01 request without them did.3
How much you lose depends on the model. Claude 4.7 and later models already rejected non-default values under earlier API versions, so any working call to them was sending defaults, and removing those changes nothing.14 Models that still accept other values, such as Claude Sonnet 4.6, lose the effect of a lowered temperature. Anthropic says no other setting replaces it. That rules out effort too, which Anthropic describes as the control for thinking depth, latency and cost.315 The guide’s two options are to stop sending the parameter or to keep the request on 2023-06-01. As of 26 October 2026, Claude Sonnet 4.6 is active, with retirement not sooner than 17 February 2027.14
Anthropic recommends prompting in place of sampling parameters, in its parameter deprecation table and in the Claude Opus 5.5 migration guide.1416 Where output must be consistent, its consistency guide suggests these techniques.17
- Structured outputs, where you need guaranteed JSON schema conformance.
- A precisely defined output format in JSON, XML or a template.
- Examples of the output you want.
- Retrieval from a fixed set of information.
- Chained prompts, each covering one subtask.
If you set temperature to 0 for repeatable results, Anthropic notes that it never guaranteed identical outputs on earlier models.16 Repeatability has to come from your own system. Store the outputs you must reproduce, check their structure in code, and run the same inputs several times to see how much answers vary. Our post on measuring model drift shows how to put error bars on that variation.
If a framework or wrapper sits between your code and the API, log one outgoing request body to see whether it sets any of the three for you.
Testing the switch before you release it
Test the switch as you would a model upgrade. Run a frozen set of production requests through the old SDK on 2023-06-01 and the new SDK on 2026-10-21, and compare the results item by item. Our one-week routine for model upgrades covers building that set and setting pass rules. Add these checks for this migration.
- Calls that used to lower temperature. On models before Claude 4.7 their outputs will change, so run those items several times on each version and compare the spread as well as the pass rate.
- Every 400 in staging. Group them by endpoint and error type. A new 400 after the switch points to a leftover sampling parameter, a document in an assistant turn or a citation in a user turn.
- The version each client sends. TypeScript’s
debuglog level logs request headers, andant --debugprints the request log.103 The TypeScript log includes bodies too, so keep it to staging. Check every service, Bedrock and Google Cloud clients included. - The real gateway. Send staging traffic through the same proxy configuration as production, since the key now travels in
Authorization. - Admin and analytics jobs. Run them once against 2026-10-21 and check the renamed fields.
- Rollback. Keep the previous lockfile so that rolling back is a dependency revert. Batches created before the switch keep the 2023-06-01 rules, so they don’t need draining first.
A Claude API migration checklist
- List each service that calls Claude, with its SDK and major version, or the header value it sends.
- Pin the SDK major in every lockfile, and pin the
antCLI. - Find
temperature,top_pandtop_kin code, configuration and framework settings, and remove them now from calls to Claude 4.7 and later models. - For older models that use a non-default value, test without it, or keep those calls on 2023-06-01 with the documented header override.
- Move
documentblocks out of assistant messages, and removecitationsfrom user text blocks. - Read the new Admin and Analytics API field names, falling back to the old ones until the switch.
- On Bedrock, leave calls to models older than Claude 4.7 on the current SDK until they move to a newer model.
- Upgrade the SDK in a branch, with TypeScript’s platform packages, Go’s
/v2imports and PHP’scomposer require. - Fix
MessageParamtype errors, pass one credential per client, and point proxies, log filters and test stubs atAuthorization. - Run the regression set on both versions, review every 400 in staging and confirm the version each client sends.
- Update your dependency licence records from MIT to Apache 2.0.
- Release the upgrade with its fixes, and keep the old lockfile for rollback.
-
Anthropic, “Claude Platform release notes”, entries for 20 August and 21 October 2026, https://platform.claude.com/docs/en/release-notes/overview ↩↩
-
Anthropic, “Versions”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/api/versioning ↩↩↩
-
Anthropic, “Migrating to API version 2026-10-21”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/api/migration-2026-10-21 ↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩
-
ClaudeDevs, post on X, 21 October 2026, https://x.com/ClaudeDevs/status/2113013247209021918 ↩↩
-
Anthropic, “SDKs, CLI, and libraries”, Claude Platform Docs, latest versions table, read 26 October 2026, https://platform.claude.com/docs/en/cli-sdks-libraries/overview ↩↩↩
-
Anthropic, anthropic-sdk-python changelog, versions 1.0.0 to 2.3.0, https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md ↩
-
Anthropic, anthropic-sdk-typescript changelog, versions 0.137.0 to 1.3.0, https://github.com/anthropics/anthropic-sdk-typescript/blob/main/CHANGELOG.md ↩
-
Anthropic, “Claude API errors”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/api/errors ↩
-
Anthropic, “Python SDK”, Claude Platform Docs, sections “Handling errors” and “Default headers”, read 26 October 2026, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/python ↩↩
-
Anthropic, “TypeScript SDK”, Claude Platform Docs, sections “Handling errors”, “Default headers” and “Logging”, read 26 October 2026, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/typescript ↩↩↩
-
Anthropic, “Migration guide” for version 1 of the Python SDK, anthropic-sdk-python repository, read 26 October 2026, https://github.com/anthropics/anthropic-sdk-python/blob/main/MIGRATION.md ↩↩↩
-
Anthropic, README licence sections of anthropic-sdk-python and anthropic-sdk-typescript, read 26 October 2026, https://github.com/anthropics/anthropic-sdk-python and https://github.com/anthropics/anthropic-sdk-typescript ↩
-
Anthropic, C#, Go, Java, PHP and Ruby SDK pages, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/csharp, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/go, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/java, https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/php and https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/ruby ↩
-
Anthropic, “Model deprecations”, including the API parameter deprecations table, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/about-claude/model-deprecations ↩↩↩
-
Anthropic, “What’s new in Claude Opus 5.5”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5 ↩
-
Anthropic, “Claude Opus 5.5 migration guide”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/models/opus-5-5/migration-guide ↩↩
-
Anthropic, “Increase output consistency”, Claude Platform Docs, read 26 October 2026, https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/increase-consistency ↩
Frequently asked questions
What changed in Claude API version 2026-10-21?
Requests that send temperature, top_p or top_k return a 400 error on every model, even at default values, and so do document blocks placed directly in assistant messages and user text blocks that carry citations. Admin API and Claude Enterprise Analytics API responses drop the old names of renamed fields. The new SDK majors also change how API keys and credentials are sent.
Does anthropic-version 2023-06-01 still work?
Yes. As of 26 October 2026, Anthropic’s versions page lists 2023-06-01 with no end date, and its migration guide offers it as an option for requests that need a non-default temperature. The ClaudeDevs account on X said on 21 October that 2023-06-01 is not deprecated.
Why does the Claude API return a 400 error for temperature?
Under API version 2026-10-21, temperature, top_p and top_k are removed, and sending any of them returns a 400 error, even at the default value. Under 2023-06-01, Claude 4.7 and later models already rejected non-default values. Remove the parameter, or keep the request on 2023-06-01 if an older model needs a lower temperature.
How do I pin the anthropic-version header in the Python SDK?
Pin the major version first, since Python SDK 1.x sends 2023-06-01 and 2.x sends 2026-10-21. To override the header itself, Anthropic documents default_headers on the client and extra_headers on a single request, with a warning that overriding default headers can cause incorrect types or undefined behaviour.
Is the Anthropic SDK now Apache 2.0?
Yes, from the versions that send 2026-10-21: Python 2.0.0, TypeScript 1.0.0, C# 13.0.0, Go 2.0.0, Java 3.0.0, PHP 1.0.0, Ruby 2.0.0 and ant CLI 2.0.0. Earlier versions stay under the MIT License, and Anthropic says no code changes are needed.
What breaks when upgrading to the Anthropic TypeScript SDK 1.0?
It sends API version 2026-10-21 and drops temperature, top_p and top_k from its types. It sends API keys as Authorization: Bearer, allows one credential per client and splits MessageParam into one type per role. compactionControl and Text Completions are gone, and the Bedrock, Vertex, Foundry, AWS and Google Cloud packages must move to 1.0 at the same time.
Building something like this?
9io is a small team of senior engineers with a fractional CTO. We work by the hour, and plans start at $5,000. Send us a note about your product. The reply comes from the person who'd do the work.