> For AI agents: the complete documentation index is available at https://little-butterfly-9bfe.sentia389.workers.dev/llms.txt, the full documentation bundle is available at https://little-butterfly-9bfe.sentia389.workers.dev/llms-full.txt.

# Claude Opus

Opus 适合复杂编码和多步骤分析。上下文和输出上限为 Claude API 规格。

| 型号       | Claude API ID     | 官方发布日期     | 上下文 / 同步 Messages 最大输出 |
| -------- | ----------------- | ---------- | ---------------------- |
| Opus 5.5 | `claude-opus-5-5` | 2026-09-22 | 1M / 128K tokens       |
| Opus 5   | `claude-opus-5`   | 2026-07-24 | 1M / 128K tokens       |
| Opus 4.8 | `claude-opus-4-8` | 2026-05-28 | 1M / 128K tokens       |
| Opus 4.7 | `claude-opus-4-7` | 2026-04-16 | 1M / 128K tokens       |
| Opus 4.6 | `claude-opus-4-6` | 2026-02-05 | 1M / 128K tokens       |

## 平台别名

routerlio 目录中的点号别名包括 `claude-opus-5.5`、`claude-opus-4.8`。别名的上游映射和可用协议以当前渠道配置为准。Claude API 使用上表所列 ID。参见[官方模型 ID 规则](https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions)。

## Messages 关键参数

| 字段                            | 类型       | 限制与版本区别                                                                                  |
| ----------------------------- | -------- | ---------------------------------------------------------------------------------------- |
| `model`、`messages`            | 字符串、对象数组 | 两者必填。顶层 `system` 可另外传系统指令。                                                               |
| `max_tokens`                  | 整数，必填    | 普通生成请求使用正值。同步输出最多 128K tokens，包含 thinking。                                               |
| `thinking.type`               | 字符串      | 5.5 始终自适应。5 默认自适应，`disabled` 限 `high` 或更低 effort。4.8、4.7 和 4.6 默认关闭，可用 `adaptive` 开启。    |
| `thinking.budget_tokens`      | 整数       | 4.6 的手动模式已弃用。4.7 及更新版本拒绝手动预算。                                                            |
| `output_config.effort`        | 字符串      | 5.5 默认 `medium`，其他所列版本默认 `high`。各版本均支持 `low`、`medium`、`high`、`max`，4.7 及更新版本也支持 `xhigh`。 |
| `temperature`、`top_p`、`top_k` | 数值、数值、整数 | 4.7 及更新版本省略。4.6 需核对 API 版本与 thinking 模式限制。                                               |

Anthropic 已弃用 Opus 4.5，Claude API 的停用日期为 2027 年 1 月 22 日，官方建议迁移至 Opus 5.5。参见[停用时间表](https://platform.claude.com/docs/en/about-claude/model-deprecations#2026-11-23-claude-opus-45-model)和 [Opus 5.5 迁移指南](https://platform.claude.com/docs/en/models/opus-5-5/migration-guide#migrating-from-claude-opus-45)。

## 请求与响应

下面通过 routerlio 发送 Messages 请求，将 Opus 5.5 的 effort 从默认的 `medium` 调至 `high`。接入步骤见[快速接入](https://little-butterfly-9bfe.sentia389.workers.dev/start/index.md)。

```bash
ROUTERLIO_MODEL='claude-opus-5-5'

curl -sS \
  --url "${ROUTERLIO_BASE_URL:?请设置 ROUTERLIO_BASE_URL}/v1/messages" \
  --header "x-api-key: ${ROUTERLIO_API_KEY:?请设置 ROUTERLIO_API_KEY}" \
  --header 'anthropic-version: 2023-06-01' \
  --header 'Content-Type: application/json' \
  --data-binary @- <<JSON
{
  "model": "${ROUTERLIO_MODEL}",
  "max_tokens": 4096,
  "output_config": {
    "effort": "high"
  },
  "messages": [
    {
      "role": "user",
      "content": "订单已写入数据库，扣库存却失败。用一句话说明怎样利用事务避免数据不一致。"
    }
  ]
}
JSON
```

响应示例节选。遍历 `content[]` 的 `text` 块获取正文。

```json
{
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "将写订单和扣库存放在同一数据库事务中，两步都成功时才提交，任一步失败就回滚。"
    }
  ],
  "stop_reason": "end_turn"
}
```

## 排错

- 在 5.5 上遇到关闭 thinking 的错误时，省略 `thinking` 或使用 `adaptive`，并按需调低 effort。4.7 及更新型号拒绝 `enabled` 时，改用 `adaptive` 并移除 `budget_tokens`。参见 [Thinking 与 effort](https://little-butterfly-9bfe.sentia389.workers.dev/models/anthropic/thinking.md)。
- 模型找不到时，核对当前密钥可用的完整 ID 和所用协议。参见[错误排查](https://little-butterfly-9bfe.sentia389.workers.dev/troubleshooting/index.md)。

## 官方资料

- Claude 型号页 [Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview)、[Opus 5](https://platform.claude.com/docs/en/models/opus-5/overview)、[Opus 4.8](https://platform.claude.com/docs/en/models/opus-4-8/overview)、[Opus 4.7](https://platform.claude.com/docs/en/models/opus-4-7/overview)、[Opus 4.6](https://platform.claude.com/docs/en/models/opus-4-6/overview)。
- Anthropic 的[创建消息](https://platform.claude.com/docs/en/api/messages/create)、[Thinking 故障排查](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting)、[Effort](https://platform.claude.com/docs/en/build-with-claude/effort)、[模型生命周期](https://platform.claude.com/docs/en/about-claude/model-deprecations)。
