On 2026-10-21, Anthropic released the official API version 2026-10-21. According to the official Claude Developers post (about 76K impressions, 1,400+ likes), this is the first official release since 2023-06-01; older versions are not deprecated as a result.
For anyone writing Messages requests, using the Anthropic SDK, or calling a Claude-compatible endpoint from Claude Code / Cursor / an AI agent, the most direct impact comes down to three things:
- The new major SDKs and the
antCLI default to sendinganthropic-version: 2026-10-21. - If a Messages request still includes
temperature,top_p, ortop_k, the API returns a 400. - Claude Code ships a built-in skill:
/claude-api(along withupgrade,migrateand other subcommands) that updates code for your project's language.
The official migration steps and the list of breaking changes are in Migrating to API version 2026-10-21; the release notes are at Release notes · October 21, 2026.
Create an API Key → View Claude pricing →
What changed in this version
How to pick a version
The official migration guide states:
If you use an SDK, your requests use the API version that was current when your SDK's major version was released. … If you call the API without an SDK, set theanthropic-versionheader to2026-10-21.
The first major versions to default to sending 2026-10-21 include: Python SDK 2.0.0, TypeScript SDK 1.0.0, C# 13.0.0, Go 2.0.0, Java 3.0.0, PHP 1.0.0, Ruby 2.0.0, and the ant CLI 2.0.0 (see Release notes).
Older SDKs can keep using 2023-06-01. The official post also says:2023-06-01 is not deprecated.
Messages: sampling parameters removed
Official text:
In2026-10-21, a request that sendstemperature,top_p, ortop_kreturns a 400 error, even at the parameter's default value. Remove the three parameters from your requests.
When these parameters are omitted, sampling uses default values (including temperature at 1.0), matching older versions when you didn't send them. If your workload must rely on non-default sampling values, the official advice is to either stop sending the parameter or keep that request on 2023-06-01.
Two other Messages breaking changes belong in the same review:
- In an assistant message, putting a
documentblock directly returns a 400; documents should go inusermessages. - In a user message, a
textblock with a non-emptycitationsreturns a 400; citations passed back in assistant replies are still accepted.
Auth header: new SDKs default to Bearer
Official text:
The SDK and the CLI send your API key asAuthorization: Bearer <key>instead of in theX-Api-Keyheader … The Claude API accepts a key in either header.
If your proxy, gateway, or in-house middleware still reads only X-Api-Key, then after you upgrade to a new major SDK it needs to read Authorization, or, following the official example, switch the client back to sending the key as X-Api-Key. The Claude API itself accepts either header.
Upgrade steps
1. Swap the SDK / set the version header
With an SDK: upgrade to the matching major version from the table above, and it sends 2026-10-21 by default.
Without an SDK, calling HTTP directly:
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-haiku-5-5",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Hello"}]
}'
The example above comes from the cURL section of the official migration guide (swap in the model ID you actually use). If your old code must stay on the old behavior, keep the anthropic-version header at 2023-06-01, and hold off on upgrading to those major SDK versions for now.
2. Claude Code: use /claude-api to migrate via the skill
claude-api skill ships with Claude Code and can also be installed from the Anthropic skills repository. In Claude Code, just type:
/claude-api
To upgrade for a specific language, you can specify it, for example:
/claude-api upgrade python
For a model migration:
/claude-api migrate this project to the latest Claude Opus model
The official docs say the skill handles model IDs, breaking parameters (including removal of temperature / top_p / top_k), beta header cleanup, and more. After it makes changes, it gives you a list of items to check by hand.
Write this site's Claude-compatible endpoint into your global personal settings, not the project directory. macOS / Linux:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.aicodewith.ai",
"ANTHROPIC_AUTH_TOKEN": "你的 AICodeWith Key",
"ANTHROPIC_API_KEY": ""
}
}
The path is ~/.claude/settings.json.ANTHROPIC_BASE_URL Do not include /v1; Claude Code builds the Messages path on its own. For fuller third-party setup instructions, see “How Claude Code Connects to Third-Party APIs”.
3. Manual checklist (if you don't have Claude Code)
Following the official Breaking changes, go through your request-building code item by item:
- From Messages / Message Batches request bodies, remove
temperature,top_p,top_k. - In
assistantmessages, don't put adocumentblock directly; put it inusermessages. - In
usermessages,textblocks must not carry a non-emptycitations. - If you read Admin / Enterprise Analytics fields, switch to the new field names per the table in the migration guide (for example, an API key's
workspace_id→scope). - After upgrading the SDK, check whether your proxy still accepts only
X-Api-Key. If it doesn't, switch to reading Bearer, or follow the official example and write the key back toX-Api-Key.
4. Configure your key on this site
This site provides a Claude-compatible, Anthropic-format endpoint. The global config example is the same as in the previous section:ANTHROPIC_BASE_URL=https://api.aicodewith.ai, and put your key in ANTHROPIC_AUTH_TOKEN.
When testing directly over HTTP, both auth headers work on this site (see the test results below):
export ANTHROPIC_BASE_URL=https://api.aicodewith.ai
export ANTHROPIC_AUTH_TOKEN='你的 Key'
curl "$ANTHROPIC_BASE_URL/v1/messages" \
-H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
-H "anthropic-version: 2026-10-21" \
-H "content-type: application/json" \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Reply with exactly: OK"}]
}'
Model IDs are as shown in the console and in the model price list (which are the source of truth). For troubleshooting, see “Troubleshooting Claude Haiku 5.5 API Errors” and “Why Claude Code Responds Slowly, and gzip”.
Create an API Key → Open pricing / top up →
5. Verify: send one request before and one after upgrading, then deliberately include temperature
The official requirement: before release, run integration tests against 2026-10-21. Suggested order:
- Old version header
anthropic-version: 2023-06-01, no sampling parameters → should succeed. - New version header
anthropic-version: 2026-10-21, no sampling parameters → should succeed. - New version header +
"temperature": 0.2→ per the official docs, this should return a 400.
The official description of step 3 is:
a request that sendstemperature,top_p, ortop_kreturns a 400 error, even at the parameter's default value.
Record only the HTTP status, the original error text, and the latency. Don't write the cost of a single request into your notes or any external docs.
Side-by-Side Tests on Our Platform
Test setup: an isolated environment, with requests sent to this site at https://api.aicodewith.ai/v1/messages, where we first probed with claude-haiku-5-5 to scout, then used the model that officially still allows non-default sampling, claude-sonnet-4-6, for three comparisons. Authentication used this site's test key (x-api-key and Authorization: Bearer each ran successfully). Afterward, I deleted the configs and session logs that contained the key.
| Comparison | Request | Result on this site | Latency |
|---|---|---|---|
| ① Normal value | anthropic-version: 2026-10-21, without temperature; claude-sonnet-4-6 | HTTP 200, model=claude-sonnet-4-6, reply OK | about 1.4 s |
| ② Old version / version removed | 2023-06-01 or omitted anthropic-version, without temperature | HTTP 200, same as above | about 1.1–1.4 s |
| ③ Invalid value | 2026-10-21 + "temperature": 0.2 (Sonnet 4.6) | HTTP 200, still replies OK (not the 400 the official docs describe) | about 1.3 s |
Also: claude-haiku-5-5 on 2026-10-21 / 2023-06-01, with or without temperature, and with Bearer / x-api-key auth, all returned HTTP 200. The model id returned by the first successful conversation was claude-haiku-5-5.
Conclusion: In the three comparisons, requests with temperature still returned 200 on this site, which doesn't match the official "should return 400" behavior. So this article does not claim that this site's relay already rejects sampling parameters per 2026-10-21. For official behavior, follow the migration guide. What we can confirm on our side is that you can send Messages successfully with this site's key and the Claude-compatible endpoint. When you upgrade your code, you should still remove the three sampling parameters per the official list, so nothing suddenly breaks if you later connect directly to Anthropic or the gateway policy tightens.
Claude Tiers and Top-Up on This Site
The public model API (/api/models) currently shows these Claude-related tiers (unit: USD per million tokens; the live page is authoritative):
| Model | modelId | Input | Output |
|---|---|---|---|
| Claude Haiku 5.5 | claude-haiku-5-5 | 0.10 | 0.50 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | 2 | 10 |
| Claude Opus 5.5 | claude-opus-5-5 | 4 | 20 |
| Claude Sonnet 5 | claude-sonnet-5 | 2 | 10 |
| Claude Opus 5 | claude-opus-5 | 5 | 25 |
| Claude Fable 5.1 | claude-fable-5-1 | 10 | 50 |
Top up and pick a model: Pricing page. Sign up and create a key: Log in / Sign up. For step-by-step instructions on connecting Claude Code, see Third-Party API Tutorial.
FAQ
Does an old project have to upgrade to 2026-10-21 right away?
No. The official docs state clearly that 2023-06-01 is not deprecated. You can first run regression tests on a branch with the new SDK / new version header, confirm the three sampling parameters are gone and the document / citations layout follows the new rules, then merge.
What happens if I upgrade only the SDK and don't change the request body?
The new major SDK sends 2026-10-21 by default. If the request body still contains temperature / top_p / top_k, the official docs say it returns a 400. Remove the parameters first, or temporarily pin the old SDK major.
In Claude Code, what's the difference between /claude-api and editing by hand?
/claude-api loads skill docs based on the project language and can batch-update model IDs, sampling parameters, and some beta headers. Manual edits suit repos with a very small request surface, or where CI only changes a few constructors. Either way, verify the result against the official Breaking changes list.
Should I use Bearer or x-api-key with this site's key?
The recommended setup for connecting Claude Code to this site is ANTHROPIC_AUTH_TOKEN (Bearer). For direct HTTP, both Bearer and x-api-key tested working on this site. If there's an older proxy in between that only recognizes X-Api-Key, follow the official "If a proxy or gateway reads X-Api-Key" section to change the client or the proxy.
With temperature removed, how do I keep output stable?
Per the official docs, there's no replacement sampling parameter. If a model already accepts only default sampling (such as the newer Claude 4.7+ series), its behavior matches what you got before the upgrade when you passed no non-default values. If you used to lower temperature for stability, switch to prompt constraints, structured output, or a different model strategy instead of continuing to pass sampling fields.
Related reading
- How to Connect Claude Code to a Third-Party API
- Troubleshooting Claude Haiku 5.5 API Errors
- Claude Code Slow Responses and gzip
- Pricing / Top-Up



