From 56de3f135196ebd4645c537db236c2b94359a81d Mon Sep 17 00:00:00 2001 From: Yaowei Zheng Date: Fri, 9 Oct 2026 12:50:39 -0700 Subject: [PATCH 1/2] feat(anthropic_official): support Claude Haiku 5.5 anthropic-official serves claude-haiku-5-5: thinking_level NONE sends adaptive thinking at low effort, and forced tool_choice and fast_mode raise UnsupportedParameterError. The registry lists claude-haiku-5-5 and OpenRouter's anthropic/claude-haiku-5.5, cache reads on Sonnet 5.5 drop to $0.10, and the e2e tests also run claude-haiku-5-5. Co-Authored-By: Claude Opus 5.5 --- .../unreleased/2026-10-09-claude-haiku-5-5.md | 17 + .../2026-10-09-claude-haiku-5-5.zh.md | 17 + changelog/unreleased/README.md | 1 + changelog/unreleased/README.zh.md | 1 + llmsdk_docs/README.md | 2 +- llmsdk_docs/claude5_5/README.md | 8 +- .../docs/migration-guide-haiku-5-5.md | 158 ++++++ .../docs/migration-guide-opus-5-5.md | 28 +- .../docs/migration-guide-sonnet-5-5.md | 14 +- llmsdk_docs/claude5_5/docs/models-overview.md | 56 +- .../claude5_5/docs/overview-haiku-5-5.md | 140 +++++ .../claude5_5/docs/overview-opus-5-5.md | 16 +- .../claude5_5/docs/overview-sonnet-5-5.md | 20 +- llmsdk_docs/claude5_5/docs/pricing.md | 536 ++++++++++++++++++ .../claude5_5/docs/whats-new-haiku-5-5.md | 61 ++ site/src/docs/configuration.en.md | 4 +- site/src/docs/configuration.zh.md | 4 +- site/src/docs/models.en.md | 2 +- site/src/docs/models.zh.md | 2 +- skills/mmsp-python/reference/data-models.md | 2 +- skills/mmsp-python/reference/models.md | 2 +- .../mmsp-typescript/reference/data-models.md | 2 +- skills/mmsp-typescript/reference/models.md | 2 +- src_py/mmsp/anthropic_official/client.py | 18 +- src_py/mmsp/registry.py | 23 +- src_py/tests/test_client.py | 1 + src_py/tests/test_thinking_level_mapping.py | 8 +- src_ts/src/anthropic_official/client.ts | 21 +- src_ts/src/registry.ts | 23 +- src_ts/tests/client.test.ts | 9 + src_ts/tests/thinking-level-mapping.test.ts | 13 +- 31 files changed, 1112 insertions(+), 99 deletions(-) create mode 100644 changelog/unreleased/2026-10-09-claude-haiku-5-5.md create mode 100644 changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md create mode 100644 llmsdk_docs/claude5_5/docs/migration-guide-haiku-5-5.md create mode 100644 llmsdk_docs/claude5_5/docs/overview-haiku-5-5.md create mode 100644 llmsdk_docs/claude5_5/docs/pricing.md create mode 100644 llmsdk_docs/claude5_5/docs/whats-new-haiku-5-5.md diff --git a/changelog/unreleased/2026-10-09-claude-haiku-5-5.md b/changelog/unreleased/2026-10-09-claude-haiku-5-5.md new file mode 100644 index 00000000..c4feb2a5 --- /dev/null +++ b/changelog/unreleased/2026-10-09-claude-haiku-5-5.md @@ -0,0 +1,17 @@ +# Support Claude Haiku 5.5 + +- **Date:** 2026-10-09 +- **Type:** feature +- **Scope:** `anthropic_official`, `registry` + +[中文版](2026-10-09-claude-haiku-5-5.zh.md) + +## What changed + +- `anthropic-official` serves `claude-haiku-5-5`, matched by version on every platform, Bedrock's `anthropic.` prefix included: + - `thinking_level="none"` sends adaptive thinking at `low` effort, as on Opus 5.5 and Fable 5.1, and the other levels send the effort of the same name. + - `tool_choice="required"` and a list of tool names raise `UnsupportedParameterError`, as on Opus 5.5 and Sonnet 5.5. + - `fast_mode` raises `UnsupportedParameterError`. +- `list_supported_models` lists `claude-haiku-5-5` at $0.10 / $0.50 per million tokens with cache reads at $0.01, the price for prompts up to 100K tokens (every rate is 5x above it), and OpenRouter's `anthropic/claude-haiku-5.5` at the same prices. Cache reads on `claude-sonnet-5-5` and `anthropic/claude-sonnet-5.5` drop to $0.10. +- The end-to-end tests also run `claude-haiku-5-5`. +- `llmsdk_docs/claude5_5/` adds the Haiku 5.5 pages and Anthropic's pricing page. The site and the skills list the new model. diff --git a/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md b/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md new file mode 100644 index 00000000..020fef9d --- /dev/null +++ b/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md @@ -0,0 +1,17 @@ +# 支持 Claude Haiku 5.5 + +- **Date:** 2026-10-09 +- **Type:** feature +- **Scope:** `anthropic_official`, `registry` + +[English](2026-10-09-claude-haiku-5-5.md) + +## 变更内容 + +- `anthropic-official` 支持 `claude-haiku-5-5`,在各平台按版本匹配,包括带 `anthropic.` 前缀的 Bedrock id: + - `thinking_level="none"` 发送 `low` 档位的自适应思考,与 Opus 5.5 和 Fable 5.1 相同;其余档位发送同名的思考档位。 + - `tool_choice="required"` 和工具名列表抛出 `UnsupportedParameterError`,与 Opus 5.5 和 Sonnet 5.5 相同。 + - `fast_mode` 抛出 `UnsupportedParameterError`。 +- `list_supported_models` 列出 `claude-haiku-5-5`,每百万 token 输入 0.10 美元、输出 0.50 美元,缓存读取 0.01 美元,这是提示不超过 100K token 时的价格(超过后每项价格均为 5 倍);OpenRouter 上的 `anthropic/claude-haiku-5.5` 价格相同。`claude-sonnet-5-5` 和 `anthropic/claude-sonnet-5.5` 的缓存读取降到 0.10 美元。 +- 端到端测试新增 `claude-haiku-5-5`。 +- `llmsdk_docs/claude5_5/` 新增 Haiku 5.5 的页面和 Anthropic 的价格页面。站点和 skill 列出了新模型。 diff --git a/changelog/unreleased/README.md b/changelog/unreleased/README.md index 38399c57..d8c6e9ef 100644 --- a/changelog/unreleased/README.md +++ b/changelog/unreleased/README.md @@ -2,5 +2,6 @@ [中文版](README.zh.md) +- [2026-10-09] Support Claude Haiku 5.5: `anthropic-official` serves `claude-haiku-5-5` and `list_supported_models` lists it with OpenRouter's `anthropic/claude-haiku-5.5`; cache reads on Claude Sonnet 5.5 drop to $0.10. ([details](2026-10-09-claude-haiku-5-5.md)) - [2026-10-09] The official Gemini client is `google-official` (alias `gemini-official`), named after its vendor like the other official clients; its class is `GoogleOfficialClient`. ([details](2026-10-09-google-official.md), [#248](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/248)) - [2026-10-02] An MMSP server serves the models of a table over HTTP as MMSP streams (`python -m mmsp.integration.server --config FILE`, `npm run server -- --config FILE`); the playground's `/server/` page saves a table to a config file, starts one from it and draws its metrics over the last 60 days, and the `mmsp` client calls it; an error the server reports comes back as the new `UpstreamError`. ([details](2026-10-02-mmsp-server.md), [#247](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/247)) diff --git a/changelog/unreleased/README.zh.md b/changelog/unreleased/README.zh.md index 57e32985..607ffdaf 100644 --- a/changelog/unreleased/README.zh.md +++ b/changelog/unreleased/README.zh.md @@ -2,5 +2,6 @@ [English](README.md) +- [2026-10-09] 支持 Claude Haiku 5.5:`anthropic-official` 支持 `claude-haiku-5-5`,`list_supported_models` 列出它和 OpenRouter 上的 `anthropic/claude-haiku-5.5`;Claude Sonnet 5.5 的缓存读取降到 0.10 美元。([详情](2026-10-09-claude-haiku-5-5.zh.md)) - [2026-10-09] Gemini 官方客户端改名为 `google-official`(别名 `gemini-official`),与其他官方客户端一样以厂商命名;类名改为 `GoogleOfficialClient`。([详情](2026-10-09-google-official.zh.md), [#248](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/248)) - [2026-10-02] 新增 MMSP 服务端,通过 HTTP 把一张表里的模型提供为 MMSP 流(`python -m mmsp.integration.server --config FILE`、`npm run server -- --config FILE`);Playground 的 `/server/` 页面把表保存到配置文件,据此启动服务端并画出其最近 60 天的指标;新增调用它的 `mmsp` 客户端;服务端报告的错误以新增的 `UpstreamError` 抛出。([详情](2026-10-02-mmsp-server.zh.md), [#247](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/247)) diff --git a/llmsdk_docs/README.md b/llmsdk_docs/README.md index 9d22f054..6aeb1a59 100644 --- a/llmsdk_docs/README.md +++ b/llmsdk_docs/README.md @@ -8,7 +8,7 @@ To use a specific model, please refer to its dedicated README: - **[Anthropic Messages protocol](./ant_messages/README.md)** - The Anthropic Messages-compatible protocol across Anthropic, OpenRouter, DeepSeek, Z.AI, and MiniMax (generic `ant_messages` client) - **[Claude 5.1](./claude5_1/README.md)** - Anthropic's Claude Fable 5.1: always-on thinking, no forced tool choice, history-bound thinking blocks -- **[Claude 5.5](./claude5_5/README.md)** - Anthropic's Claude Opus 5.5 and Sonnet 5.5: always-on thinking on Opus, `between_tools` on Sonnet, no forced tool choice +- **[Claude 5.5](./claude5_5/README.md)** - Anthropic's Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5: always-on thinking on Opus, `between_tools` on Sonnet, adaptive thinking and long context pricing on Haiku - **[Claude 4.6](./claude4_6/README.md)** - Anthropic's Claude 4.6 API documentation and examples - **[Claude 4.7](./claude4_7/README.md)** - Anthropic's Claude 4.7 API documentation and examples - **[Claude 4.8](./claude4_8/README.md)** - Anthropic's Claude 4.8 API documentation and examples diff --git a/llmsdk_docs/claude5_5/README.md b/llmsdk_docs/claude5_5/README.md index 2b12a95c..88168d65 100644 --- a/llmsdk_docs/claude5_5/README.md +++ b/llmsdk_docs/claude5_5/README.md @@ -1,11 +1,15 @@ # Claude 5.5 SDK Documentation -Snapshot of Anthropic's documentation for Claude Opus 5.5 (`claude-opus-5-5`) and Claude Sonnet 5.5 (`claude-sonnet-5-5`), retrieved 2026-09-30 from platform.claude.com. +Snapshot of Anthropic's documentation for Claude Opus 5.5 (`claude-opus-5-5`), Claude Sonnet 5.5 (`claude-sonnet-5-5`) and Claude Haiku 5.5 (`claude-haiku-5-5`), retrieved 2026-10-09 from platform.claude.com. ## Documentation - [models-overview.md](./docs/models-overview.md) - The current lineup: ids per platform, pricing, thinking modes, default effort +- [pricing.md](./docs/pricing.md) - Model pricing, including Haiku 5.5's long context pricing (prompts over 100,000 tokens pay higher prices) - [overview-opus-5-5.md](./docs/overview-opus-5-5.md) - Claude Opus 5.5 model page - [migration-guide-opus-5-5.md](./docs/migration-guide-opus-5-5.md) - Migrating to Opus 5.5: thinking always on, `medium` default effort, forced `tool_choice` returns 400, no sampling parameters, thinking text omitted by default - [overview-sonnet-5-5.md](./docs/overview-sonnet-5-5.md) - Claude Sonnet 5.5 model page -- [migration-guide-sonnet-5-5.md](./docs/migration-guide-sonnet-5-5.md) - Migrating to Sonnet 5.5: `thinking: {type: "between_tools"}` replaces `disabled` and is accepted only at `high` effort or below, forced `tool_choice` returns 400 +- [migration-guide-sonnet-5-5.md](./docs/migration-guide-sonnet-5-5.md) - Migrating to Sonnet 5.5: `thinking: {type: "between_tools"}` replaces `disabled` and is accepted only at `high` effort or below, forced `tool_choice` returns 400, cache reads at $0.10 / MTok +- [overview-haiku-5-5.md](./docs/overview-haiku-5-5.md) - Claude Haiku 5.5 model page +- [whats-new-haiku-5-5.md](./docs/whats-new-haiku-5-5.md) - What changed from Haiku 4.5: adaptive thinking on by default, `disabled` accepted at `high` effort or below, 1M context, 128K output +- [migration-guide-haiku-5-5.md](./docs/migration-guide-haiku-5-5.md) - Migrating to Haiku 5.5: `budget_tokens` returns 400, sampling parameters restricted, no prefill, forced `tool_choice` accepted without thinking diff --git a/llmsdk_docs/claude5_5/docs/migration-guide-haiku-5-5.md b/llmsdk_docs/claude5_5/docs/migration-guide-haiku-5-5.md new file mode 100644 index 00000000..693d240a --- /dev/null +++ b/llmsdk_docs/claude5_5/docs/migration-guide-haiku-5-5.md @@ -0,0 +1,158 @@ +--- +title: Claude Haiku 5.5 migration guide +url: https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide +description: Switch to Claude Haiku 5.5 from earlier Haiku models with this migration guide. The guidance to enable Claude Haiku 5.5 includes the new model ID, settings that return errors, thinking changes, and a checklist for each starting model. +--- + + + This guide covers migrating [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) code. If you use [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview), no changes beyond updating the model name are required. + + + + **Automate your migration with the Claude API skill.** In Claude Code, run `/claude-api migrate` to invoke the bundled [Claude API skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/claude-api-skill#migrating-to-a-newer-claude-model). It works for any current Claude model as the target: + + ```text wrap + /claude-api migrate this project to claude-haiku-5-5 + ``` + + The skill applies the model ID swap and, as needed, breaking parameter changes, prefill replacement, and effort calibration for your target model across your code base, then produces a checklist of items to verify manually. It asks you to confirm the migration scope (entire working directory, a subdirectory, or a specific file list) before editing any files. The skill also detects Amazon Bedrock and Claude Platform on AWS clients and adjusts model ID formats and feature changes for those platforms. + + +This guide covers moving code that calls Claude Haiku 4.5 to Claude Haiku 5.5. For code that calls Claude Haiku 3.5 or Claude Haiku 3, also make the changes in [Migrating to Claude Haiku 5.5 from Claude Haiku 3.5 and earlier Haiku models](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#migrating-from-haiku-35). To move up to a Sonnet or Opus model instead, see [Upgrade between model versions](https://platform.claude.com/docs/en/about-claude/models/migration-guide). For how long Claude Haiku 4.5 stays available, see [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations). + +## Migration checklist by starting model + +Work down the groups and stop after the one that names your current model. If you are on Claude Haiku 4.5, the first group is the whole list. Each item is one change to make in your code. + +### Every starting model + +1. Replace the model ID with the Claude Haiku 5.5 ID for your platform. See [Use the Claude Haiku 5.5 model ID](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#use-the-claude-haiku-5-5-model-id). +2. Recount your prompts, and revisit `max_tokens` limits and cost estimates, because the same text counts as more tokens and large images count as more visual tokens. See [Recount tokens](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#recount-tokens). +3. If your requests send `thinking: {"type": "enabled", "budget_tokens": N}`, change `thinking` to `{"type": "adaptive"}`. See [Configure thinking](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking). +4. If your code reads the first content block as the answer, select blocks by `type` instead. See [Configure thinking](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking). +5. Remove `temperature`, `top_p`, and `top_k` from your requests. See [Remove sampling parameters](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#remove-sampling-parameters). +6. If your requests end `messages` with an assistant turn for the model to continue, end them with a user turn instead. See [Replace assistant prefill](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#replace-assistant-prefill). +7. If you use computer use, replace `computer_20250124`: on the Claude API and Google Cloud, with the `computer_toolset_20260801` toolset; on Amazon Bedrock, with `computer_20251124` and the `computer-use-2025-11-24` beta header. See [Move computer use to the toolset](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#computer-use-toolset). +8. If you replay stored conversations through a different account, replay each one through the account that produced it. See [Replay thinking blocks through the account that produced them](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#replay-thinking-blocks-through-the-producing-account). +9. If your code changes `system`, `tools`, or earlier `messages` between requests in a conversation and sends thinking blocks back, keep the conversation append-only. See [Keep earlier turns unchanged](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#keep-earlier-turns-unchanged). +10. Handle `stop_reason: "refusal"`. Claude Haiku 5.5 runs safety classifiers that can decline a request, and it has no server-side fallback. See [Safeguard refusals](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-haiku-5-5#safeguard-refusals). +11. If you use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) (`output_config.format` or `strict: true` tools) on Amazon Bedrock, describe the format in the prompt or use a tool without `strict`, and validate the output in your code. Structured outputs aren't available for Claude Haiku 5.5 on Amazon Bedrock. + +If your organization has a [Priority Tier](https://platform.claude.com/docs/en/api/service-tiers#supported-models) commitment on Claude Haiku 4.5, plan capacity separately: Priority Tier is not supported on Claude Haiku 5.5. + +### Claude Haiku 3.5 or earlier + +1. Replace the Claude Haiku 3.5 or Claude Haiku 3 model ID with the Claude Haiku 5.5 ID for your platform. See [Migrating to Claude Haiku 5.5 from Claude Haiku 3.5 and earlier Haiku models](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#migrating-from-haiku-35). +2. If you use the legacy `code_execution_20250522` tool, move to `code_execution_20250825` or later. +3. If you use the text editor tool, move to `text_editor_20250728`. +4. Handle the `refusal` and `model_context_window_exceeded` stop reasons. +5. If your code matches tool call string parameters exactly, allow for trailing newlines. +6. Review your prompts. + +## Use the Claude Haiku 5.5 model ID + +Replace the Claude Haiku 4.5 model ID with the Claude Haiku 5.5 ID for your platform. + +| Platform | Claude Haiku 4.5 | Claude Haiku 5.5 | +| ---------------------- | ------------------------------------------------- | ---------------------------- | +| Claude API | `claude-haiku-4-5-20251001` or `claude-haiku-4-5` | `claude-haiku-5-5` | +| Amazon Bedrock | `anthropic.claude-haiku-4-5` | `anthropic.claude-haiku-5-5` | +| Claude Platform on AWS | `claude-haiku-4-5` | `claude-haiku-5-5` | +| Google Cloud | `claude-haiku-4-5@20251001` | `claude-haiku-5-5` | +| Microsoft Foundry | `claude-haiku-4-5` | `claude-haiku-5-5` | + +`claude-haiku-5-5` is a fixed model ID with no date suffix and no separate alias. + +## Recount tokens + +Claude Haiku 5.5 uses the same newer tokenizer as Claude 4.7 and later models. As with all models that use this tokenizer, the same input text produces approximately 30% more tokens on Claude Haiku 5.5 than on Claude Haiku 4.5. The exact increase depends on the content. Requests, responses, and streaming events keep the same shape. What changes is anything you measure or budget in tokens: + +* `usage` fields and [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) results are higher for the same text. +* A given number of tokens holds less text. +* A `max_tokens` limit tuned for Claude Haiku 4.5 may cut off equivalent output. +* Cost estimates made from Claude Haiku 4.5's token counts need recomputing with Claude Haiku 5.5's counts and [prices](https://platform.claude.com/docs/en/about-claude/pricing), including its higher prices for long prompts. See [Long context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing). + +Large images can also cost more tokens. Claude Haiku 5.5 uses the high-resolution image tier, which downscales images above 2,576 pixels on the long edge or 4,784 visual tokens. Claude Haiku 4.5 and earlier Haiku models use the standard tier, which downscales images above 1,568 pixels on the long edge or 1,568 visual tokens. An image of 2,000 by 1,500 pixels costs about 2.5 times as many visual tokens on Claude Haiku 5.5 as on Claude Haiku 4.5. See [Resolution and token cost](https://platform.claude.com/docs/en/build-with-claude/vision#evaluate-image-size). + +Count your prompts with `model` set to `claude-haiku-5-5` rather than reusing counts measured on Claude Haiku 4.5. + +## Configure thinking + +Claude Haiku 5.5 configures thinking differently from Claude Haiku 4.5. A `thinking` value of `{"type": "enabled", "budget_tokens": N}` returns a 400 error, so a request that sends it needs a new `thinking` value. + +Before, a request to Claude Haiku 4.5 set `thinking` to `enabled` with a token budget: + +```json +{ + "model": "claude-haiku-4-5", + "max_tokens": 16000, + "thinking": { "type": "enabled", "budget_tokens": 8000 }, + "messages": [{ "role": "user", "content": "..." }] +} +``` + +After, the same request to Claude Haiku 5.5 uses adaptive thinking. The `thinking` value changes, and `output_config.effort` sets how much the model thinks: + +```json +{ + "model": "claude-haiku-5-5", + "max_tokens": 16000, + "thinking": { "type": "adaptive" }, + "output_config": { "effort": "medium" }, + "messages": [{ "role": "user", "content": "..." }] +} +``` + +Adaptive thinking is on by default, so a response can begin with one or more `thinking` blocks even when the request doesn't set `thinking`. Leave `thinking` unset or set it to `{"type": "adaptive"}`, and use [effort](https://platform.claude.com/docs/en/build-with-claude/effort) as the lever: where Claude Haiku 4.5 ran without thinking, or with a small budget to save tokens, choose a lower effort level. At a lower level the model thinks less, and it can skip thinking entirely on simpler requests. For prompting guidance, see [Use effort to control thinking](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-haiku-5-5#use-effort-to-control-thinking). Select content blocks by their `type` field rather than by position, and pass `thinking` blocks back unmodified with tool results. + +Thinking tokens count toward `max_tokens`, so a request with a small `max_tokens` can stop with `stop_reason: "max_tokens"` after a `thinking` block and before any text. If you set a small `max_tokens` for Claude Haiku 4.5, raise it to leave room for thinking, or choose a lower [effort](https://platform.claude.com/docs/en/build-with-claude/effort) level. + +Thinking blocks from earlier assistant turns stay in context and count as input tokens, where Claude Haiku 4.5 kept only the latest turn's. Multi-turn conversations therefore carry more input tokens than the tokenizer change alone explains. To remove older blocks, use [thinking block clearing](https://platform.claude.com/docs/en/build-with-claude/context-editing#thinking-block-clearing). See [Thinking block preservation by model](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-block-preservation-by-model). + +By default, Claude Haiku 5.5 returns each `thinking` block with an empty `thinking` field and only a `signature`, where Claude Haiku 4.5 returned summarized thinking. To receive summarized thinking, set `thinking: {"type": "adaptive", "display": "summarized"}`. + +Claude Haiku 5.5 accepts a forced `tool_choice` (`any` or a named tool), but the response starts with the tool call and has no `thinking` block. To let the model think before it calls a tool, use `tool_choice: {"type": "auto"}` and say in the prompt when to use the tool. + +Claude Haiku 5.5 reads thinking blocks from Claude Sonnet 5, Claude Opus 4.8, Claude Haiku 4.5, and earlier models, so a conversation you switch from Claude Haiku 4.5 onto Claude Haiku 5.5 keeps its reasoning. It doesn't read blocks from Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5.5, or any Claude Fable or Claude Mythos model; the API drops those without an error. On the Claude API and Google Cloud, Claude Opus 5.5 and Claude Sonnet 5.5 read Claude Haiku 5.5's blocks. See [Switching models mid-conversation](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#switching-models). + +## Remove sampling parameters + +Claude Haiku 4.5 accepts `temperature`, `top_p`, and `top_k`. On Claude Haiku 5.5, omit all three and use prompting to guide the model's behavior instead. If a request includes `temperature`, it must be `1`. If it includes `top_p`, it must be `0.99`, its default. Any other `temperature` or `top_p` value returns a 400 error, including a `top_p` of `1`. So does any `top_k` value, and so does a request that includes both `temperature` and `top_p`. + +## Replace assistant prefill + +A prefill is a final assistant turn in `messages` that the model continues. Claude Haiku 4.5 accepts one when thinking is off. Claude Haiku 5.5 rejects it with a 400 error, even with thinking turned off. End `messages` with a user turn, and replace each prefill according to what it was for: + +* **Output format:** use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), or tools with enum fields for classification. On Amazon Bedrock, structured outputs aren't available for Claude Haiku 5.5. There, describe the format in the prompt or use a tool without `strict`, and validate the output in your code. +* **Preambles:** ask in the system prompt for a direct answer. +* **Continuations:** move them to the user message, for example "Your previous response was interrupted and ended with `[previous_response]`. Continue from where you left off." +* **Context reminders:** put them in the user turn. + +## Move computer use to the toolset + +Claude Haiku 4.5 supports [computer use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool) through the `computer_20250124` tool, with the `computer-use-2025-01-24` beta header. On the Claude API and Google Cloud, Claude Haiku 5.5 supports computer use only through the `computer_toolset_20260801` toolset, and a request that declares `computer_20250124` returns a 400 error. On Amazon Bedrock, Claude Haiku 5.5 doesn't accept `computer_20250124` either; use the `computer_20251124` tool version with the `computer-use-2025-11-24` beta header. + +To move an integration to the toolset, drop the `computer-use-2025-01-24` beta header and replace the `tools` entry with `{"type": "computer_toolset_20260801"}`. Then make the other request and agent-loop changes in [Migrate from `computer_20251124`](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#migrate-from-computer-20251124): dispatch on each member `tool_use` block's `name` and `toolset_name` rather than on `input.action`, handle every such block in a turn, and echo `toolset_name` on results. Zoom is on by default in the toolset; if your environment doesn't implement it, add `"configs": {"zoom": {"enabled": false}}`. If you send the `fine-grained-tool-streaming-2025-05-14` beta header, remove it. Alongside a toolset entry, it returns a 400 error. For other platforms, see the computer use tool's [Compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#compatibility) section. + +On the Claude API and Google Cloud, Claude Haiku 5.5 also supports the [browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool) (`browser_toolset_20260801`) for tasks inside webpages. Claude Haiku 4.5 doesn't support it. + +## Replay thinking blocks through the account that produced them + +Thinking blocks from Claude Haiku 5.5 work only in the account that produced them, or in an account linked to it. When another account sends one of these blocks, the API drops the block before the model sees it, and the request succeeds without that reasoning. This affects code that stores conversations and replays them through a different account, for example a service that serves several customers from one conversation store. Replay each conversation through the account that produced it. See [Thinking blocks stay with the account that produced them](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#account-bound-thinking). + +## Keep earlier turns unchanged + +A Claude Haiku 5.5 thinking block stays valid only while everything sent before it is unchanged: a request that sends a thinking block back after a change to `system`, `tools`, or earlier `messages` returns a 400 error. Claude Haiku 4.5 doesn't run this check. Keep conversations append-only. On accounts created before August 31, 2026, 00:00 UTC, the error comes only on requests that set `thinking.block_binding.prefix_mismatch_behavior`. For the changes that trigger the error and what to do instead, see [Who needs to change anything](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#who-is-affected). + +## Migrating to Claude Haiku 5.5 from Claude Haiku 3.5 and earlier Haiku models + +Claude Haiku 3.5 is retired on the Claude API and Amazon Bedrock, and Claude Haiku 3 is retired on the Claude API and Google Cloud. Requests to a retired model fail. Google Cloud lists Claude Haiku 3.5 as deprecated and available only to existing customers. See [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations). + +From either model, first apply every preceding section, then these changes: + +* **Model ID:** Replace `claude-3-5-haiku-20241022`, its alias `claude-3-5-haiku-latest`, or `claude-3-haiku-20240307` with `claude-haiku-5-5`. On Google Cloud, replace `claude-3-5-haiku@20241022` with `claude-haiku-5-5`. On Amazon Bedrock, use the Claude Haiku 5.5 ID from [Use the Claude Haiku 5.5 model ID](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#use-the-claude-haiku-5-5-model-id). +* **Code execution:** Claude Haiku 5.5 accepts `code_execution_20250825` and later versions. If you use the legacy Python-only `code_execution_20250522`, move to one of them. See [Upgrade to latest tool version](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#upgrade-to-latest-tool-version). +* **Text editor:** If you use the text editor tool, move to `text_editor_20250728` (tool name `str_replace_based_edit_tool`), which has no `undo_edit` command. See [Text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool). +* **Stop reasons:** Handle `refusal` and `model_context_window_exceeded`. See [Handling stop reasons](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons). +* **Trailing newlines:** Claude 4.5 and later models keep trailing newlines in tool call string parameters. If your code matches those strings exactly, allow for them. +* **Prompts:** Claude 4 and later models have a more concise, direct communication style and need explicit direction. Review your prompts against [Prompting Claude Haiku 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-haiku-5-5) and [prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices). diff --git a/llmsdk_docs/claude5_5/docs/migration-guide-opus-5-5.md b/llmsdk_docs/claude5_5/docs/migration-guide-opus-5-5.md index 065f846c..ef855c06 100644 --- a/llmsdk_docs/claude5_5/docs/migration-guide-opus-5-5.md +++ b/llmsdk_docs/claude5_5/docs/migration-guide-opus-5-5.md @@ -1,7 +1,7 @@ --- -title: Migrating to Claude Opus 5.5 +title: Claude Opus 5.5 migration guide url: https://platform.claude.com/docs/en/models/opus-5-5/migration-guide -description: "Migrate to Claude Opus 5.5 from earlier Opus models or Claude Sonnet 5: request settings that return errors, thinking blocks in every response, and a checklist for each starting model." +description: Switch to Claude Opus 5.5 from earlier Opus models or Claude Sonnet 5 with this migration guide. The guidance to enable Claude Opus 5.5 includes request settings that return errors, thinking blocks in every response, and a checklist for each starting model. --- @@ -31,7 +31,7 @@ Whichever model you are coming from, a request to `claude-opus-5-5` must meet th * **Effort:** Control thinking depth with the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort), the only request parameter that controls it. All five levels (`low`, `medium`, `high`, `xhigh`, `max`) are supported, and the default is `medium`. See [Recommended effort levels for Claude Opus 5.5](https://platform.claude.com/docs/en/build-with-claude/effort#recommended-effort-levels-for-claude-opus-5-5). * **Tool choice:** Use `tool_choice` `{"type": "auto"}` (the default) or `{"type": "none"}`. Forcing a tool call with `{"type": "any"}` or `{"type": "tool", "name": "..."}` is rejected. See the [before and after for tool choice](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#forced-tool-use). * **Sampling parameters:** Omit `temperature`, `top_p`, and `top_k`, or leave them at their defaults: any other value is rejected. Use prompting to guide the model's behavior. -* **Prefill:** Don't end `messages` with a prefilled assistant turn: it is rejected. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) or system prompt instructions instead. +* **Prefill:** Don't end `messages` with a prefilled assistant turn: it is rejected. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) or system prompt instructions instead. On Amazon Bedrock, structured outputs aren't available for Claude Opus 5.5, so use system prompt instructions there. * **Computer use:** On the Claude API and Google Cloud, declare computer use as the `computer_toolset_20260801` toolset; the earlier `computer_20251124` tool is rejected there. See the [computer use breaking change](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#computer-use-toolset). * **Context window:** No context-window beta header is needed. The [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) is the default, and a header sent for older models has no effect. @@ -284,9 +284,9 @@ Work down the groups and stop after the one that names your current model: every * Update the model ID to `claude-opus-5-5`. * Remove `thinking: {"type": "disabled"}` and `thinking: {"type": "enabled", ...}`; choose an effort level instead. * Set `effort` explicitly: the default is `medium`, where Claude Opus 5's is `high`. -* Replace `tool_choice` types `any` and `tool` with `auto` plus strict tool use or structured outputs. +* Replace `tool_choice` types `any` and `tool` with `auto` plus strict tool use or structured outputs, or with `auto` alone on Amazon Bedrock. * If you use computer use on the Claude API or Google Cloud, declare `computer_toolset_20260801` (no beta header) instead of `computer_20251124` and update your agent loop for the toolset. On Amazon Bedrock, keep `computer_20251124`; check the computer use tool's [Compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#compatibility) section for other platforms. -* If a router or fallback can move a conversation from Claude Opus 5.5 to another model, expect that model to run without Claude Opus 5.5's thinking blocks (Claude Fable 5.1 and Claude Mythos 5.1 on the Claude API are the exception and keep them). Claude Opus 5.5 itself reads thinking from Claude Opus 5 and earlier Opus, Sonnet, and Haiku models, but not from Claude Fable or Claude Mythos models. +* If a router or fallback can move a conversation from Claude Opus 5.5 to another model, expect that model to run without Claude Opus 5.5's thinking blocks (Claude Fable 5.1 and Claude Mythos 5.1 on the Claude API are the exception and keep them). Claude Opus 5.5 itself reads thinking from Claude Opus 5, from earlier Opus, Sonnet, and Haiku models, and, on the Claude API and Google Cloud, from Claude Sonnet 5.5 and Claude Haiku 5.5, but not from Claude Fable or Claude Mythos models. * Read content blocks by `type`, and pass `thinking` blocks back unmodified in tool-use loops. * If your interface renders text between tool calls, set `display: "updates"` (beta) or `"summarized"` and render the non-empty `thinking` blocks. * If your code edits earlier turns, the `system` prompt, or `tools` mid-conversation, follow [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking). @@ -328,7 +328,7 @@ Work down the groups and stop after the one that names your current model: every * Remove any assistant-message prefills; Claude Opus 4.6 already rejects them. * Verify tool call JSON parsing uses a standard JSON parser. -* Move from `client.beta.messages.create` to `client.messages.create`: adaptive thinking and effort need no beta namespace. +* Move from `client.beta.messages.create()` (python, typescript, ruby; csharp: `client.Beta.Messages.Create()`; go: `client.Beta.Messages.New()`; java: `client.beta().messages().create()`; php: `$client->beta->messages->create()`; cli: `ant beta:messages create`) to `client.messages.create()` (python, typescript, ruby; csharp: `client.Messages.Create()`; go: `client.Messages.New()`; java: `client.messages().create()`; php: `$client->messages->create()`; cli: `ant messages create`): adaptive thinking and effort need no beta namespace. * Remove the `effort-2025-11-24` beta header (the effort parameter does not require it). * Remove the `fine-grained-tool-streaming-2025-05-14` beta header. * Remove the `interleaved-thinking-2025-05-14` beta header (adaptive thinking enables interleaved thinking automatically). @@ -568,7 +568,7 @@ After: #### Forced tool use is not supported -`tool_choice` types `any` and `tool` return a 400 error (`tool_choice: type "tool" and "any" are not supported for this model.`), including on the token counting endpoint. Use `auto` with [strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use) or [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), and say in the prompt when the tool applies. Strict tool use accepts a subset of JSON Schema, so check each tool's `input_schema` before you add `strict: true`. Every object in the schema must set `additionalProperties: false`; see [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). See [Forced tool use is not supported](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5#forced-tool-use-is-not-supported). +`tool_choice` types `any` and `tool` return a 400 error (`tool_choice: type "tool" and "any" are not supported for this model.`), including on the token counting endpoint. Use `auto` with [strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use) or [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), and say in the prompt when the tool applies. Strict tool use accepts a subset of JSON Schema, so check each tool's `input_schema` before you add `strict: true`. Every object in the schema must set `additionalProperties: false`; see [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). On Amazon Bedrock, structured outputs, which include strict tool use, aren't available for Claude Opus 5.5. There, send `auto` without `strict`, say in the prompt when the tool applies, and validate the tool input in your code. See [Forced tool use is not supported](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5#forced-tool-use-is-not-supported). Before. Claude Opus 5 accepts this request, and Claude Opus 5.5 rejects it with a 400 error: @@ -884,7 +884,7 @@ After: #### Thinking blocks are tied to the model and the conversation -On the Claude API, Claude Fable 5.1 and Claude Mythos 5.1 read Claude Opus 5.5 thinking blocks; no other model does. A router or fallback that moves a conversation from Claude Opus 5.5 to any other model runs those turns without them. In the other direction, Claude Opus 5.5 reads thinking blocks from Claude Opus 5 and earlier Opus, Sonnet, and Haiku models, but not from Claude Fable or Claude Mythos models. Keep the conversation append-only (no edits to the `system` prompt, `tools`, or earlier messages mid-conversation) so the blocks stay valid; Claude Code, claude.ai, Claude Managed Agents, and the Claude Agent SDK already do. Enforcement matches Claude Fable 5.1 on every platform: for accounts created on or after August 31, 2026, 00:00 UTC, replaying a thinking block after such an edit returns a 400 error by default. There is no code change for append-only integrations. See [Thinking blocks are tied to the model and the conversation](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5#thinking-blocks-are-tied-to-the-model-that-produced-them) and [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking). +On the Claude API, Claude Fable 5.1 and Claude Mythos 5.1 read Claude Opus 5.5 thinking blocks; no other model does. A router or fallback that moves a conversation from Claude Opus 5.5 to any other model runs those turns without them. In the other direction, Claude Opus 5.5 reads thinking blocks from Claude Opus 5, from earlier Opus, Sonnet, and Haiku models, and, on the Claude API and Google Cloud, from Claude Sonnet 5.5 and Claude Haiku 5.5, but not from Claude Fable or Claude Mythos models. Keep the conversation append-only (no edits to the `system` prompt, `tools`, or earlier messages mid-conversation) so the blocks stay valid; Claude Code, claude.ai, Claude Managed Agents, and the Claude Agent SDK already do. Enforcement matches Claude Fable 5.1 on every platform: for accounts created on or after August 31, 2026, 00:00 UTC, replaying a thinking block after such an edit returns a 400 error by default. There is no code change for append-only integrations. See [Thinking blocks are tied to the model and the conversation](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5#thinking-blocks-are-tied-to-the-model-that-produced-them) and [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking). #### The `computer_20251124` computer use tool is not supported on the Claude API and Google Cloud @@ -1152,7 +1152,7 @@ On Claude Opus 5, text the model writes between tool calls comes back as `text` ### Safety classifiers and fallback -Claude Opus 5.5 can return `stop_reason: "refusal"` with a `stop_details` category. Its classifiers cover a broader set of categories than Claude Opus 5's, so expect `stop_details.category` values such as `"bio"` and `"reasoning_extraction"` in addition to `"cyber"`; see the [refusal category table](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response). Handle refusals and configure [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback) or your own retry (server-side fallback doesn't retry requests declined with `"reasoning_extraction"`; that refusal is returned to you); see [Refusals and fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback) and [Safeguard refusals](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#safeguard-refusals). +Claude Opus 5.5 can return `stop_reason: "refusal"` with a `stop_details` category. Its classifiers cover a broader set of categories than Claude Opus 5's, so expect `stop_details.category` values such as `"bio"` in addition to `"cyber"` and `"reasoning_extraction"`; see the [refusal category table](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response). Handle refusals and configure [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback) or your own retry (server-side fallback doesn't retry requests declined with `"reasoning_extraction"`; that refusal is returned to you); see [Refusals and fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback) and [Safeguard refusals](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5#safeguard-refusals). ### Recommended changes @@ -1511,7 +1511,7 @@ This section adds what changed in Claude Opus 4.7, with `claude-opus-4-6` as the Update your `max_tokens` parameters to give additional headroom, including compaction triggers, and re-test any code path that estimates tokens client-side or assumes a fixed token-to-character ratio. Use the [Token counting endpoint](https://platform.claude.com/docs/en/build-with-claude/token-counting) to verify. Prompting interventions, [`task_budget`](https://platform.claude.com/docs/en/build-with-claude/task-budgets), and [`effort`](https://platform.claude.com/docs/en/build-with-claude/effort) can help control costs; these controls may trade off model intelligence. -5. **Prefill removal (already in effect on Claude Opus 4.6):** Prefilling assistant messages returns a 400 error on Claude Opus 4.6 and later Opus models, including Claude Opus 5.5, so this is a change only if you come from Claude Opus 4.5 or earlier. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), system prompt instructions, or `output_config.format` instead. +5. **Prefill removal (already in effect on Claude Opus 4.6):** Prefilling assistant messages returns a 400 error on Claude Opus 4.6 and later Opus models, including Claude Opus 5.5, so this is a change only if you come from Claude Opus 4.5 or earlier. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) or system prompt instructions instead. On Amazon Bedrock, structured outputs aren't available for Claude Opus 5.5, so use system prompt instructions there. ### Behavior changes @@ -1546,13 +1546,13 @@ If you are migrating from Claude Opus 4.5, Claude Opus 4.1, or an earlier model The first item is required on Claude Opus 5.5; the rest are recommended. -1. **Migrate to adaptive thinking (required):** `thinking: {"type": "enabled", "budget_tokens": N}` returns a 400 error on Claude Opus 4.7 and later models. The before and after is item 1 of the [breaking changes for migrating from Claude Opus 4.6](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#opus-46-breaking-changes). The migration also moves from `client.beta.messages.create` to `client.messages.create`: adaptive thinking and effort do not require the beta SDK namespace or any beta headers. +1. **Migrate to adaptive thinking (required):** `thinking: {"type": "enabled", "budget_tokens": N}` returns a 400 error on Claude Opus 4.7 and later models. The before and after is item 1 of the [breaking changes for migrating from Claude Opus 4.6](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#opus-46-breaking-changes). The migration also moves from `client.beta.messages.create()` (python, typescript, ruby; csharp: `client.Beta.Messages.Create()`; go: `client.Beta.Messages.New()`; java: `client.beta().messages().create()`; php: `$client->beta->messages->create()`; cli: `ant beta:messages create`) to `client.messages.create()` (python, typescript, ruby; csharp: `client.Messages.Create()`; go: `client.Messages.New()`; java: `client.messages().create()`; php: `$client->messages->create()`; cli: `ant messages create`): adaptive thinking and effort do not require the beta SDK namespace or any beta headers. -2. **Remove effort beta header:** The effort parameter does not require a beta header. Remove `betas=["effort-2025-11-24"]` from your requests. +2. **Remove effort beta header:** The effort parameter does not require a beta header. Remove the `effort-2025-11-24` beta from your requests. -3. **Remove fine-grained tool streaming beta header:** Fine-grained tool streaming does not require a beta header. Remove `betas=["fine-grained-tool-streaming-2025-05-14"]` from your requests. +3. **Remove fine-grained tool streaming beta header:** Fine-grained tool streaming does not require a beta header. Remove the `fine-grained-tool-streaming-2025-05-14` beta from your requests. -4. **Remove interleaved thinking beta header:** With adaptive thinking, interleaved thinking is automatic on every model that supports adaptive thinking. Remove `betas=["interleaved-thinking-2025-05-14"]` from your requests. +4. **Remove interleaved thinking beta header:** With adaptive thinking, interleaved thinking is automatic on every model that supports adaptive thinking. Remove the `interleaved-thinking-2025-05-14` beta from your requests. 5. **Migrate to output\_config.format:** If using structured outputs, update `output_format={...}` to `output_config={"format": {...}}`. The `output_format` parameter is deprecated and will be removed in the future. To use it anyway, add the `structured-outputs-2025-11-13` beta header. Without it, the API returns a 400 error. The Python SDK (v1.0 and later) does not accept `output_format={...}` on `client.beta.messages.create()` or `count_tokens()`. The `output_format=Model` argument of the `parse()` and `stream()` helpers is unchanged. diff --git a/llmsdk_docs/claude5_5/docs/migration-guide-sonnet-5-5.md b/llmsdk_docs/claude5_5/docs/migration-guide-sonnet-5-5.md index 01083baa..a62be2e6 100644 --- a/llmsdk_docs/claude5_5/docs/migration-guide-sonnet-5-5.md +++ b/llmsdk_docs/claude5_5/docs/migration-guide-sonnet-5-5.md @@ -1,7 +1,7 @@ --- -title: Migrating to Claude Sonnet 5.5 +title: Claude Sonnet 5.5 migration guide url: https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide -description: "Move code to Claude Sonnet 5.5 from Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Sonnet 4, Claude 3.7 Sonnet, or Claude Haiku 4.5: settings that return errors, thinking changes, and a checklist for each starting model." +description: Switch to Claude Sonnet 5.5 from earlier Sonnet models or Claude Haiku 4.5 with this migration guide. The guidance to enable Claude Sonnet 5.5 includes settings that return errors, thinking changes, and a checklist for each starting model. --- This guide lists the code changes for moving to Claude Sonnet 5.5 from Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Sonnet 4, Claude 3.7 Sonnet, or Claude Haiku 4.5. Read the first two sections, then read down to the section for your current model. The [migration checklist](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migration-checklist) lists every change by starting model. @@ -20,7 +20,7 @@ This guide lists the code changes for moving to Claude Sonnet 5.5 from Claude So The skill applies the model ID swap and, as needed, breaking parameter changes, prefill replacement, and effort calibration for your target model across your code base, then produces a checklist of items to verify manually. It asks you to confirm the migration scope (entire working directory, a subdirectory, or a specific file list) before editing any files. The skill also detects Amazon Bedrock and Claude Platform on AWS clients and adjusts model ID formats and feature changes for those platforms. -Claude Sonnet 5.5 has the same prices as Claude Sonnet 5. See [Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing). For its context window and output limits, see the [Claude Sonnet 5.5 model page](https://platform.claude.com/docs/en/models/sonnet-5-5/overview). For features and prompting, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#feature-support) and [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5). +Claude Sonnet 5.5 has the same prices as Claude Sonnet 5, except for prompt cache reads, which cost $0.10 USD per million tokens, half the Claude Sonnet 5 rate. See [Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing). For its context window and output limits, see the [Claude Sonnet 5.5 model page](https://platform.claude.com/docs/en/models/sonnet-5-5/overview). For features and prompting, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#feature-support) and [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5). ## Send a request to Claude Sonnet 5.5 @@ -242,7 +242,7 @@ Thinking text is omitted by default. `thinking` blocks arrive with an empty `thi To turn off up-front thinking on Claude Sonnet 5.5, send `thinking: {"type": "between_tools"}`. It's the lowest thinking setting. Its progress updates between tool calls still come back as `thinking` blocks with their summary text. Without tools, the response contains only text. Claude Sonnet 5 turns thinking off with `thinking: {"type": "disabled"}` instead, and earlier models run without thinking by default. On Claude Sonnet 5.5, `disabled` returns a 400 `invalid_request_error`: ```text wrap -"thinking.type.disabled" is not supported for this model. Use "thinking.type.between_tools" for the lowest thinking setting, or "thinking.type.adaptive" and "output_config.effort" to control thinking behavior. +To turn thinking off on this model, send "thinking": {"type": "between_tools"} instead of {"type": "disabled"}. The model does not think before responding. The short updates it writes between tool calls come back as thinking blocks. ``` `between_tools` works on every platform that offers Claude Sonnet 5.5, with no beta header. It's accepted at `low`, `medium`, and `high` effort. At `xhigh` or `max`, it returns a 400 error. To run at those levels, use adaptive thinking: omit the `thinking` field or send `thinking: {"type": "adaptive"}`. `between_tools` takes no other field: `display`, `budget_tokens`, or `block_binding` sent with it returns a 400 error. With [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback), a `between_tools` request that falls back to Claude Sonnet 5 runs there with `thinking: {"type": "disabled"}`. @@ -844,7 +844,7 @@ The example marks every tool in the list strict. A request can have at most 20 s ### Thinking blocks are tied to the model and the conversation -Claude Sonnet 5.5 reads thinking blocks from Claude Sonnet 5, Claude Opus 4.8, Claude Haiku 4.5, and earlier models. It doesn't read blocks from Claude Opus 5, Claude Opus 5.5, or any Claude Fable or Claude Mythos model. The API drops blocks the model can't read. The request still returns 200, and dropped blocks aren't billed. See [Switching models mid-conversation](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#switching-models). +Claude Sonnet 5.5 reads thinking blocks from Claude Sonnet 5, Claude Opus 4.8, Claude Haiku 4.5, and earlier models, and, on the Claude API and Google Cloud, from Claude Haiku 5.5. It doesn't read blocks from Claude Opus 5, Claude Opus 5.5, or any Claude Fable or Claude Mythos model. The API drops blocks the model can't read. The request still returns 200, and dropped blocks aren't billed. See [Switching models mid-conversation](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#switching-models). Each Claude Sonnet 5.5 thinking block is also signed over the conversation before it. For accounts created on or after August 31, 2026, 00:00 UTC, the API enforces this by default, on the Claude API, Amazon Bedrock, and Google Cloud. On those accounts, a request that replays a block after an edit to earlier history returns a 400 error. Keep conversations append-only, and change instructions or tools with [mid-conversation system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages). Thinking blocks that Claude Sonnet 5.5 produces work only in the account that produced them, or in an account linked to it. See [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#account-bound-thinking). @@ -863,7 +863,7 @@ Code that already sends the toolset needs no change. [Migrate from `computer_202 ### The advisor tool accepts fewer advisors -With the [advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool), a Claude Sonnet 5.5 executor needs one of these advisors: Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5, or Claude Mythos 5.1. Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5, and Claude Sonnet 4.6 advisors return a 400 error. The advice comes back encrypted as an `advisor_redacted_result` block, so its text isn't readable in the response. See [Model compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#model-compatibility). +With the [advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool), a Claude Sonnet 5.5 executor needs one of these advisors: Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5, or Claude Mythos 5.1. Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5, Claude Sonnet 4.6, and Claude Haiku 5.5 advisors return a 400 error. The advice comes back encrypted as an `advisor_redacted_result` block, so its text isn't readable in the response. See [Model compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#model-compatibility). ### Text between tool calls is returned in thinking blocks @@ -1213,7 +1213,7 @@ This model does not support assistant message prefill. The conversation must end Replace each prefill according to what it was for: -* **Output format:** use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), or tools with enum fields for classification. +* **Output format:** use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), or tools with enum fields for classification. On Amazon Bedrock, structured outputs aren't available for Claude Sonnet 5.5. There, describe the format in the prompt or use a tool without `strict`, and validate the output in your code. * **Preambles:** ask in the system prompt for a direct answer. * **Unwanted refusals:** clear instructions in the user message are usually enough. * **Continuations:** move them to the user message, for example "Your previous response was interrupted and ended with `[previous_response]`. Continue from where you left off." diff --git a/llmsdk_docs/claude5_5/docs/models-overview.md b/llmsdk_docs/claude5_5/docs/models-overview.md index 95d11a07..df52fc23 100644 --- a/llmsdk_docs/claude5_5/docs/models-overview.md +++ b/llmsdk_docs/claude5_5/docs/models-overview.md @@ -24,35 +24,35 @@ Claude is a family of state-of-the-art large language models developed by Anthro If you're unsure which model to use, start with [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) for most workloads. Use [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) for demanding reasoning and long-horizon agentic work, or when your evals on Claude Opus 5.5 at higher effort still fall short. All current models support text and image input, text output, multilingual capabilities, vision, and tool use. Each model's page lists the platforms it's available on. -| Feature | Claude Fable 5.1 | Claude Opus 5.5 | Claude Sonnet 5.5 | Claude Haiku 4.5 | -| :-------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | -| Description | For demanding reasoning and long-horizon agentic work | For long-running agentic coding and knowledge work | The best combination of speed and intelligence | The fastest model with near-frontier intelligence | -| Model page | [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | [Claude Haiku 4.5](https://platform.claude.com/docs/en/models/haiku-4-5/overview) | -| Comparative latency | Slower | Moderate | Fast | Fastest | -| [Pricing](https://platform.claude.com/docs/en/about-claude/pricing) | $10 / input MTok, $50 / output MTok | $4 / input MTok, $20 / output MTok | $2 / input MTok, $10 / output MTok | $1 / input MTok, $5 / output MTok | -| Claude API ID | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-4-5-20251001` | -| [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) | Adaptive (always on) | Adaptive (always on) | Adaptive | Extended | -| [Default effort](https://platform.claude.com/docs/en/build-with-claude/effort) | `high` | `medium` | `high` | Not supported | -| [Context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) | 1M tokens | 1M tokens | 1M tokens | 200K tokens | -| Max output | 128K tokens | 128K tokens | 128K tokens | 64K tokens | -| Reliable knowledge cutoff | Jun 2026 | Jun 2026 | Jun 2026 | Feb 2025 | -| Training data cutoff | Jun 2026 | Jun 2026 | Jun 2026 | Jul 2025 | -| [Retirement](https://platform.claude.com/docs/en/about-claude/model-deprecations) | Not sooner than September 1, 2027 | Not sooner than September 22, 2027 | Not sooner than September 28, 2027 | Not sooner than October 15, 2026 | -| Claude API alias | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-4-5` | -| [Amazon Bedrock ID](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) | `anthropic.claude-fable-5-1` | `anthropic.claude-opus-5-5` | `anthropic.claude-sonnet-5-5` | `anthropic.claude-haiku-4-5` | -| [Google Cloud ID](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-4-5@20251001` | -| [Microsoft Foundry ID](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-4-5` | -| [Claude Platform on AWS ID](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-4-5` | +| Feature | Claude Fable 5.1 | Claude Opus 5.5 | Claude Sonnet 5.5 | Claude Haiku 5.5 | +| :-------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | +| Description | For demanding reasoning and long-horizon agentic work | For long-running agentic coding and knowledge work | The best combination of speed and intelligence | For high-volume, latency-sensitive tasks such as classification, extraction, and routing | +| Model page | [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | [Claude Haiku 5.5](https://platform.claude.com/docs/en/models/haiku-5-5/overview) | +| Comparative latency | Slower | Moderate | Fast | Fastest | +| [Pricing](https://platform.claude.com/docs/en/about-claude/pricing) | $10 / input MTok, $50 / output MTok | $4 / input MTok, $20 / output MTok | $2 / input MTok, $10 / output MTok | From $0.10 / input MTok, From $0.50 / output MTok | +| Claude API ID | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` | +| [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) | Adaptive (always on) | Adaptive (always on) | Adaptive | Adaptive | +| [Default effort](https://platform.claude.com/docs/en/build-with-claude/effort) | `high` | `medium` | `high` | `medium` | +| [Context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) | 1M tokens | 1M tokens | 1M tokens | 1M tokens | +| Max output | 128K tokens | 128K tokens | 128K tokens | 128K tokens | +| Reliable knowledge cutoff | Jun 2026 | Jun 2026 | Jun 2026 | Jun 2026 | +| Training data cutoff | Jun 2026 | Jun 2026 | Jun 2026 | Jun 2026 | +| [Retirement](https://platform.claude.com/docs/en/about-claude/model-deprecations) | Not sooner than September 1, 2027 | Not sooner than September 22, 2027 | Not sooner than September 28, 2027 | Not sooner than October 7, 2027 | +| Claude API alias | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` | +| [Amazon Bedrock ID](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) | `anthropic.claude-fable-5-1` | `anthropic.claude-opus-5-5` | `anthropic.claude-sonnet-5-5` | `anthropic.claude-haiku-5-5` | +| [Google Cloud ID](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` | +| [Microsoft Foundry ID](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` | +| [Claude Platform on AWS ID](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) | `claude-fable-5-1` | `claude-opus-5-5` | `claude-sonnet-5-5` | `claude-haiku-5-5` | * **Comparative latency:** Relative to the current lineup. Actual latency depends on prompt length, output length, and thinking effort. -* **Pricing:** Base price per million tokens. Batch API requests are 50% off; prompt cache reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5). See Pricing for cache writes, long-context, and per-platform pricing. +* **Pricing:** Base price per million tokens. Batch API requests are 50% off; prompt cache reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5 and Claude Sonnet 5.5). See Pricing for cache writes, long-context, and per-platform pricing. * **Claude API ID:** Every Claude model ID is a pinned snapshot, including the dateless IDs used from the 4.6 generation on. * **Thinking:** Adaptive thinking lets the model decide how much to think, steered by effort. Extended thinking is the manual thinking.type “enabled” + budget\_tokens mode on earlier models; it is deprecated on Claude Opus 4.6 and Claude Sonnet 4.6 and not accepted on later models. * **Default effort:** The effort parameter’s default on the Claude API. Set effort explicitly to use a different level. * **Context window:** 1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer (introduced with Claude Opus 4.7); models before it fit about 750k words in 1M tokens. 200k tokens is roughly 150k words. -* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. +* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 5.5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. * **Reliable knowledge cutoff:** The date through which the model’s knowledge is most extensive and reliable. Training data cutoff (under Additional details) is the broader range of data used. See Anthropic’s Transparency Hub for details. -* **Retirement:** Anthropic’s commitment for Anthropic-operated platforms (Claude API, Claude Platform on AWS, Microsoft Foundry). Amazon Bedrock and Google Cloud set their own dates. +* **Retirement:** Anthropic’s commitment for the platforms that Anthropic operates. Amazon Bedrock and Google Cloud set their own dates. * **Claude API alias:** For models before the 4.6 generation, the alias is a convenience pointer that resolves to the dated ID. Dateless IDs are their own pinned snapshot; the alias row repeats them. * **Amazon Bedrock ID:** The ID on Bedrock’s Messages-API endpoint (Claude Opus 4.7 and later, plus Claude Haiku 4.5); a model offered only through Bedrock’s InvokeModel integration shows that ID instead. Bedrock offers global endpoints (dynamic routing) and regional endpoints (guaranteed data routing) for Claude Sonnet 4.5 and later, and sets its own lifecycle dates. * **Google Cloud ID:** Google Cloud offers global, multi-region, and regional endpoints, and sets its own lifecycle dates. @@ -61,7 +61,7 @@ If you're unsure which model to use, start with [Claude Opus 5.5](https://platfo See [Model IDs and versioning](https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions) and [Pricing](https://platform.claude.com/docs/en/about-claude/pricing). -Legacy models (still available): [Claude Fable 5](https://platform.claude.com/docs/en/models/fable-5/overview), [Claude Opus 5](https://platform.claude.com/docs/en/models/opus-5/overview), [Claude Opus 4.8](https://platform.claude.com/docs/en/models/opus-4-8/overview), [Claude Opus 4.7](https://platform.claude.com/docs/en/models/opus-4-7/overview), [Claude Opus 4.6](https://platform.claude.com/docs/en/models/opus-4-6/overview), [Claude Opus 4.5](https://platform.claude.com/docs/en/models/opus-4-5/overview), [Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/overview), [Claude Sonnet 4.6](https://platform.claude.com/docs/en/models/sonnet-4-6/overview), [Claude Sonnet 4.5](https://platform.claude.com/docs/en/models/sonnet-4-5/overview). +Legacy models (still available): [Claude Fable 5](https://platform.claude.com/docs/en/models/fable-5/overview), [Claude Opus 5](https://platform.claude.com/docs/en/models/opus-5/overview), [Claude Opus 4.8](https://platform.claude.com/docs/en/models/opus-4-8/overview), [Claude Opus 4.7](https://platform.claude.com/docs/en/models/opus-4-7/overview), [Claude Opus 4.6](https://platform.claude.com/docs/en/models/opus-4-6/overview), [Claude Opus 4.5](https://platform.claude.com/docs/en/models/opus-4-5/overview), [Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/overview), [Claude Sonnet 4.6](https://platform.claude.com/docs/en/models/sonnet-4-6/overview), [Claude Haiku 4.5](https://platform.claude.com/docs/en/models/haiku-4-5/overview). Once you've picked a model, [learn how to make your first API call](https://platform.claude.com/docs/en/get-started). To understand how model IDs, aliases, and snapshots work, see [Model IDs and versioning](https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions); for the reliable-knowledge and training-data cutoffs behind each model, see [Anthropic's Transparency Hub](https://www.anthropic.com/transparency). @@ -69,13 +69,21 @@ Once you've picked a model, [learn how to make your first API call](https://plat You can query model capabilities and token limits programmatically with the [Models API](https://platform.claude.com/docs/en/api/models/list). The response includes `max_input_tokens`, `max_tokens`, and a `capabilities` object for every available model. +Each model in the response also has a `line` field, which names the model line it belongs to. Claude Opus 4.5 and Claude Opus 4.6 both report `opus`. Use `line` to group models, for example, in a model picker. `line` is `null` when a model belongs to no line. Read `line` instead of inferring it from the model's `id`. Anthropic might add more lines, so don't treat the set of values as fixed. + +Each model's `capabilities` object includes `thinking.types.disabled`, which reports whether the model accepts `thinking: {type: "disabled"}`, the setting that [turns thinking off](https://platform.claude.com/docs/en/build-with-claude/thinking#turning-thinking-off). `supported` is `false` when the model rejects `"disabled"` with a 400 error, and `true` on a model that doesn't support thinking. Even when `supported` is `true`, the API can still reject a `"disabled"` request for another reason. One such reason is an [effort](https://platform.claude.com/docs/en/build-with-claude/effort) level that the model doesn't allow with thinking off. + +Each model's `capabilities` object also includes `server_tools`, which reports whether the model accepts the [web search](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool) and [code execution](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) tools. It doesn't cover other server tools, such as web fetch. `server_tools.web_search.supported` and `server_tools.code_execution.supported` are `true` when the model accepts at least one version of that tool, not necessarily every version. `server_tools.supported` is `true` when the model accepts at least one of the two tools. Even when a tool is supported, your organization's settings can still cause a request that uses it to fail. For example, an administrator can [disable web search](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool#how-to-use-web-search). + +The top-level `code_execution` capability is a different check. It reports whether code that Claude runs in the code execution tool can call the request's other tools, as in [programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling). For Claude Haiku 4.5, for example, the Models API reports `server_tools.code_execution.supported` as `true` and `code_execution.supported` as `false`. + ## Prompt and output performance Current Claude models excel in: * **Performance:** Top-tier results in reasoning, coding, multilingual tasks, long-context handling, honesty, and image processing. See [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) for general and model-specific prompting guidance. * **Engaging responses:** Claude models are ideal for applications that require rich, human-like interactions. If you prefer more concise responses, adjust your prompts to guide the model toward the desired output length. Refer to the [prompt engineering guides](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering) for details. -* **Output quality:** When migrating from a previous model generation, you may notice larger improvements in overall performance. If you're on Claude Opus 5 or earlier, see [Migrating to Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide). +* **Output quality:** When migrating from a previous model generation, you may notice larger improvements in overall performance. If you're on Claude Opus 5 or earlier, see the [Claude Opus 5.5 migration guide](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide). ## Get started with Claude diff --git a/llmsdk_docs/claude5_5/docs/overview-haiku-5-5.md b/llmsdk_docs/claude5_5/docs/overview-haiku-5-5.md new file mode 100644 index 00000000..0ef65c7b --- /dev/null +++ b/llmsdk_docs/claude5_5/docs/overview-haiku-5-5.md @@ -0,0 +1,140 @@ +--- +title: Claude Haiku 5.5 +url: https://platform.claude.com/docs/en/models/haiku-5-5/overview +description: "Claude Haiku 5.5 at a glance: what it's for, model IDs on every platform, context window, output limits, pricing, availability, and the guides and resources for building with it." +--- + +**Latest.** Released October 7, 2026. + +For high-volume, latency-sensitive tasks such as classification, extraction, and routing + +Model ID: `claude-haiku-5-5` + +Context window: 1M tokens · Max output: 128K tokens · Input pricing: From $0.10 / MTok · Output pricing: From $0.50 / MTok + +[Announcement](https://www.anthropic.com/claude-haiku-5-5) · [What’s new](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5) · [Migration guide](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide) + +## Overview + +Claude Haiku 5.5 is built for high-volume, latency-sensitive work such as classification, routing, extraction, and subagent tasks. It supports adaptive thinking with the effort parameter, a 1M token context window, and up to 128k output tokens. It uses the same newer tokenizer as Claude 4.7 and later models, so the same text counts as approximately 30% more tokens than on Claude Haiku 4.5. Its thinking blocks work only in the account that produced them, or in an account linked to it. + +For code changes, see the [migration guide](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide). For model IDs, pricing, and limits, see the [Claude Haiku 5.5 overview](https://platform.claude.com/docs/en/models/haiku-5-5/overview). For prompting guidance, see [Prompting Claude Haiku 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-haiku-5-5). + +[What's new in Claude Haiku 5.5](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5) + +## How it compares + +| Model | Context | Max output | Price / MTok | Latency | Thinking | Default effort | Knowledge cutoff | +| :---------------------------------------------------------------------------------- | :------ | :--------- | :----------------- | :------- | :------------------- | :------------- | :--------------- | +| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Slower | Adaptive (always on) | `high` | Jun 2026 | +| [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | 1M | 128K | $4 / $20 | Moderate | Adaptive (always on) | `medium` | Jun 2026 | +| [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | 1M | 128K | $2 / $10 | Fast | Adaptive | `high` | Jun 2026 | +| **Claude Haiku 5.5** (this model) | 1M | 128K | From $0.10 / $0.50 | Fastest | Adaptive | `medium` | Jun 2026 | + +* **Context:** 1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer (introduced with Claude Opus 4.7); models before it fit about 750k words in 1M tokens. 200k tokens is roughly 150k words. +* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 5.5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. +* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5 and Claude Sonnet 5.5). See Pricing for the full list. +* **Latency:** Comparative latency, relative to the current lineup, as published in the models overview. Actual latency depends on prompt length, output length, and thinking effort. +* **Thinking:** Adaptive thinking lets the model decide how much to think, steered by effort. Extended thinking is the manual budget\_tokens mode on earlier models. +* **Default effort:** The effort parameter’s default on the Claude API. Models without a value don’t support the parameter. +* **Knowledge cutoff:** Reliable knowledge cutoff: the date through which the model’s knowledge is most extensive and reliable. + +## Specifications + +### Model IDs + +| Platform | Model ID | +| :----------------------------------------------------------------------------------------------------- | :--------------------------- | +| Claude API | `claude-haiku-5-5` | +| [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) | `anthropic.claude-haiku-5-5` | +| [Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai) | `claude-haiku-5-5` | +| [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) | `claude-haiku-5-5` | +| [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) | `claude-haiku-5-5` | + +### Pricing + +| Feature | Value | +| :------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------- | +| Input | $0.10 / MTok for prompts up to 100,000 tokens; $0.50 / MTok for prompts over 100,000 tokens | +| Output | $0.50 / MTok for prompts up to 100,000 tokens; $2.50 / MTok for prompts over 100,000 tokens | +| [5m cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.125 / MTok for prompts up to 100,000 tokens; $0.625 / MTok for prompts over 100,000 tokens | +| [1h cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.20 / MTok for prompts up to 100,000 tokens; $1 / MTok for prompts over 100,000 tokens | +| [Cache read](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.01 / MTok for prompts up to 100,000 tokens; $0.05 / MTok for prompts over 100,000 tokens | +| [Batch API](https://platform.claude.com/docs/en/build-with-claude/batch-processing) | 50% discount on input and output | + +[Full price list](https://platform.claude.com/docs/en/about-claude/pricing) + +### Capabilities + +| Feature | Value | +| :-------------------------------------------------------------------------------------------------------------------------- | :--------------------- | +| [Context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) | 1M tokens | +| Max output | 128K tokens | +| [Max output (Batch API, beta)](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta) | 300K tokens | +| [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) | Adaptive | +| [Default effort](https://platform.claude.com/docs/en/build-with-claude/effort) | `medium` | +| Comparative latency | Fastest | +| Input → output | Text and images → text | +| Reliable knowledge cutoff | Jun 2026 | +| Training data cutoff | Jun 2026 | + +### Availability + +| Feature | Value | +| :---------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Status](https://platform.claude.com/docs/en/about-claude/model-deprecations) | Active (latest) | +| Released | October 7, 2026 | +| Retirement | Not sooner than October 7, 2027 | +| Platforms | Claude API, [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock), [Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai), [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) | + +## Good to know + +* Adaptive thinking is on by default. Control thinking depth with the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort). +* Omit `temperature`, `top_p`, and `top_k`. See [Remove sampling parameters](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#remove-sampling-parameters) for the values that return a 400 error. +* On the [Message Batches API](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta), Claude Haiku 5.5 supports up to 300k output tokens with the `output-300k-2026-03-24` beta header. +* The minimum cacheable prompt length is 512 tokens. See [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations). +* Query limits and capabilities programmatically with the [Models API](https://platform.claude.com/docs/en/api/models/list). + +## Resources + + + + Behavioral differences and prompting patterns specific to Claude Haiku 5.5. + + + + Choose a model and effort level, shape prompts, and stream output for faster responses. + + + + Claude Haiku 5.5 determines when and how much to think. Steer depth with `effort`. + + + + How the context window is counted and managed. + + + +## Reference + + + + The system prompt Claude Haiku 5.5 uses on claude.ai and the Claude apps. + + + + Safety evaluations and deployment decisions for Claude Haiku 5.5. + + + + Full price list, including batch discounts and prompt caching rates. + + + + How model IDs, aliases, and pinned snapshots work. + + + + Lifecycle status and retirement commitments for every Claude model. + + diff --git a/llmsdk_docs/claude5_5/docs/overview-opus-5-5.md b/llmsdk_docs/claude5_5/docs/overview-opus-5-5.md index ebca53cf..1ff1da65 100644 --- a/llmsdk_docs/claude5_5/docs/overview-opus-5-5.md +++ b/llmsdk_docs/claude5_5/docs/overview-opus-5-5.md @@ -22,16 +22,16 @@ Claude Opus 5.5 is built for long-running agentic coding and knowledge work, pri ## How it compares -| Model | Context | Max output | Price / MTok | Latency | Thinking | Default effort | Knowledge cutoff | -| :---------------------------------------------------------------------------------- | :------ | :--------- | :----------- | :------- | :------------------- | :------------- | :--------------- | -| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Slower | Adaptive (always on) | `high` | Jun 2026 | -| **Claude Opus 5.5** (this model) | 1M | 128K | $4 / $20 | Moderate | Adaptive (always on) | `medium` | Jun 2026 | -| [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | 1M | 128K | $2 / $10 | Fast | Adaptive | `high` | Jun 2026 | -| [Claude Haiku 4.5](https://platform.claude.com/docs/en/models/haiku-4-5/overview) | 200K | 64K | $1 / $5 | Fastest | Extended | — | Feb 2025 | +| Model | Context | Max output | Price / MTok | Latency | Thinking | Default effort | Knowledge cutoff | +| :---------------------------------------------------------------------------------- | :------ | :--------- | :----------------- | :------- | :------------------- | :------------- | :--------------- | +| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Slower | Adaptive (always on) | `high` | Jun 2026 | +| **Claude Opus 5.5** (this model) | 1M | 128K | $4 / $20 | Moderate | Adaptive (always on) | `medium` | Jun 2026 | +| [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | 1M | 128K | $2 / $10 | Fast | Adaptive | `high` | Jun 2026 | +| [Claude Haiku 5.5](https://platform.claude.com/docs/en/models/haiku-5-5/overview) | 1M | 128K | From $0.10 / $0.50 | Fastest | Adaptive | `medium` | Jun 2026 | * **Context:** 1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer (introduced with Claude Opus 4.7); models before it fit about 750k words in 1M tokens. 200k tokens is roughly 150k words. -* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. -* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5). See Pricing for the full list. +* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 5.5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. +* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5 and Claude Sonnet 5.5). See Pricing for the full list. * **Latency:** Comparative latency, relative to the current lineup, as published in the models overview. Actual latency depends on prompt length, output length, and thinking effort. * **Thinking:** Adaptive thinking lets the model decide how much to think, steered by effort. Extended thinking is the manual budget\_tokens mode on earlier models. * **Default effort:** The effort parameter’s default on the Claude API. Models without a value don’t support the parameter. diff --git a/llmsdk_docs/claude5_5/docs/overview-sonnet-5-5.md b/llmsdk_docs/claude5_5/docs/overview-sonnet-5-5.md index 77b6e1b0..f56832c2 100644 --- a/llmsdk_docs/claude5_5/docs/overview-sonnet-5-5.md +++ b/llmsdk_docs/claude5_5/docs/overview-sonnet-5-5.md @@ -22,7 +22,7 @@ Claude Sonnet 5.5 offers the best combination of speed and intelligence. Five br * [Forced tool use returns an error](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#forced-tool-use-is-not-supported). * [Thinking blocks are tied to the model and the conversation](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#thinking-blocks-are-tied-to-the-model-that-produced-them). * [On the Claude API and Google Cloud, the earlier `computer_20251124` computer use tool is not accepted](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#computer-20251124-is-not-supported). -* [The advisor tool rejects Claude Opus 4.8, Claude Opus 4.7, and Claude Sonnet 5 as advisors](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#advisor-tool-pairings). +* [The advisor tool rejects Claude Opus 4.8, Claude Opus 4.7, Claude Sonnet 5, and Claude Haiku 5.5 as advisors](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#advisor-tool-pairings). One more change alters the response shape without failing any request: [text between tool calls comes back in `thinking` blocks](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#text-between-tool-calls). An application that streams that text to its users goes quiet between tool calls until it sets a `display` value that returns the text, or turns off up-front thinking with `between_tools`. @@ -30,16 +30,16 @@ One more change alters the response shape without failing any request: [text bet ## How it compares -| Model | Context | Max output | Price / MTok | Latency | Thinking | Default effort | Knowledge cutoff | -| :-------------------------------------------------------------------------------- | :------ | :--------- | :----------- | :------- | :------------------- | :------------- | :--------------- | -| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Slower | Adaptive (always on) | `high` | Jun 2026 | -| [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | 1M | 128K | $4 / $20 | Moderate | Adaptive (always on) | `medium` | Jun 2026 | -| **Claude Sonnet 5.5** (this model) | 1M | 128K | $2 / $10 | Fast | Adaptive | `high` | Jun 2026 | -| [Claude Haiku 4.5](https://platform.claude.com/docs/en/models/haiku-4-5/overview) | 200K | 64K | $1 / $5 | Fastest | Extended | — | Feb 2025 | +| Model | Context | Max output | Price / MTok | Latency | Thinking | Default effort | Knowledge cutoff | +| :-------------------------------------------------------------------------------- | :------ | :--------- | :----------------- | :------- | :------------------- | :------------- | :--------------- | +| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Slower | Adaptive (always on) | `high` | Jun 2026 | +| [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | 1M | 128K | $4 / $20 | Moderate | Adaptive (always on) | `medium` | Jun 2026 | +| **Claude Sonnet 5.5** (this model) | 1M | 128K | $2 / $10 | Fast | Adaptive | `high` | Jun 2026 | +| [Claude Haiku 5.5](https://platform.claude.com/docs/en/models/haiku-5-5/overview) | 1M | 128K | From $0.10 / $0.50 | Fastest | Adaptive | `medium` | Jun 2026 | * **Context:** 1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer (introduced with Claude Opus 4.7); models before it fit about 750k words in 1M tokens. 200k tokens is roughly 150k words. -* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. -* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5). See Pricing for the full list. +* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 5.5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header. +* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5 and Claude Sonnet 5.5). See Pricing for the full list. * **Latency:** Comparative latency, relative to the current lineup, as published in the models overview. Actual latency depends on prompt length, output length, and thinking effort. * **Thinking:** Adaptive thinking lets the model decide how much to think, steered by effort. Extended thinking is the manual budget\_tokens mode on earlier models. * **Default effort:** The effort parameter’s default on the Claude API. Models without a value don’t support the parameter. @@ -65,7 +65,7 @@ One more change alters the response shape without failing any request: [text bet | Output | $10 / MTok | | [5m cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $2.50 / MTok | | [1h cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $4 / MTok | -| [Cache read](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.20 / MTok | +| [Cache read](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.10 / MTok | | [Batch API](https://platform.claude.com/docs/en/build-with-claude/batch-processing) | 50% discount on input and output | [Full price list](https://platform.claude.com/docs/en/about-claude/pricing) diff --git a/llmsdk_docs/claude5_5/docs/pricing.md b/llmsdk_docs/claude5_5/docs/pricing.md new file mode 100644 index 00000000..65d4baeb --- /dev/null +++ b/llmsdk_docs/claude5_5/docs/pricing.md @@ -0,0 +1,536 @@ +--- +title: Pricing +url: https://platform.claude.com/docs/en/about-claude/pricing +description: Learn about Anthropic's pricing structure for models and features +--- + +This page provides detailed pricing information for Anthropic's models and features. All prices are in USD. + +For the most current pricing information, visit [claude.com/pricing](https://claude.com/pricing). + +## Model pricing + +The following table shows pricing for all Claude models: + +| Model | Base input tokens | 5m cache writes | 1h cache writes | Cache hits and refreshes | Output tokens | +| :----------------------------------------------------------------------------------------------------------------------------------- | :-------------------- | :-------------- | :-------------- | :----------------------- | :--------------------- | +| Claude Fable 5.1 | $10 / MTok | $12.50 / MTok | $20 / MTok | $0.25 / MTok1 | $50 / MTok | +| Claude Mythos 5.1 ([limited availability](https://support.claude.com/en/articles/14604842)) | $10 / MTok | $12.50 / MTok | $20 / MTok | $0.25 / MTok1 | $50 / MTok | +| Claude Fable 5 | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok | +| Claude Mythos 5 ([limited availability](https://support.claude.com/en/articles/14604842)) | $10 / MTok | $12.50 / MTok | $20 / MTok | $1 / MTok | $50 / MTok | +| Claude Opus 5.5 | $4 / MTok | $5 / MTok | $8 / MTok | $0.20 / MTok2 | $20 / MTok | +| Claude Opus 5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok | +| Claude Opus 4.8 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok | +| Claude Opus 4.7 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok | +| Claude Opus 4.6 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok | +| Claude Opus 4.5 | $5 / MTok | $6.25 / MTok | $10 / MTok | $0.50 / MTok | $25 / MTok | +| Claude Opus 4.1 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok | +| Claude Opus 4 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok | +| Claude Sonnet 5.5 | $2 / MTok | $2.50 / MTok | $4 / MTok | $0.10 / MTok2 | $10 / MTok | +| Claude Sonnet 5 | $2 / MTok3 | $2.50 / MTok | $4 / MTok | $0.20 / MTok | $10 / MTok3 | +| Claude Sonnet 4.6 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok | +| Claude Sonnet 4.5 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok | +| Claude Sonnet 4 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok | +| Claude Haiku 5.5 (for prompts up to 100,000 tokens) | $0.10 / MTok | $0.125 / MTok | $0.20 / MTok | $0.01 / MTok | $0.50 / MTok | +| Claude Haiku 5.5 (for prompts over 100,000 tokens) | $0.50 / MTok | $0.625 / MTok | $1 / MTok | $0.05 / MTok | $2.50 / MTok | +| Claude Haiku 4.5 | $1 / MTok | $1.25 / MTok | $2 / MTok | $0.10 / MTok | $5 / MTok | +| Claude Haiku 3.5 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $0.80 / MTok | $1 / MTok | $1.60 / MTok | $0.08 / MTok | $4 / MTok | + +*1 Cache hits and refreshes on Claude Fable 5.1 and Claude Mythos 5.1 are priced at 0.025x the base input price.* + +*2 Cache hits and refreshes on Claude Opus 5.5 and Claude Sonnet 5.5 are priced at 0.05x the base input price.* + +*All other models use the standard 0.1x multiplier.* + +*3 The $2/$10 per million input/output token pricing for Claude Sonnet 5, announced at launch as introductory pricing through August 31, 2026, is now the standard price. The previously scheduled increase to $3/$15 per million input/output tokens on September 1, 2026 will not occur.* + +* **MTok:** Million tokens. $5 / MTok is $5 for every million tokens. +* **5m cache writes:** Writing a prompt prefix to the 5-minute prompt cache. +* **1h cache writes:** Writing a prompt prefix to the 1-hour prompt cache. +* **Cache hits and refreshes:** Reading a prompt prefix from the prompt cache, which also refreshes it. +* **Limited access:** Available only to organizations verified through Anthropic’s verification programs, such as the [Cyber Verification Program](https://support.claude.com/en/articles/14604842). To request access, apply to the program that covers your use case. +* **Retired:** May still be available on other cloud platforms. See [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations) for more. + +Claude 4.7 and later models and Claude Mythos Preview use a newer tokenizer that contributes to their improved performance on a wide range of tasks. This tokenizer produces approximately 30% more tokens for the same text. The exact increase depends on the content and workload shape. Claude Sonnet 4.6 and earlier models use the previous tokenizer. + +## Cloud platform pricing + +This section covers partner-operated cloud platforms, where the cloud provider invoices you. For Anthropic-operated cloud platforms billed through a marketplace, see [Claude Platform on AWS pricing](https://platform.claude.com/docs/en/about-claude/pricing#claude-platform-on-aws-pricing) and [Claude in Microsoft Foundry pricing](https://platform.claude.com/docs/en/about-claude/pricing#claude-in-microsoft-foundry-pricing). + +Claude models are available on [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) and [Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai). For official pricing, visit: + +* [Amazon Bedrock pricing](https://aws.amazon.com/bedrock/pricing/) +* [Google Cloud pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models) + + + **Regional and multi-region endpoint pricing for Claude 4.5 models and beyond** + + Starting with Claude Sonnet 4.5, Haiku 4.5, and Opus 4.5: + + * **Bedrock** offers two endpoint types: global endpoints (dynamic routing for maximum availability) and regional endpoints (guaranteed data routing through specific geographic regions). + * **Google Cloud** offers global endpoints and multi-region endpoints (dynamic routing within a geographic area) for these models, and regional endpoints for Claude Sonnet 4.6 and earlier models. + + Regional and multi-region endpoints include a 10% premium over global endpoints. The Claude API (first-party) is global by default; for first-party data residency options and pricing, see [Data residency pricing](https://platform.claude.com/docs/en/about-claude/pricing#data-residency-pricing). + + **Scope:** This pricing structure applies to Claude Sonnet 4.5 (deprecated), Haiku 4.5, Opus 4.5, and all future models. Earlier models (Claude Opus 4.1 and prior releases) retain their existing pricing. + + For implementation details and code examples: + + * [Amazon Bedrock global vs regional endpoints](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock#regions) for Opus 4.7, Haiku 4.5, and later models, or [the legacy integration](https://platform.claude.com/docs/en/build-with-claude/claude-on-amazon-bedrock-legacy#global-vs-regional-endpoints) for all other models on Bedrock + * [Google Cloud global, multi-region, and regional endpoints](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai#global-multi-region-and-regional-endpoints) + + +## Claude Platform on AWS pricing + +[Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) bills through AWS Marketplace using Claude Consumption Units (CCUs). Anthropic rates your token usage in USD at standard per-model, per-feature rates, applies any negotiated discount, converts the result to CCUs at $0.01 per CCU, and reports the CCU quantity to AWS Marketplace hourly. Your AWS bill shows a single CCU line item. + +| Concept | Details | +| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Billing unit** | Claude Consumption Unit (CCU) | +| **CCU price** | $0.01 per CCU (fixed; discounts apply at token-to-CCU conversion, not to the CCU price) | +| **Conversion** | Token usage rated in USD at standard per-model, per-feature rates (same as [Claude API pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing)), then converted to CCUs at $0.01 per CCU | +| **Billing cadence** | Hourly metering to AWS Marketplace; monthly invoices | +| **Payment model** | Arrears only (postpaid); no prepaid credits | +| **Discounts** | Applied as fewer CCUs metered | +| **Tax** | Pre-tax metering; AWS Marketplace handles tax | +| **Cost visibility** | Real-time breakdown in the Claude Console (access through the AWS Console); AWS Cost Explorer shows aggregated CCU | + +**CCU:** Claude Consumption Unit. A CCU is a unit of measure used solely for Marketplace Platform invoicing. If Customer accesses the Services through certain Marketplace Platforms (e.g., Claude Platform on AWS), usage will be invoiced in Claude Consumption Units ("CCU") rather than per MTok. One hundred (100) CCU represents $1.00 USD of fees owed for the Services, calculated at the applicable prices on [claude.com/pricing#api](https://claude.com/pricing#api), after application of any discounts. + +### Inference geography + +For Claude 4.6 and later models, using `inference_geo: "us"` applies a 1.1x pricing multiplier. `inference_geo: "global"` (default) uses standard pricing. See [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency) for details. + +### Private offers + +When you sign up on the AWS Console **Claude Platform on AWS** service page, the AWS Console looks up any private offer associated with your account and prompts you to accept it in AWS Marketplace. Contact your Anthropic account representative for private offer terms. + + + If you have an existing Amazon Bedrock private offer, contact your Anthropic or AWS account representative before getting started with Claude Platform on AWS to ensure your discounts are applied correctly. Discounts cannot be applied retroactively to usage incurred before your private offer is accepted. + + +## Claude in Microsoft Foundry pricing + +[Claude in Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) bills through the Azure Marketplace using Claude Consumption Units (CCUs). Anthropic rates your token usage in USD at standard per-model, per-feature rates, applies any negotiated discount, converts the result to CCUs at $0.01 per CCU, and reports the CCU quantity to the Azure Marketplace hourly. Your Azure bill shows a single CCU line item. + +| Concept | Details | +| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Billing unit** | Claude Consumption Unit (CCU) | +| **CCU price** | $0.01 per CCU (fixed; discounts apply at token-to-CCU conversion, not to the CCU price) | +| **Conversion** | Token usage rated in USD at standard per-model, per-feature rates (same as [Claude API pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing)), then converted to CCUs at $0.01 per CCU | +| **Billing cadence** | Hourly metering to the Azure Marketplace; monthly invoices | +| **Payment model** | Arrears only (postpaid); no prepaid credits | +| **Discounts** | Applied as fewer CCUs metered | +| **Tax** | Pre-tax metering; Azure Marketplace handles tax | +| **Cost visibility** | Azure Cost Management shows aggregated CCU | + +**CCU:** Claude Consumption Unit. A CCU is a unit of measure used solely for Marketplace Platform invoicing. If Customer accesses the Services through certain Marketplace Platforms (e.g., Claude Platform on AWS, Claude in Microsoft Foundry), usage will be invoiced in Claude Consumption Units ("CCU") rather than per MTok. One hundred (100) CCU represents $1.00 USD of fees owed for the Services, calculated at the applicable prices on [claude.com/pricing#api](https://claude.com/pricing#api), after application of any discounts. + +### Inference geography + +Deployments hosted on Azure can use the US Data Zone Standard deployment type, which keeps inference within the United States. This is equivalent to `inference_geo: "us"` on the Claude API and applies the same 1.1x pricing multiplier. See [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency) for details. + +## Feature-specific pricing + +### Prompt caching + +Prompt caching reduces costs and latency by reusing previously processed portions of your prompt across API calls. Instead of reprocessing the same large system prompt, document, or conversation history on every request, the API reads from cache at a fraction of the standard input price. + +There are two ways to enable prompt caching: + +* **Automatic caching:** Add a single `cache_control` field at the top level of your request. The system automatically manages cache breakpoints as conversations grow. This is the recommended starting point for most use cases. +* **Explicit cache breakpoints:** Place `cache_control` directly on individual content blocks for fine-grained control over exactly what gets cached. + +Prompt caching uses the following pricing multipliers relative to base input token rates: + +| Cache operation | Multiplier | Duration | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------ | +| 5-minute cache write | 1.25x base input price | Cache valid for 5 minutes | +| 1-hour cache write | 2x base input price | Cache valid for 1 hour | +| Cache read (hit) | 0.1x base input price (0.025x on Claude Fable 5.1 and Claude Mythos 5.1; 0.05x on Claude Opus 5.5 and Claude Sonnet 5.5) | Same duration as the preceding write | + +Cache write tokens are charged when content is first stored. Cache read tokens are charged when a subsequent request retrieves the cached content. A cache hit costs 10% of the standard input price, which means caching pays off after one cache read for the 5-minute duration (1.25x write), or after two cache reads for the 1-hour duration (2x write). On Claude Fable 5.1 and Claude Mythos 5.1, a cache hit costs 2.5% of the standard input price ($0.25 USD per million tokens). On Claude Opus 5.5 and Claude Sonnet 5.5, a cache hit costs 5% of the standard input price ($0.20 USD per million tokens on Claude Opus 5.5, $0.10 USD on Claude Sonnet 5.5). + +These multipliers stack with other pricing modifiers, including the Batch API discount and data residency. + +For implementation details, supported models, and code examples, see [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching). + +### Data residency pricing + +For Claude 4.6 and later models, specifying US-only inference through the `inference_geo` parameter incurs a 1.1x multiplier on all token pricing categories, including input tokens, output tokens, cache writes, and cache reads. On Claude Haiku 5.5, the multiplier also applies to the higher prices for prompts over 100,000 tokens (see [Long context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing)). Global routing (the default) uses standard pricing. + +This applies to the Claude API (first-party) and Claude Platform on AWS. On Claude in Microsoft Foundry, the same 1.1x multiplier applies to deployments that use the US Data Zone Standard deployment type (see [Inference geography](https://platform.claude.com/docs/en/about-claude/pricing#foundry-inference-geography)). Partner-operated platforms (Bedrock and Google Cloud) have independent regional pricing. See [Bedrock](https://aws.amazon.com/bedrock/pricing/) and [Google Cloud](https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models) for details. Earlier models do not support the `inference_geo` parameter and always use standard pricing; requests that include the parameter on these models return a 400 error. + +For more information, see [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency). + +### Fast mode pricing + +[Fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode), in research preview, provides significantly faster output for Claude Opus 5.5, Claude Opus 5, and Claude Opus 4.8 at premium pricing. Fast mode pricing applies across the full context window, including requests over 200k input tokens. Fast mode is available on the Claude API (first-party) only; it is not available on Claude Platform on AWS or partner-operated cloud platforms. + +| Model | Input | Output | +| ------------------------------- | ---------- | ---------- | +| Claude Opus 5.5 | $8 / MTok | $40 / MTok | +| Claude Opus 5 / Claude Opus 4.8 | $10 / MTok | $50 / MTok | + +Fast mode is not available on Claude Opus 4.7 (requests with `speed: "fast"` return an error) or Claude Opus 4.6 (requests run at standard speed and are billed at standard rates). See [Fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode#supported-models). + +Fast mode pricing stacks with other pricing modifiers: + +* [Prompt caching multipliers](https://platform.claude.com/docs/en/about-claude/pricing#prompt-caching) apply on top of fast mode pricing +* [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency) multipliers apply on top of fast mode pricing + +Fast mode is not available with the [Batch API](https://platform.claude.com/docs/en/about-claude/pricing#batch-processing). + +For more information, see [Fast mode](https://platform.claude.com/docs/en/build-with-claude/fast-mode). + +### Batch processing + +The Batch API allows asynchronous processing of large volumes of requests with a 50% discount on both input and output tokens. + +| Model | Batch input | Batch output | +| :----------------------------------------------------------------------------------------------------------------------------------- | :----------- | :------------ | +| Claude Fable 5.1 | $5 / MTok | $25 / MTok | +| Claude Mythos 5.1 ([limited availability](https://support.claude.com/en/articles/14604842)) | $5 / MTok | $25 / MTok | +| Claude Fable 5 | $5 / MTok | $25 / MTok | +| Claude Mythos 5 ([limited availability](https://support.claude.com/en/articles/14604842)) | $5 / MTok | $25 / MTok | +| Claude Opus 5.5 | $2 / MTok | $10 / MTok | +| Claude Opus 5 | $2.50 / MTok | $12.50 / MTok | +| Claude Opus 4.8 | $2.50 / MTok | $12.50 / MTok | +| Claude Opus 4.7 | $2.50 / MTok | $12.50 / MTok | +| Claude Opus 4.6 | $2.50 / MTok | $12.50 / MTok | +| Claude Opus 4.5 | $2.50 / MTok | $12.50 / MTok | +| Claude Opus 4.1 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $7.50 / MTok | $37.50 / MTok | +| Claude Opus 4 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $7.50 / MTok | $37.50 / MTok | +| Claude Sonnet 5.5 | $1 / MTok | $5 / MTok | +| Claude Sonnet 5 | $1 / MTok | $5 / MTok | +| Claude Sonnet 4.6 | $1.50 / MTok | $7.50 / MTok | +| Claude Sonnet 4.5 | $1.50 / MTok | $7.50 / MTok | +| Claude Sonnet 4 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $1.50 / MTok | $7.50 / MTok | +| Claude Haiku 5.5 (for prompts up to 100,000 tokens) | $0.05 / MTok | $0.25 / MTok | +| Claude Haiku 5.5 (for prompts over 100,000 tokens) | $0.25 / MTok | $1.25 / MTok | +| Claude Haiku 4.5 | $0.50 / MTok | $2.50 / MTok | +| Claude Haiku 3.5 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | $0.40 / MTok | $2 / MTok | + +* **MTok:** Million tokens. $5 / MTok is $5 for every million tokens. +* **Limited access:** Available only to organizations verified through Anthropic’s verification programs, such as the [Cyber Verification Program](https://support.claude.com/en/articles/14604842). To request access, apply to the program that covers your use case. +* **Retired:** May still be available on other cloud platforms. See [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations) for more. + +For more information about batch processing, see [Batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing). + +### Long context pricing + +Claude 4.6 and later models (except Claude Haiku 5.5) and [Claude Mythos Preview](https://anthropic.com/glasswing) include the full [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) at standard pricing. (A 900k-token request is billed at the same per-token rate as a 9k-token request.) Prompt caching and batch processing discounts apply at standard rates across the full context window. + +Claude Haiku 5.5 is priced by prompt length: a request whose prompt is over 100,000 tokens pays higher prices. A request's prompt length counts all of its input tokens, including cache reads and cache writes. Each request is priced on its own: a request over the threshold pays the higher prices even when part of its prompt is a cache hit, and earlier requests keep the prices they were billed at. [Model pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing) and [Batch processing](https://platform.claude.com/docs/en/about-claude/pricing#batch-processing) list both sets of prices. + +### Tool use pricing + +Tool use requests are priced based on: + +1. The total number of input tokens sent to the model (including in the `tools` parameter) +2. The number of output tokens generated +3. For server-side tools, additional usage-based pricing (for example, web search charges per search performed) + +Client-side tools are priced the same as any other Claude API request, although server-side tools can incur additional charges based on their specific usage. + +The additional tokens from tool use come from: + +* The `tools` parameter in API requests (tool names, descriptions, and schemas) +* `tool_use` content blocks in API requests and responses +* `tool_result` content blocks in API requests + +When you use `tools`, the API also automatically includes a special system prompt for the model that enables tool use. The number of tool use tokens required for each model is listed in the following table (excluding the additional tokens listed earlier). Note that the table assumes at least 1 tool is provided. If no `tools` are provided, then a tool choice of `none` uses 0 additional system prompt tokens. + +| Model | Tool use system prompt tokens: auto, none | Tool use system prompt tokens: any, tool | +| :----------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------- | :--------------------------------------- | +| Claude Opus 5.5 | 286 tokens | | +| Claude Opus 5 | 286 tokens | 406 tokens | +| Claude Opus 4.8 | 290 tokens | 410 tokens | +| Claude Opus 4.7 | 675 tokens | 804 tokens | +| Claude Opus 4.6 | 497 tokens | 589 tokens | +| Claude Opus 4.5 | 496 tokens | 588 tokens | +| Claude Opus 4.1 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | 313 tokens | 315 tokens | +| Claude Opus 4 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | 313 tokens | 315 tokens | +| Claude Sonnet 5.5 | 286 tokens | | +| Claude Sonnet 5 | 354 tokens | 474 tokens | +| Claude Sonnet 4.6 | 497 tokens | 589 tokens | +| Claude Sonnet 4.5 | 496 tokens | 588 tokens | +| Claude Sonnet 4 ([retired, except on Bedrock and Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | 313 tokens | 315 tokens | +| Claude Haiku 5.5 | 286 tokens | 406 tokens | +| Claude Haiku 4.5 | 496 tokens | 588 tokens | +| Claude Haiku 3.5 ([retired, except on Google Cloud](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | 264 tokens | 355 tokens | + +* **auto, none:** The count when tool\_choice is auto or none. +* **any, tool:** The count when tool\_choice is any or tool. +* **Retired:** May still be available on other cloud platforms. See [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations) for more. + +These token counts are added to your normal input and output tokens to calculate the total cost of a request. + +For current per-model prices, refer to the [model pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing) section. + +For more information about tool use implementation and best practices, see [Tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview). + +### Specific tool pricing + +#### Bash tool + +The bash tool definition adds the following input tokens to your request. This is in addition to the per-model [tool use system prompt](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview#pricing) that applies whenever any tool is present. + +| Model | Additional input tokens | +| ----------------------------------------------------- | ----------------------- | +| Claude 4.7 and later models and Claude Mythos Preview | 325 tokens | +| Claude 4.6 and earlier models | 244 tokens | + +Additional tokens are consumed by: + +* Command outputs (stdout/stderr) +* Error messages +* Large file contents + +See [tool use pricing](https://platform.claude.com/docs/en/about-claude/pricing#tool-use-pricing) for complete pricing details. + +#### Code execution tool + +**Code execution is free when used with web search or web fetch.** When `web_search_20260209` (or later) or `web_fetch_20260209` (or later) is included in your API request, there are no additional charges for code execution tool calls beyond the standard input and output token costs. + +When used without these tools, code execution is billed by execution time, tracked separately from token usage: + +* Execution time has a minimum of 5 minutes +* Each organization receives **1,550 free hours** of usage per month +* Additional usage beyond 1,550 hours is billed at **$0.05 USD per hour, per container** +* If files are included in the request, execution time is billed even if the tool is not called, because files are preloaded onto the container + +Code execution usage is tracked in the response: + +```json +{ + "usage": { + "input_tokens": 105, + "output_tokens": 239, + "server_tool_use": { + "code_execution_requests": 1 + } + } +} +``` + +#### Text editor tool + +The text editor tool uses the same pricing structure as other tools used with Claude. It follows the standard input and output token pricing based on the Claude model you're using. + +In addition to the base tokens, the following additional input tokens are needed for the text editor tool: + +| Tool | Additional input tokens | +| ------------------------------------------------------------------------------ | ----------------------- | +| `text_editor_20250728` (Claude 4.7 and later models and Claude Mythos Preview) | 974 tokens | +| `text_editor_20250728` (Claude 4.6 and earlier models) | 745 tokens | + +See [tool use pricing](https://platform.claude.com/docs/en/about-claude/pricing#tool-use-pricing) for complete pricing details. + +#### Web search tool + +Web search usage is charged in addition to token usage: + +```json +{ + "usage": { + "input_tokens": 105, + "output_tokens": 6039, + "cache_read_input_tokens": 7123, + "cache_creation_input_tokens": 7345, + "server_tool_use": { + "web_search_requests": 1 + } + } +} +``` + +Web search is available on the Claude API for **$10 per 1,000 searches**, plus standard token costs for search-generated content. Web search results retrieved throughout a conversation are counted as input tokens, in search iterations executed during a single turn and in subsequent conversation turns. + +Each web search counts as one use, regardless of the number of results returned. If an error occurs during web search, the web search will not be billed. + +#### Web fetch tool + +Web fetch usage has **no additional charges** beyond standard token costs: + +```json +{ + "usage": { + "input_tokens": 25039, + "output_tokens": 931, + "cache_read_input_tokens": 0, + "cache_creation_input_tokens": 0, + "server_tool_use": { + "web_fetch_requests": 1 + } + } +} +``` + +The web fetch tool is available on the Claude API at **no additional cost**. You only pay standard token costs for the fetched content that becomes part of your conversation context. + +To protect against inadvertently fetching large content that would consume excessive tokens, use the `max_content_tokens` parameter to set appropriate limits based on your use case and budget considerations. + +Example token usage for typical content: + +* Average web page (10 kB): \~2,500 tokens +* Large documentation page (100 kB): \~25,000 tokens +* Research paper PDF (500 kB): \~125,000 tokens + +#### Computer use tool + +Computer use follows the standard [tool use pricing](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview#pricing). When using the computer use tool: + +**Toolset definition overhead:** Declaring `computer_toolset_20260801` with its default members adds about 4,500 input tokens to a request (about 4,590 on Claude Sonnet 5 and about 4,520 on the other supported models), which covers the member tool definitions and the tool use system prompt. Disabling `zoom` with `configs` removes about 410 of those tokens. The exact count for a request is reported in the response `usage`, and you can estimate it in advance with the [token counting endpoint](https://platform.claude.com/docs/en/build-with-claude/token-counting). + +**Earlier tool versions:** The following figures apply to the `computer_20251124` and `computer_20250124` tool versions, not to `computer_toolset_20260801`: + +* System prompt overhead: 466–499 tokens added to the system prompt +* Tool definition: about 735 input tokens per tool definition (measured with `computer_20250124`) + +**Additional token consumption:** + +* Screenshot and zoom images returned in tool results, billed as image input (see [Vision pricing](https://platform.claude.com/docs/en/build-with-claude/vision#evaluate-image-size)) +* Tool execution results returned to Claude + + + If you're also using bash or text editor tools alongside computer use, those tools have their own token costs as documented in their respective pages. + + +#### Browser use tool + +Browser use follows the standard [tool use pricing](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview#pricing). When using the browser use tool: + +**Toolset definition overhead:** Declaring `browser_toolset_20260801` with its default members adds about 6,600 input tokens to a request (about 6,670 on Claude Sonnet 5 and about 6,610 on the other supported models), which covers the member tool definitions and the tool use system prompt. Enabling all four optional members adds about 880 tokens, and disabling members with `configs` reduces the count. The exact count for a request is reported in the response `usage`, and you can estimate it in advance with the [token counting endpoint](https://platform.claude.com/docs/en/build-with-claude/token-counting). + +**Additional token consumption:** + +* Screenshot and zoom images returned in tool results, billed as image input (see [Vision pricing](https://platform.claude.com/docs/en/build-with-claude/vision#evaluate-image-size)) +* Text tool results returned to Claude, such as accessibility trees, page text, and console or network entries + + + If you also use the computer use tool, bash tool, text editor tool, or your own tools alongside browser use, those tools have their own token costs as documented on their respective pages. + + +## Claude Managed Agents pricing + +[Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) is billed on two dimensions: tokens and session runtime. + +### Tokens + +All tokens consumed by a Claude Managed Agents session are billed at the rates shown in [Model pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing). [Prompt caching](https://platform.claude.com/docs/en/about-claude/pricing#prompt-caching) multipliers apply identically. Web search triggered inside a session incurs the standard $10 per 1,000 searches. On [Claude Platform on AWS](https://platform.claude.com/docs/en/about-claude/pricing#claude-platform-on-aws-pricing), session token and runtime charges convert to Claude Consumption Units at the standard rate. [Fast mode](https://platform.claude.com/docs/en/about-claude/pricing#fast-mode-pricing) premium pricing applies when an agent's `model.speed` is set to `"fast"`. + +The [data residency multiplier](https://platform.claude.com/docs/en/about-claude/pricing#data-residency-pricing) also applies: when an agent's `model.inference_geo` is pinned to `"us"`, tokens consumed by sessions running that agent are billed at 1.1x the standard rates, the same multiplier that applies to US-only inference on the Messages API. + +The following Messages API modifiers do **not** apply to Claude Managed Agents sessions: + +| Modifier | Why it doesn't apply | +| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | +| [Batch API discount](https://platform.claude.com/docs/en/about-claude/pricing#batch-processing) | Sessions are stateful and interactive. There is no batch mode. | +| [Cloud platform pricing](https://platform.claude.com/docs/en/about-claude/pricing#cloud-platform-pricing) | Not available on partner-operated cloud platforms. | + +### Session runtime + +| SKU | Rate | Metering | +| --------------- | ---------------------- | ------------------------- | +| Session runtime | $0.08 per session-hour | `running` status duration | + +Runtime is measured to the millisecond and accrues only while the session's status is `running`. Time spent `idle` (waiting for your next message or a tool confirmation), `rescheduling`, or `terminated` does not count toward runtime. + + + Session runtime replaces the [code execution](https://platform.claude.com/docs/en/about-claude/pricing#code-execution-tool) container-hour billing model when using Claude Managed Agents. You are not separately billed for container hours on top of session runtime. + + +### Worked example + +A one-hour coding session using Claude Opus 5 that consumes 50,000 input tokens and 15,000 output tokens: + +| Line item | Calculation | Cost | +| --------------- | ------------------------ | ---------- | +| Input tokens | 50,000 × $5 / 1,000,000 | $0.25 | +| Output tokens | 15,000 × $25 / 1,000,000 | $0.375 | +| Session runtime | 1.0 hour × $0.08 | $0.08 | +| **Total** | | **$0.705** | + +If prompt caching is active and 40,000 of the input tokens are cache reads: + +| Line item | Calculation | Cost | +| --------------------- | ----------------------------- | ---------- | +| Uncached input tokens | 10,000 × $5 / 1,000,000 | $0.05 | +| Cache read tokens | 40,000 × $5 × 0.1 / 1,000,000 | $0.02 | +| Output tokens | 15,000 × $25 / 1,000,000 | $0.375 | +| Session runtime | 1.0 hour × $0.08 | $0.08 | +| **Total** | | **$0.525** | + +## Additional pricing considerations + +### Cost optimization strategies + +When building agents with Claude: + +1. **Use appropriate models:** Choose Haiku for simple tasks, Sonnet for most production workloads, and Opus for the most complex reasoning +2. **Implement prompt caching:** Reduce costs for repeated context +3. **Batch operations:** Use the Batch API for non-time-sensitive tasks +4. **Monitor usage patterns:** Track token consumption to identify optimization opportunities + + + For high-volume agent applications, contact the [enterprise sales team](https://claude.com/contact-sales) for custom pricing arrangements. + + +### Rate limits + +Rate limits vary by usage tier and affect how many requests you can make: + +* **Start tier:** Entry-level limits for getting started +* **Build tier:** Increased limits for growing applications +* **Scale tier:** Highest standard limits for production workloads + +For detailed rate limit information, see [Rate limits](https://platform.claude.com/docs/en/api/rate-limits). + +For limits beyond the Scale tier or custom pricing arrangements, [contact the sales team](https://claude.com/contact-sales). + +### Volume discounts + +Volume discounts may be available for high-volume users. These are negotiated on a case-by-case basis. + +* Standard usage tiers use the pricing shown in [Model pricing](https://platform.claude.com/docs/en/about-claude/pricing#model-pricing) +* Enterprise customers can [contact sales](mailto:sales@anthropic.com) for custom pricing +* Academic and research discounts may be available + +### Enterprise pricing + +For enterprise customers with specific needs: + +* Custom rate limits +* Volume discounts +* Dedicated support +* Custom terms + +Contact the sales team at [sales@anthropic.com](mailto:sales@anthropic.com) or through the [Claude Console](https://platform.claude.com/usage/limits) to discuss enterprise pricing options. + +## Billing and payment + +* Billing is based on actual monthly usage +* All payments are in USD +* Credit card and invoicing options available +* Usage tracking available in the [Claude Console](https://platform.claude.com/) + +## Frequently asked questions + +### How is token usage calculated? + +Tokens are pieces of text that models process. How many tokens the same text produces depends on the model's tokenizer, the language, and the type of content. Claude 4.7 and later models and Claude Mythos Preview use a newer tokenizer that produces approximately 30 percent more tokens for the same text than earlier models. To see how many tokens a request uses on a specific model, count it with [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) and that model's ID. + +### Are there free tiers or trials? + +New users receive a small amount of free credits to test the API. [Contact sales](mailto:sales@anthropic.com) for information about extended trials for enterprise evaluation. + +### How do discounts stack? + +Batch API and prompt caching discounts can be combined. For example, using both features together provides significant cost savings compared to standard API calls. See [prompt caching pricing](https://platform.claude.com/docs/en/about-claude/pricing#prompt-caching) for how the multipliers interact. + +### What payment methods are accepted? + +Major credit cards are accepted for standard accounts. Enterprise customers can arrange invoicing and other payment methods. + +For additional questions about pricing, contact [support@anthropic.com](mailto:support@anthropic.com). diff --git a/llmsdk_docs/claude5_5/docs/whats-new-haiku-5-5.md b/llmsdk_docs/claude5_5/docs/whats-new-haiku-5-5.md new file mode 100644 index 00000000..eed81e09 --- /dev/null +++ b/llmsdk_docs/claude5_5/docs/whats-new-haiku-5-5.md @@ -0,0 +1,61 @@ +--- +title: What's new in Claude Haiku 5.5 +url: https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5 +description: Overview of new capabilities, breaking changes, and behavior changes in Claude Haiku 5.5, with a link to each feature's guide and to the migration guide for code changes. +--- + +Claude Haiku 5.5 is built for high-volume, latency-sensitive work such as classification, routing, extraction, and subagent tasks. It supports adaptive thinking with the effort parameter, a 1M token context window, and up to 128k output tokens. It uses the same newer tokenizer as Claude 4.7 and later models, so the same text counts as approximately 30% more tokens than on Claude Haiku 4.5. Its thinking blocks work only in the account that produced them, or in an account linked to it. + +For code changes, see the [migration guide](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide). For model IDs, pricing, and limits, see the [Claude Haiku 5.5 overview](https://platform.claude.com/docs/en/models/haiku-5-5/overview). For prompting guidance, see [Prompting Claude Haiku 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-haiku-5-5). + +## Summary of changes from Claude Haiku 4.5 + +Each row names one change, whether it is new, changed, or breaking, and what your code has to do. + +| Change | Type | Action needed | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| [Adaptive thinking and effort](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#adaptive-thinking-and-effort) | New | Optional: set `effort` to trade response quality against speed and cost. | +| [Larger context window and output](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#larger-context-window-and-output) | New | None. Existing `max_tokens` values stay valid, but thinking tokens count toward them. Long prompts are billed at higher prices; see [Long context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing). | +| [Browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool) | New | None. Available on the Claude API and Google Cloud. | +| [Safety classifiers can decline a request](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response) | New | Handle `stop_reason: "refusal"` in your client. Server-side fallback isn't available. | +| [Manual extended thinking returns an error](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking) | Breaking | Replace `budget_tokens` with adaptive thinking. | +| [Sampling parameters can return an error](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#remove-sampling-parameters) | Breaking | Omit `temperature`, `top_p`, and `top_k`. | +| [Assistant message prefill returns an error](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#replace-assistant-prefill) | Breaking | End `messages` with a user turn. | +| [`computer_20250124` returns an error on the Claude API, Google Cloud, and Amazon Bedrock](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#computer-use-toolset) | Breaking | Replace it with `computer_toolset_20260801` on the Claude API and Google Cloud, or with `computer_20251124` on Amazon Bedrock. | +| [Structured outputs aren't available on Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) | Breaking | On Amazon Bedrock, describe the format in the prompt or use a tool without `strict`, and validate the output in your code. | +| [Changing earlier turns invalidates thinking blocks](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#keep-earlier-turns-unchanged) | Breaking | Keep conversations append-only if you send thinking blocks back. | +| [Responses can begin with thinking blocks](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#responses-can-begin-with-thinking-blocks) | Changed | Select content blocks by `type`, not by position. | +| [Thinking text is omitted by default](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking) | Changed | To receive summarized thinking, set `thinking.display` to `"summarized"`. | +| [Same text counts as more tokens](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#same-text-counts-as-more-tokens) | Changed | Recount prompts and revisit `max_tokens` and cost estimates. | +| [Replaying thinking blocks across accounts](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#replaying-thinking-blocks-across-accounts) | Changed | If you replay stored conversations through a different account, replay each through the account that produced it. | +| [Earlier thinking blocks stay in context](https://platform.claude.com/docs/en/models/haiku-5-5/whats-new-haiku-5-5#earlier-thinking-blocks-stay-in-context) | Changed | Expect more input tokens in multi-turn conversations. To remove older blocks, use [thinking block clearing](https://platform.claude.com/docs/en/build-with-claude/context-editing#thinking-block-clearing). | +| [Shorter prompts can be cached](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations) | Changed | None. The minimum cacheable prompt length is 512 tokens, down from 4,096 on Claude Haiku 4.5, so a prompt in between that sets `cache_control` is cached on Claude Haiku 5.5. | +| [Context awareness tags aren't injected](https://platform.claude.com/docs/en/build-with-claude/context-windows#context-awareness) | Changed | To give the model an explicit budget for an agentic loop, use [task budgets](https://platform.claude.com/docs/en/build-with-claude/task-budgets) (beta). | + +## New capabilities + +### Adaptive thinking and effort + +With [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking), Claude Haiku 5.5 determines when and how much to think. Adaptive thinking is on by default. While you can still turn thinking off with `thinking: {"type": "disabled"}` at `high` effort or below, the better way to trade response quality against speed and cost is to use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort). + +### Larger context window and output + +Claude Haiku 5.5 has a 1M token [context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) and returns up to 128k output tokens, up from 200k and 64k on Claude Haiku 4.5. Existing `max_tokens` values stay valid, but thinking tokens count toward `max_tokens`, so a small limit can stop after a `thinking` block and before any text. See [Configure thinking](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking). Long prompts are billed at higher prices; see [Long context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing). + +## Behavior changes + +### Responses can begin with thinking blocks + +Adaptive thinking is on by default, so a response can begin with one or more `thinking` blocks even when the request doesn't mention thinking. Code that reads the first content block as the answer needs to select blocks by their `type` field. See [Configure thinking](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#configure-thinking) in the migration guide. + +### Earlier thinking blocks stay in context + +Claude Haiku 5.5 keeps thinking blocks from all earlier assistant turns in context, and they count as input tokens. Claude Haiku 4.5 kept only the latest turn's blocks. Multi-turn conversations therefore carry more input tokens than the tokenizer change alone explains. To remove older blocks, use [thinking block clearing](https://platform.claude.com/docs/en/build-with-claude/context-editing#thinking-block-clearing). See [Thinking block preservation by model](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-block-preservation-by-model). + +### Same text counts as more tokens + +Claude Haiku 5.5 uses the same newer tokenizer as Claude 4.7 and later models. As with all models that use this tokenizer, the same input text produces approximately 30% more tokens on Claude Haiku 5.5 than on Claude Haiku 4.5. The exact increase depends on the content. The shape of requests and responses doesn't depend on the tokenizer, but anything you measure or budget in tokens changes. See [Recount tokens](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#recount-tokens) in the migration guide. + +### Replaying thinking blocks across accounts + +Thinking blocks from Claude Haiku 5.5 work only in the account that produced them, or in an account linked to it. This matters only if you store conversations and replay them through a different account. See [Replay thinking blocks through the account that produced them](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide#replay-thinking-blocks-through-the-producing-account). diff --git a/site/src/docs/configuration.en.md b/site/src/docs/configuration.en.md index ee61f4e5..ce8a7238 100644 --- a/site/src/docs/configuration.en.md +++ b/site/src/docs/configuration.en.md @@ -40,7 +40,7 @@ description: UniConfig, the options of a request. Every field is optional. | `temperature` | number | The sampling temperature. Some models fix it and reject any other value. | | `system_prompt` | string | The system instruction. | | `tools` | list | The tools the model may call: `name`, `description`, and `parameters` as a JSON Schema. | -| `tool_choice` | `"auto"`, `"required"`, `"none"`, or a list of tool names | Which tools the model may or must call. Support varies by model: Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 cannot be forced to call a tool, so `"required"` and a list of names raise on them. | +| `tool_choice` | `"auto"`, `"required"`, `"none"`, or a list of tool names | Which tools the model may or must call. Support varies by model: Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 cannot be forced to call a tool, so `"required"` and a list of names raise on them. | | `thinking_level` | `"none"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` | How much the model thinks. Every level is safe to pass: MMSP maps it to the closest one the model supports. | | `thinking_summary` | boolean | Ask for a summary of the thinking. Whether one comes back depends on the model. | | `prompt_caching` | `"enable"`, `"disable"`, `"enhance"` | How the prompt is cached. Most providers cache on their own and accept only `enable`. | @@ -52,7 +52,7 @@ description: UniConfig, the options of a request. Every field is optional. ## Values a model rejects -A value the model cannot take raises `UnsupportedParameterError` before the request is sent, naming the client and the parameter. `thinking_level` is the exception: it never raises. Where a model cannot turn thinking off, `"none"` asks for the least of it: the lowest effort on Claude Opus 5.5 and Fable 5.1 and on GPT-6, and no up-front thinking on Claude Sonnet 5.5. +A value the model cannot take raises `UnsupportedParameterError` before the request is sent, naming the client and the parameter. `thinking_level` is the exception: it never raises. Where a model cannot turn thinking off, `"none"` asks for the least of it: the lowest effort on Claude Opus 5.5 and Fable 5.1 and on GPT-6, and no up-front thinking on Claude Sonnet 5.5. Claude Haiku 5.5 runs `"none"` at the lowest effort too. ## In Python and TypeScript diff --git a/site/src/docs/configuration.zh.md b/site/src/docs/configuration.zh.md index e4874522..6cc69cae 100644 --- a/site/src/docs/configuration.zh.md +++ b/site/src/docs/configuration.zh.md @@ -40,7 +40,7 @@ description: UniConfig,请求的配置选项。所有字段均为可选。 | `temperature` | 数字 | 采样温度。部分模型会固定此值,拒绝其他设置。 | | `system_prompt` | 字符串 | 系统指令。 | | `tools` | 列表 | 模型可调用的工具,包含 `name`、`description` 和 JSON Schema 格式的 `parameters`。 | -| `tool_choice` | `"auto"`、`"required"`、`"none"` 或工具名列表 | 指定模型可以或必须调用哪些工具。具体支持情况因模型而异:Claude Opus 5.5、Sonnet 5.5 和 Fable 5.1 不能强制调用工具,在它们上面传 `"required"` 或工具名列表会抛错。 | +| `tool_choice` | `"auto"`、`"required"`、`"none"` 或工具名列表 | 指定模型可以或必须调用哪些工具。具体支持情况因模型而异:Claude Opus 5.5、Sonnet 5.5、Haiku 5.5 和 Fable 5.1 不能强制调用工具,在它们上面传 `"required"` 或工具名列表会抛错。 | | `thinking_level` | `"none"`、`"low"`、`"medium"`、`"high"`、`"xhigh"`、`"max"` | 控制模型的思考深度。所有级别均可安全传入,MMSP 会自动映射到模型支持的最接近级别。 | | `thinking_summary` | 布尔 | 请求返回思考摘要。实际是否返回取决于模型能力。 | | `prompt_caching` | `"enable"`、`"disable"`、`"enhance"` | 提示词缓存策略。多数服务商自行管理缓存,通常只接受 `enable`。 | @@ -52,7 +52,7 @@ description: UniConfig,请求的配置选项。所有字段均为可选。 ## 模型拒绝的参数值 -如果模型不支持某个参数值,会在请求发出前抛出 `UnsupportedParameterError`,并指明客户端和具体参数。`thinking_level` 例外,它永远不会抛错。模型无法关闭思考时,`"none"` 取最少的思考:Claude Opus 5.5、Fable 5.1 和 GPT-6 上是最低的思考档位,Claude Sonnet 5.5 上是不在回答前思考。 +如果模型不支持某个参数值,会在请求发出前抛出 `UnsupportedParameterError`,并指明客户端和具体参数。`thinking_level` 例外,它永远不会抛错。模型无法关闭思考时,`"none"` 取最少的思考:Claude Opus 5.5、Fable 5.1 和 GPT-6 上是最低的思考档位,Claude Sonnet 5.5 上是不在回答前思考。Claude Haiku 5.5 上的 `"none"` 同样是最低的思考档位。 ## 在 Python 和 TypeScript 中 diff --git a/site/src/docs/models.en.md b/site/src/docs/models.en.md index c8a3f21e..7a3227c7 100644 --- a/site/src/docs/models.en.md +++ b/site/src/docs/models.en.md @@ -11,7 +11,7 @@ Use exact model ids. A model id that begins with a known family names its offici | `client_type` | Models | Speaks | Key and endpoint | | --- | --- | --- | --- | | `openai-official` | `gpt-6.1-sol`, `gpt-6-astra`, `gpt-5.6-sol`, `gpt-5.5`; `text-embedding-3-large`, `text-embedding-3-small` | OpenAI Responses; Embeddings for `text-embedding-*` | `OPENAI_API_KEY` `OPENAI_BASE_URL` | -| `anthropic-official` | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1`, `claude-opus-5`, `claude-sonnet-5` | Anthropic Messages | `ANTHROPIC_API_KEY` `ANTHROPIC_BASE_URL` | +| `anthropic-official` | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-fable-5-1`, `claude-opus-5`, `claude-sonnet-5` | Anthropic Messages | `ANTHROPIC_API_KEY` `ANTHROPIC_BASE_URL` | | `google-official` | `gemini-3.8-flash`, `gemini-3.7-flash`, `gemini-3.1-pro-preview`; `gemini-3.1-flash-image`, `gemini-3.8-flash-tts`; `gemini-embedding-2` | Gemini Interactions | `GEMINI_API_KEY` `GEMINI_BASE_URL` | | `zai-official` | `glm-5.3`, `glm-5.3-flash`, `glm-5.2` | Chat Completions | `ZAI_API_KEY` `ZAI_BASE_URL` | | `moonshot-official` | `kimi-k3`, `kimi-k2.6` | Chat Completions | `MOONSHOT_API_KEY` `MOONSHOT_BASE_URL` | diff --git a/site/src/docs/models.zh.md b/site/src/docs/models.zh.md index b369a492..90a2c619 100644 --- a/site/src/docs/models.zh.md +++ b/site/src/docs/models.zh.md @@ -11,7 +11,7 @@ description: MMSP 的客户端构成、各客户端支持的模型,以及如 | `client_type` | 模型 | 协议 | Key 与端点 | | --- | --- | --- | --- | | `openai-official` | `gpt-6.1-sol`、`gpt-6-astra`、`gpt-5.6-sol`、`gpt-5.5`;`text-embedding-3-large`、`text-embedding-3-small` | OpenAI Responses;`text-embedding-*` 走 Embeddings | `OPENAI_API_KEY` `OPENAI_BASE_URL` | -| `anthropic-official` | `claude-opus-5-5`、`claude-sonnet-5-5`、`claude-fable-5-1`、`claude-opus-5`、`claude-sonnet-5` | Anthropic Messages | `ANTHROPIC_API_KEY` `ANTHROPIC_BASE_URL` | +| `anthropic-official` | `claude-opus-5-5`、`claude-sonnet-5-5`、`claude-haiku-5-5`、`claude-fable-5-1`、`claude-opus-5`、`claude-sonnet-5` | Anthropic Messages | `ANTHROPIC_API_KEY` `ANTHROPIC_BASE_URL` | | `google-official` | `gemini-3.8-flash`、`gemini-3.7-flash`、`gemini-3.1-pro-preview`;`gemini-3.1-flash-image`、`gemini-3.8-flash-tts`;`gemini-embedding-2` | Gemini Interactions | `GEMINI_API_KEY` `GEMINI_BASE_URL` | | `zai-official` | `glm-5.3`、`glm-5.3-flash`、`glm-5.2` | Chat Completions | `ZAI_API_KEY` `ZAI_BASE_URL` | | `moonshot-official` | `kimi-k3`、`kimi-k2.6` | Chat Completions | `MOONSHOT_API_KEY` `MOONSHOT_BASE_URL` | diff --git a/skills/mmsp-python/reference/data-models.md b/skills/mmsp-python/reference/data-models.md index 30483820..49ff8fdc 100644 --- a/skills/mmsp-python/reference/data-models.md +++ b/skills/mmsp-python/reference/data-models.md @@ -38,7 +38,7 @@ Fields: - `tools` (`list[ToolSchema]`): Tools with `name`, `description`, and optional JSON Schema `parameters`. - `thinking_summary` (`bool`): Request a thinking summary when supported; whether a model returns one is model-dependent (gemini-3.8-flash and gemini-3.1-pro do). - `thinking_level` (`ThinkingLevel`): `none`, `low`, `medium`, `high`, `xhigh`, or `max`. MMSP maps each level to the closest effort the model supports, so any level is safe to pass. -- `tool_choice` (`ToolChoice`): `auto`, `required`, `none`, or a list of tool names; support varies by model. Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 cannot be forced to call a tool: `"required"` and a list of names raise `UnsupportedParameterError` on them. +- `tool_choice` (`ToolChoice`): `auto`, `required`, `none`, or a list of tool names; support varies by model. Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 cannot be forced to call a tool: `"required"` and a list of names raise `UnsupportedParameterError` on them. - `system_prompt` (`str`): System instruction text. - `prompt_caching` (`PromptCaching`): `enable`, `disable`, or `enhance`. - `image_config` (`ImageConfig`): `aspect_ratio` (`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9`) and `image_size` (`1K`, `2K`). diff --git a/skills/mmsp-python/reference/models.md b/skills/mmsp-python/reference/models.md index 49aebdd6..2af00178 100644 --- a/skills/mmsp-python/reference/models.md +++ b/skills/mmsp-python/reference/models.md @@ -18,7 +18,7 @@ Use exact model IDs, and pass the model's client type as `client_type`. If a mod | Claude 4.7 | Bedrock | `global.anthropic.claude-opus-4-7` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 4.8 | Official / ModelVerse | `claude-opus-4-8` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 4.8 | Bedrock | `global.anthropic.claude-opus-4-8` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | -| Claude 5.5 / Fable 5.1 | Official | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | +| Claude 5.5 / Fable 5.1 | Official | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-fable-5-1` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 5 | Official / ModelVerse | `claude-fable-5`, `claude-opus-5`, `claude-sonnet-5` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 5 | Bedrock | `global.anthropic.claude-fable-5` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | GPT 5.4 | Official / ModelVerse | `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano` | `openai-official` | `OPENAI_API_KEY` | `OPENAI_BASE_URL` | diff --git a/skills/mmsp-typescript/reference/data-models.md b/skills/mmsp-typescript/reference/data-models.md index 36a63751..43489033 100644 --- a/skills/mmsp-typescript/reference/data-models.md +++ b/skills/mmsp-typescript/reference/data-models.md @@ -38,7 +38,7 @@ Fields: - `tools` (`ToolSchema[]`): Tools with `name`, `description`, and optional JSON Schema `parameters`. - `thinking_summary` (`boolean`): Request a thinking summary when supported; whether a model returns one is model-dependent (gemini-3.8-flash and gemini-3.1-pro do). - `thinking_level` (`ThinkingLevel`): `NONE`, `LOW`, `MEDIUM`, `HIGH`, `XHIGH`, or `MAX`. MMSP maps each level to the closest effort the model supports, so any level is safe to pass. -- `tool_choice` (`ToolChoice`): `auto`, `required`, `none`, or a list of tool names; support varies by model. Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 cannot be forced to call a tool: `"required"` and a list of names raise `UnsupportedParameterError` on them. +- `tool_choice` (`ToolChoice`): `auto`, `required`, `none`, or a list of tool names; support varies by model. Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 cannot be forced to call a tool: `"required"` and a list of names raise `UnsupportedParameterError` on them. - `system_prompt` (`string`): System instruction text. - `prompt_caching` (`PromptCaching`): `ENABLE`, `DISABLE`, or `ENHANCE`. - `image_config` (`ImageConfig`): `aspect_ratio` (`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9`) and `image_size` (`1K`, `2K`). diff --git a/skills/mmsp-typescript/reference/models.md b/skills/mmsp-typescript/reference/models.md index 53c63e12..969f2e68 100644 --- a/skills/mmsp-typescript/reference/models.md +++ b/skills/mmsp-typescript/reference/models.md @@ -18,7 +18,7 @@ Use exact model IDs, and pass the model's client type as `clientType`. If a mode | Claude 4.7 | Bedrock | `global.anthropic.claude-opus-4-7` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 4.8 | Official / ModelVerse | `claude-opus-4-8` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 4.8 | Bedrock | `global.anthropic.claude-opus-4-8` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | -| Claude 5.5 / Fable 5.1 | Official | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | +| Claude 5.5 / Fable 5.1 | Official | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-fable-5-1` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 5 | Official / ModelVerse | `claude-fable-5`, `claude-opus-5`, `claude-sonnet-5` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | Claude 5 | Bedrock | `global.anthropic.claude-fable-5` | `anthropic-official` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL` | | GPT 5.4 | Official / ModelVerse | `gpt-5.4`, `gpt-5.4-mini`, `gpt-5.4-nano` | `openai-official` | `OPENAI_API_KEY` | `OPENAI_BASE_URL` | diff --git a/src_py/mmsp/anthropic_official/client.py b/src_py/mmsp/anthropic_official/client.py index 143aea21..fc72c468 100644 --- a/src_py/mmsp/anthropic_official/client.py +++ b/src_py/mmsp/anthropic_official/client.py @@ -42,17 +42,19 @@ # Generations told apart by explicit version, matched anywhere in the id so Bedrock's # anthropic.claude-opus-5-5 counts too. Opus 5.5 and Fable 5.1 always think: "disabled" and -# "between_tools" return 400. Sonnet 5.5 drops only up-front thinking, with "between_tools". -_ALWAYS_THINKING = ("opus-5-5", "fable-5-1") +# "between_tools" return 400. Haiku 5.5 takes "disabled" but runs NONE at the lowest effort +# like them. Sonnet 5.5 drops only up-front thinking, with "between_tools". +_LOW_EFFORT_FOR_NONE = ("opus-5-5", "fable-5-1", "haiku-5-5") _BETWEEN_TOOLS = ("sonnet-5-5",) -# The 2026-09 generation returns 400 for tool_choice "any" and "tool". -_NO_FORCED_TOOL_CHOICE = ("opus-5-5", "sonnet-5-5", "fable-5-1") +# The 2026-09 generation returns 400 for tool_choice "any" and "tool". Haiku 5.5 takes them but +# answers without thinking, so it is rejected with the rest of the 5.5 family. +_NO_FORCED_TOOL_CHOICE = ("opus-5-5", "sonnet-5-5", "haiku-5-5", "fable-5-1") # These reject the speed parameter ("does not support the `speed` parameter"). -_NO_FAST_MODE = ("4-6", "sonnet-5-5", "fable-5-1") +_NO_FAST_MODE = ("4-6", "sonnet-5-5", "haiku-5-5", "fable-5-1") class AnthropicOfficialClient(LLMClient): - """Claude LLM client: Claude 4.6 through Opus 5.5, Sonnet 5.5 and Fable 5.1.""" + """Claude LLM client: Claude 4.6 through Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1.""" def __init__( self, @@ -131,8 +133,8 @@ def _generation(self, versions: tuple[str, ...]) -> bool: def _convert_thinking_level_to_thinking_config(self, thinking_level: ThinkingLevel) -> dict[str, Any]: """Convert ThinkingLevel enum to Claude's adaptive thinking config.""" - if self._generation(_ALWAYS_THINKING): - # nothing turns thinking off, so NONE takes the least of it + if self._generation(_LOW_EFFORT_FOR_NONE): + # NONE takes the least thinking these allow none: dict[str, Any] = {"thinking": {"type": "adaptive"}, "output_config": {"effort": "low"}} elif self._generation(_BETWEEN_TOOLS): none = {"thinking": {"type": "between_tools"}} diff --git a/src_py/mmsp/registry.py b/src_py/mmsp/registry.py index 074f3bb5..266af4b9 100644 --- a/src_py/mmsp/registry.py +++ b/src_py/mmsp/registry.py @@ -215,7 +215,17 @@ def rate(value: float) -> float: "input_modalities": ["Text", "Image"], "output_modalities": ["Text"], "context_window": 1000000, - "pricing": _usd(2.0, 10.0, cached=0.2), + "pricing": _usd(2.0, 10.0, cached=0.1), + }, + { + "model": "claude-haiku-5-5", + "base_url": _ANTHROPIC, + "client": "anthropic-official", + "input_modalities": ["Text", "Image"], + "output_modalities": ["Text"], + "context_window": 1000000, + # official list price for prompts up to 100K tokens; every rate is 5x above it + "pricing": _usd(0.1, 0.5, cached=0.01), }, { "model": "claude-fable-5", @@ -472,7 +482,16 @@ def rate(value: float) -> float: "input_modalities": ["Text", "Image"], "output_modalities": ["Text"], "context_window": 1000000, - "pricing": _usd(2.0, 10.0, cached=0.2), + "pricing": _usd(2.0, 10.0, cached=0.1), + }, + { + "model": "anthropic/claude-haiku-5.5", + "base_url": _OPENROUTER, + "client": "openai-responses", + "input_modalities": ["Text", "Image"], + "output_modalities": ["Text"], + "context_window": 1000000, + "pricing": _usd(0.1, 0.5, cached=0.01), }, { "model": "anthropic/claude-fable-5", diff --git a/src_py/tests/test_client.py b/src_py/tests/test_client.py index dba1090c..96ade0e1 100644 --- a/src_py/tests/test_client.py +++ b/src_py/tests/test_client.py @@ -93,6 +93,7 @@ def __repr__(self) -> str: if os.getenv("ANTHROPIC_API_KEY"): AVAILABLE_MODELS.append(Model(name="claude-sonnet-5-5")) + AVAILABLE_MODELS.append(Model(name="claude-haiku-5-5")) if os.getenv("OPENAI_API_KEY"): AVAILABLE_MODELS.append(Model(name="gpt-6.1-sol")) diff --git a/src_py/tests/test_thinking_level_mapping.py b/src_py/tests/test_thinking_level_mapping.py index cd29f1cc..422510bd 100644 --- a/src_py/tests/test_thinking_level_mapping.py +++ b/src_py/tests/test_thinking_level_mapping.py @@ -180,12 +180,15 @@ def test_glm_thinking_level_maps_per_generation( ("claude-sonnet-4-6", None, ThinkingLevel.XHIGH, "high"), ("claude-sonnet-4-6", None, ThinkingLevel.MAX, "max"), ("claude-sonnet-5", "ant-messages", ThinkingLevel.MAX, "max"), - # Opus 5.5 and Fable 5.1 cannot turn thinking off, so NONE is the lowest effort; Sonnet 5.5 - # turns off up-front thinking with between_tools, which carries no effort. + # Opus 5.5 and Fable 5.1 cannot turn thinking off, so NONE is the lowest effort, and Haiku 5.5 + # runs NONE the same way; Sonnet 5.5 turns off up-front thinking with between_tools, which + # carries no effort. ("claude-opus-5-5", None, ThinkingLevel.NONE, "low"), ("claude-opus-5-5", None, ThinkingLevel.MAX, "max"), ("claude-fable-5-1", None, ThinkingLevel.NONE, "low"), ("claude-fable-5-1", None, ThinkingLevel.XHIGH, "xhigh"), + ("claude-haiku-5-5", None, ThinkingLevel.NONE, "low"), + ("claude-haiku-5-5", None, ThinkingLevel.MAX, "max"), ("claude-sonnet-5-5", None, ThinkingLevel.NONE, None), ("claude-sonnet-5-5", None, ThinkingLevel.XHIGH, "xhigh"), ("deepseek-v4", None, ThinkingLevel.NONE, "none"), @@ -242,6 +245,7 @@ def test_thinking_level_maps_to_vendor_effort( ("claude-sonnet-5-5", None, {"thinking_summary": True, "thinking_level": ThinkingLevel.NONE}, None), ("claude-sonnet-5-5", None, {"thinking_summary": True}, "summarized"), ("claude-opus-5-5", None, {"thinking_summary": True, "thinking_level": ThinkingLevel.NONE}, "summarized"), + ("claude-haiku-5-5", None, {"thinking_summary": True, "thinking_level": ThinkingLevel.NONE}, "summarized"), ("deepseek-v4", None, {"thinking_summary": True}, "concise"), ("deepseek-v4", None, {"thinking_summary": True, "thinking_level": ThinkingLevel.NONE}, "concise"), ("gpt-5.6", None, {"thinking_summary": True}, "concise"), diff --git a/src_ts/src/anthropic_official/client.ts b/src_ts/src/anthropic_official/client.ts index 3ef869a9..f03897d8 100644 --- a/src_ts/src/anthropic_official/client.ts +++ b/src_ts/src/anthropic_official/client.ts @@ -42,13 +42,20 @@ const REDACTED_THINKING = "_REDACTED_THINKING"; // Generations told apart by explicit version, matched anywhere in the id so Bedrock's // anthropic.claude-opus-5-5 counts too. Opus 5.5 and Fable 5.1 always think: "disabled" and -// "between_tools" return 400. Sonnet 5.5 drops only up-front thinking, with "between_tools". -const ALWAYS_THINKING = ["opus-5-5", "fable-5-1"]; +// "between_tools" return 400. Haiku 5.5 takes "disabled" but runs NONE at the lowest effort +// like them. Sonnet 5.5 drops only up-front thinking, with "between_tools". +const LOW_EFFORT_FOR_NONE = ["opus-5-5", "fable-5-1", "haiku-5-5"]; const BETWEEN_TOOLS = ["sonnet-5-5"]; -// The 2026-09 generation returns 400 for tool_choice "any" and "tool". -const NO_FORCED_TOOL_CHOICE = ["opus-5-5", "sonnet-5-5", "fable-5-1"]; +// The 2026-09 generation returns 400 for tool_choice "any" and "tool". Haiku 5.5 takes them but +// answers without thinking, so it is rejected with the rest of the 5.5 family. +const NO_FORCED_TOOL_CHOICE = [ + "opus-5-5", + "sonnet-5-5", + "haiku-5-5", + "fable-5-1", +]; // These reject the speed parameter ("does not support the `speed` parameter"). -const NO_FAST_MODE = ["4-6", "sonnet-5-5", "fable-5-1"]; +const NO_FAST_MODE = ["4-6", "sonnet-5-5", "haiku-5-5", "fable-5-1"]; /** * Claude 5-specific LLM client implementation (also serves Claude 4.6 through 4.8). @@ -167,8 +174,8 @@ export class AnthropicOfficialClient extends LLMClient { thinking?: { type: string; display?: string }; output_config?: { effort: string }; } { - // nothing turns thinking off on ALWAYS_THINKING, so NONE takes the least of it - const none = this._generation(ALWAYS_THINKING) + // NONE takes the least thinking LOW_EFFORT_FOR_NONE allows + const none = this._generation(LOW_EFFORT_FOR_NONE) ? { thinking: { type: "adaptive" }, output_config: { effort: "low" } } : this._generation(BETWEEN_TOOLS) ? { thinking: { type: "between_tools" } } diff --git a/src_ts/src/registry.ts b/src_ts/src/registry.ts index 3c946cee..a0f65c6e 100644 --- a/src_ts/src/registry.ts +++ b/src_ts/src/registry.ts @@ -214,7 +214,17 @@ const SUPPORTED_MODELS: SupportedModel[] = [ input_modalities: ["Text", "Image"], output_modalities: ["Text"], context_window: 1000000, - pricing: usd(2.0, 10.0, 0.2), + pricing: usd(2.0, 10.0, 0.1), + }, + { + model: "claude-haiku-5-5", + base_url: ANTHROPIC, + client: "anthropic-official", + input_modalities: ["Text", "Image"], + output_modalities: ["Text"], + context_window: 1000000, + // official list price for prompts up to 100K tokens; every rate is 5x above it + pricing: usd(0.1, 0.5, 0.01), }, { model: "claude-fable-5", @@ -471,7 +481,16 @@ const SUPPORTED_MODELS: SupportedModel[] = [ input_modalities: ["Text", "Image"], output_modalities: ["Text"], context_window: 1000000, - pricing: usd(2.0, 10.0, 0.2), + pricing: usd(2.0, 10.0, 0.1), + }, + { + model: "anthropic/claude-haiku-5.5", + base_url: OPENROUTER, + client: "openai-responses", + input_modalities: ["Text", "Image"], + output_modalities: ["Text"], + context_window: 1000000, + pricing: usd(0.1, 0.5, 0.01), }, { model: "anthropic/claude-fable-5", diff --git a/src_ts/tests/client.test.ts b/src_ts/tests/client.test.ts index 77f7cc8d..b1f03432 100644 --- a/src_ts/tests/client.test.ts +++ b/src_ts/tests/client.test.ts @@ -118,6 +118,15 @@ if (process.env.ANTHROPIC_API_KEY) { supportEmbedding: false, provider: "official", }); + AVAILABLE_MODELS.push({ + name: "claude-haiku-5-5", + supportTextGeneration: true, + supportImageUnderstanding: true, + supportImageGeneration: false, + supportAudioGeneration: false, + supportEmbedding: false, + provider: "official", + }); } if (process.env.OPENAI_API_KEY) { diff --git a/src_ts/tests/thinking-level-mapping.test.ts b/src_ts/tests/thinking-level-mapping.test.ts index bf7c24dd..cb1e3503 100644 --- a/src_ts/tests/thinking-level-mapping.test.ts +++ b/src_ts/tests/thinking-level-mapping.test.ts @@ -218,12 +218,15 @@ const THINKING_EFFORT_CASES: Array< ["gpt-5.6", "openai-responses", ThinkingLevel.MAX, "max"], ["claude-sonnet-5", undefined, ThinkingLevel.XHIGH, "xhigh"], ["claude-sonnet-5", undefined, ThinkingLevel.MAX, "max"], - // Opus 5.5 and Fable 5.1 cannot turn thinking off, so NONE is the lowest effort; Sonnet 5.5 - // turns off up-front thinking with between_tools, which carries no effort. + // Opus 5.5 and Fable 5.1 cannot turn thinking off, so NONE is the lowest effort, and Haiku 5.5 + // runs NONE the same way; Sonnet 5.5 turns off up-front thinking with between_tools, which + // carries no effort. ["claude-opus-5-5", undefined, ThinkingLevel.NONE, "low"], ["claude-opus-5-5", undefined, ThinkingLevel.MAX, "max"], ["claude-fable-5-1", undefined, ThinkingLevel.NONE, "low"], ["claude-fable-5-1", undefined, ThinkingLevel.XHIGH, "xhigh"], + ["claude-haiku-5-5", undefined, ThinkingLevel.NONE, "low"], + ["claude-haiku-5-5", undefined, ThinkingLevel.MAX, "max"], ["claude-sonnet-5-5", undefined, ThinkingLevel.NONE, undefined], ["claude-sonnet-5-5", undefined, ThinkingLevel.XHIGH, "xhigh"], // 4.6 has no xhigh but does take max. @@ -295,6 +298,12 @@ const THINKING_SUMMARY_CASES: Array< { thinking_summary: true, thinking_level: ThinkingLevel.NONE }, "summarized", ], + [ + "claude-haiku-5-5", + undefined, + { thinking_summary: true, thinking_level: ThinkingLevel.NONE }, + "summarized", + ], ["claude-sonnet-5", undefined, { thinking_summary: false }, "omitted"], [ "claude-sonnet-5", From dcb12aa9c724027c5fd1b61bda2df26374a67f6f Mon Sep 17 00:00:00 2001 From: Yaowei Zheng Date: Fri, 9 Oct 2026 12:51:40 -0700 Subject: [PATCH 2/2] docs(changelog): link the Claude Haiku 5.5 entry to #249 Co-Authored-By: Claude Opus 5.5 --- changelog/unreleased/2026-10-09-claude-haiku-5-5.md | 1 + changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md | 1 + changelog/unreleased/README.md | 2 +- changelog/unreleased/README.zh.md | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/2026-10-09-claude-haiku-5-5.md b/changelog/unreleased/2026-10-09-claude-haiku-5-5.md index c4feb2a5..cfcc2481 100644 --- a/changelog/unreleased/2026-10-09-claude-haiku-5-5.md +++ b/changelog/unreleased/2026-10-09-claude-haiku-5-5.md @@ -3,6 +3,7 @@ - **Date:** 2026-10-09 - **Type:** feature - **Scope:** `anthropic_official`, `registry` +- **PR:** [#249](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/249) [中文版](2026-10-09-claude-haiku-5-5.zh.md) diff --git a/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md b/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md index 020fef9d..77147ac1 100644 --- a/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md +++ b/changelog/unreleased/2026-10-09-claude-haiku-5-5.zh.md @@ -3,6 +3,7 @@ - **Date:** 2026-10-09 - **Type:** feature - **Scope:** `anthropic_official`, `registry` +- **PR:** [#249](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/249) [English](2026-10-09-claude-haiku-5-5.md) diff --git a/changelog/unreleased/README.md b/changelog/unreleased/README.md index d8c6e9ef..f133fb76 100644 --- a/changelog/unreleased/README.md +++ b/changelog/unreleased/README.md @@ -2,6 +2,6 @@ [中文版](README.zh.md) -- [2026-10-09] Support Claude Haiku 5.5: `anthropic-official` serves `claude-haiku-5-5` and `list_supported_models` lists it with OpenRouter's `anthropic/claude-haiku-5.5`; cache reads on Claude Sonnet 5.5 drop to $0.10. ([details](2026-10-09-claude-haiku-5-5.md)) +- [2026-10-09] Support Claude Haiku 5.5: `anthropic-official` serves `claude-haiku-5-5` and `list_supported_models` lists it with OpenRouter's `anthropic/claude-haiku-5.5`; cache reads on Claude Sonnet 5.5 drop to $0.10. ([details](2026-10-09-claude-haiku-5-5.md), [#249](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/249)) - [2026-10-09] The official Gemini client is `google-official` (alias `gemini-official`), named after its vendor like the other official clients; its class is `GoogleOfficialClient`. ([details](2026-10-09-google-official.md), [#248](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/248)) - [2026-10-02] An MMSP server serves the models of a table over HTTP as MMSP streams (`python -m mmsp.integration.server --config FILE`, `npm run server -- --config FILE`); the playground's `/server/` page saves a table to a config file, starts one from it and draws its metrics over the last 60 days, and the `mmsp` client calls it; an error the server reports comes back as the new `UpstreamError`. ([details](2026-10-02-mmsp-server.md), [#247](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/247)) diff --git a/changelog/unreleased/README.zh.md b/changelog/unreleased/README.zh.md index 607ffdaf..8cb59f79 100644 --- a/changelog/unreleased/README.zh.md +++ b/changelog/unreleased/README.zh.md @@ -2,6 +2,6 @@ [English](README.md) -- [2026-10-09] 支持 Claude Haiku 5.5:`anthropic-official` 支持 `claude-haiku-5-5`,`list_supported_models` 列出它和 OpenRouter 上的 `anthropic/claude-haiku-5.5`;Claude Sonnet 5.5 的缓存读取降到 0.10 美元。([详情](2026-10-09-claude-haiku-5-5.zh.md)) +- [2026-10-09] 支持 Claude Haiku 5.5:`anthropic-official` 支持 `claude-haiku-5-5`,`list_supported_models` 列出它和 OpenRouter 上的 `anthropic/claude-haiku-5.5`;Claude Sonnet 5.5 的缓存读取降到 0.10 美元。([详情](2026-10-09-claude-haiku-5-5.zh.md), [#249](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/249)) - [2026-10-09] Gemini 官方客户端改名为 `google-official`(别名 `gemini-official`),与其他官方客户端一样以厂商命名;类名改为 `GoogleOfficialClient`。([详情](2026-10-09-google-official.zh.md), [#248](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/248)) - [2026-10-02] 新增 MMSP 服务端,通过 HTTP 把一张表里的模型提供为 MMSP 流(`python -m mmsp.integration.server --config FILE`、`npm run server -- --config FILE`);Playground 的 `/server/` 页面把表保存到配置文件,据此启动服务端并画出其最近 60 天的指标;新增调用它的 `mmsp` 客户端;服务端报告的错误以新增的 `UpstreamError` 抛出。([详情](2026-10-02-mmsp-server.zh.md), [#247](https://github.com/Prism-Shadow/model-message-stream-protocol/pull/247))