Source · docs
Migrating to API version 2026-10-21 (Claude API docs)
Summary
On 2026-10-21 Anthropic released Claude API version 2026-10-21, the first new
anthropic-version since 2023-06-01, along with new major versions of every client
SDK and the ant CLI that send it by default. The version removes the sampling
parameters and a few rarely used message shapes, and drops old field names in the Admin
and Analytics APIs. The SDKs also change how they send API keys and switch from the MIT
licence to Apache 2.0. Details are from the migration guide, the versioning page, and
the platform release notes (all read 2026-10-22).
Key points
- How to switch: upgrade to Python SDK 2.0.0, TypeScript 1.0.0, Go 2.0.0 (module path
github.com/anthropics/anthropic-sdk-go/v2, Go 1.25+), Java 3.0.0, C# 13.0.0, PHP 1.0.0, Ruby 2.0.0, orantCLI 2.0.0. Without an SDK, sendanthropic-version: 2026-10-21. In Claude Code,/claude-api api-versiondoes the code changes (2.1.307). - Sampling parameters removed:
temperature,top_p, andtop_kreturn a 400 error on every model, even at their default values. Requests sample at the defaults (temperature 1.0). Claude 4.7 and later already accepted only the defaults, so nothing changes there. On older models such as Sonnet 4.6, code that lowered the temperature loses that effect. To keep it, stay on2023-06-01for those requests. - Messages API: a
documentblock directly in anassistantmessage, and atextblock with non-emptycitationsin ausermessage, now return 400. - Admin and Analytics APIs: old names are gone, for example
rolesis nowrole_ids,group_idisrbac_group_id,nameisdisplay_name,actor.emailisactor.email_address, andsummariesisdata. API keys loseworkspace_id; readscope.workspace_idinstead (an all-workspaces key hasscope: {"type": "organization"}). - SDK breaking changes: keys are now sent as
Authorization: Bearer <key>instead ofX-Api-Key, so proxies and gateways that readX-Api-Keymust change (the API accepts both). A client holds only one credential, with a fixed precedence (ANTHROPIC_API_KEYfirst, thenANTHROPIC_AUTH_TOKEN, then profiles).MessageParamis split into per-role types. The legacy Text Completions API is removed from the TypeScript, Go, Java, Ruby SDKs and the CLI. Client-side compaction is removed from the tool runner (TypeScript, Ruby) in favour of server-side compaction. - CLI:
--api-keyand--auth-tokenflags are removed; use the environment,--api-key-stdin, orant auth login. - Platforms: available on the Claude API, Claude Platform on AWS, Microsoft Foundry, and Google Cloud. On Amazon Bedrock only for Claude 4.7 and later models.
- Licence: the new SDK and CLI versions are Apache 2.0; earlier versions stay MIT.
- No retirement date for
2023-06-01: the versioning page lists it without any deprecation notice (checked 2026-10-22). - Same day: user profiles gained
enforcement_statusandenforcement_actionsfields, with anenforcement_status[]list filter, so platforms can see which of their end customers Anthropic has restricted or banned.
Why it matters
Any code that still sets temperature will break as soon as its SDK is upgraded, so
pin the old major version or remove the parameter first. Gateways and logging proxies
that read X-Api-Key are the other common breakage. The licence change matters for
dependency audits.