返回模型列表

Claude Opus 4.7

anthropicanthropic/claude-opus-4.7

API 使用指南

Chat 调用

标准 chat 调用。TheRouter 通过 OpenAI 兼容的 /v1/chat/completions 接口提供 Anthropic 模型。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{"role": "user", "content": "Refactor this Python function for clarity."}]
  }'

流式输出

边生成边推送 token,适合聊天界面和长文生成。Opus 4.7 在 xhigh 档位首 token 可能需要数秒,流式可以让结果尽快显示。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "stream": true,
    "messages": [{"role": "user", "content": "Explain MoE routing in 200 words."}]
  }'

工具调用

Opus 4.7 是首个通过 Anthropic 'implicit-need' 工具测试的 Claude 模型——能在没有显式指令时推断该调用哪个工具。工具调用错误率约为 Opus 4.6 的三分之一。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{"role": "user", "content": "What is the weather in Tokyo right now?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }]
  }'

结构化 JSON 输出

通过 response_format 强制输出合法 JSON,适合抽取流水线和下游解析器。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "response_format": {"type": "json_object"},
    "messages": [
      {"role": "system", "content": "Respond with JSON: {\"sentiment\":string,\"score\":number}"},
      {"role": "user", "content": "Service was excellent, food cold."}
    ]
  }'

视觉输入

Opus 4.7 接受长边最大 2,576 px(约 3.75 MP)的图像。在 OpenAI 兼容 content 数组中使用 base64 或 URL 引用。对超大截图或扫描版 PDF,这是真正影响实际效果的升级。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "What error is shown in this screenshot?"},
        {"type": "image_url", "image_url": {"url": "https://example.com/screenshot.png"}}
      ]
    }]
  }'

推理强度

Opus 4.7 使用 adaptive thinking——通过 reasoning.effort 字段(low/medium/high/xhigh/max)控制深度。手动 budget_tokens 已不再支持。Anthropic 建议编程和 agent 任务用 xhigh,对智能要求高的任务把 high 作为下限,只在 evals 证明 xhigh 还有上升空间时才用 max。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.7",
    "reasoning": {"effort": "xhigh"},
    "max_tokens": 65536,
    "messages": [{"role": "user", "content": "Diagnose this concurrency bug: ..."}]
  }'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期www.anthropic.com2026-05-22已核实
Anthropic 模型 iddocs.anthropic.com2026-05-22已核实
训练数据截止未知
推理强度档位platform.claude.com2026-05-22已核实
视觉输入最大分辨率www.anthropic.com2026-05-22已核实
Tokenizer 与 Opus 4.6 的差异www.anthropic.com2026-05-22已核实
部署平台aws.amazon.com2026-05-22已核实
许可已核实
SWE-bench Verifiedwww.anthropic.com2026-05-22已核实
SWE-bench Prowww.anthropic.com2026-05-22已核实
Terminal-Bench 2.0www.anthropic.com2026-05-22已核实
GPQA Diamondwww.anthropic.com2026-05-22已核实
MCP-Atlaswww.anthropic.com2026-05-22已核实
Finance Agentwww.anthropic.com2026-05-22已核实
Humanity's Last Exam (with tools)www.anthropic.com2026-05-22已核实
XBOW visual acuitywww.anthropic.com2026-05-22已核实
Anthropic 发布 Claude Opus 4.7:新增 xhigh 推理档与 3.75 MP 视觉输入anthropic.com/news2026-05-22已核实
Claude Opus 4.7 发布日即可在 Amazon Bedrock 调用aws.amazon.com/blogs/aws2026-05-22已核实
Anthropic 停用手动 budget_tokens:Opus 4.7 强制使用 adaptive thinkingplatform.claude.com2026-05-22已核实
Opus 4.7 在编程上比 Opus 4.6 强多少?www.anthropic.com2026-05-22待核实
调用 Opus 4.7 需要改 API 代码吗?platform.claude.com2026-05-22待核实
什么时候用 xhigh,什么时候用 max?platform.claude.com2026-05-22待核实
Opus 4.7 接受多大分辨率的图像?www.anthropic.com2026-05-22待核实
Opus 4.7 在哪些平台可调用?aws.amazon.com2026-05-22待核实
客服支持