Source · docs

Migrating to API version 2026-10-21 (Claude API docs)

Author
Anthropic
Published
21 October 2026
Added
22 October 2026
Original
https://platform.claude.com/docs/en/api/migration-2026-10-21

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, or ant CLI 2.0.0. Without an SDK, send anthropic-version: 2026-10-21. In Claude Code, /claude-api api-version does the code changes (2.1.307).
  • Sampling parameters removed: temperature, top_p, and top_k return 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 on 2023-06-01 for those requests.
  • Messages API: a document block directly in an assistant message, and a text block with non-empty citations in a user message, now return 400.
  • Admin and Analytics APIs: old names are gone, for example roles is now role_ids, group_id is rbac_group_id, name is display_name, actor.email is actor.email_address, and summaries is data. API keys lose workspace_id; read scope.workspace_id instead (an all-workspaces key has scope: {"type": "organization"}).
  • SDK breaking changes: keys are now sent as Authorization: Bearer <key> instead of X-Api-Key, so proxies and gateways that read X-Api-Key must change (the API accepts both). A client holds only one credential, with a fixed precedence (ANTHROPIC_API_KEY first, then ANTHROPIC_AUTH_TOKEN, then profiles). MessageParam is 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-key and --auth-token flags are removed; use the environment, --api-key-stdin, or ant 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_status and enforcement_actions fields, with an enforcement_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.