模型名称 | Claude Opus 4 | Claude Sonnet 4 | Claude Sonnet 3.7 | Claude Sonnet 3.5 | Claude Haiku 3.5 | Claude Opus 3 | Claude Haiku 3 |
---|---|---|---|---|---|---|---|
是否支持扩展思考 | 是 | 是 | 是 | 否 | 否 | 否 | 否 |
上下文窗口大小 | 200K | 200K | 200K | 200K | 200K | 200K | 200K |
最长输出长度 | 32000 tokens | 64000 tokens | 64000 tokens | 8192 tokens | 8192 tokens | 4096 tokens | 4096 tokens |
训练数据截止时间 | 2025年3月 | 2025年3月 | 2024年11月 | 2024年4月 | 2024年7月 | 2023年8月 | 2023年8月 |
最长输出长度
。extra_headers={"anthropic-beta": "output-128k-2025-02-19"}
来把最大输出从 64K 扩展到 128K,见下方「流式 128K」调用,或者参考 Claude 官方的Beta headers 说明。refusal
停止原因,用于处理模型因安全原因拒绝生成的内容:
refusal
停止原因。
interleaved-thinking-2025-05-14
:
POST
/v1/messages
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
x-api-key | header | string | 否 | Bearer AIHUBMIX_API_KEY |
Content-Type | header | string | 否 | none |
body | body | object | 否 | none |
» model | body | string | 是 | none |
» messages | body | [object] | 是 | none |
»» role | body | string | 否 | none |
»» content | body | string | 是 | none |
» max_tokens | body | number | 是 | none |
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | none | Inline |
refusal
停止原因:
output-128k-2025-02-19
测试头仅在 Claude Sonnet 3.7 中可用claude-opus-4-20250514
, claude-sonnet-4-20250514
): text_editor_20250429
claude-3-7-sonnet-20250219
): text_editor_20250124
claude-3-5-sonnet-20241022
): text_editor_20241022
模型版本 | 工具类型 | 工具名称 | 支持的功能 |
---|---|---|---|
Claude 4 (Opus/Sonnet) | text_editor_20250429 | str_replace_based_edit_tool | view, str_replace, create |
Claude 3.7 Sonnet | text_editor_20250124 | str_replace_editor | view, str_replace, create, undo_edit |
Claude 3.5 Sonnet | text_editor_20241022 | str_replace_editor | view, str_replace, create, undo_edit |
undo_edit
命令,请在代码中移除对此功能的依赖。str_replace_editor
):
需要安装 anthropic
包:
undo_edit
命令:Claude 4 模型不再支持撤销编辑功能undo_edit
的逻辑