Claude Opus 4.7 新參數指南

本文介紹 Claude Opus 4.7 推理控制的兩項重要變更,並完整說明如何在 AIHubmix 原生 API 和 Chat 統一介面中使用。另請參閱:Anthropic 官方公告與模型變更記錄。

推理時代閱讀約 3 分鐘
Claude Opus 4.7 新參數指南

​1. 全新推理控制功能

​✦ 全新 xhigh 推理強度

全新的 xhigh 等級介於 high 和 max 之間,專為程式撰寫與 Agent 任務設計,在能力與效率之間取得更好的平衡。

low  ──  medium  ──  high  ──  xhigh ★NEW  ──  max

​✦ 思考內容預設為隱藏

在串流回應中,思考過程不再預設顯示。若要取得推理摘要,請在請求中明確傳入 display 欄位:

display 值Opus 4.7Opus 4.6行為
”omitted”預設非預設思考區塊內容為空
”summarized”必須手動設定預設回傳思考摘要文字
"reasoning": {
  "effort": "xhigh",
  "display": "summarized"
}
圖:Opus 4.7 全新 xhigh 等級 — Agent 程式撰寫效能比較(來源:Anthropic 官方)
Image

​2. Claude 原生 API 參考

​Anthropic 原生 API 的 effort 值與官方規格一致:

effort 值支援的模型說明建議使用情境
low所有支援的模型大幅節省 token,能力僅適度降低簡單任務、高併發請求、子 Agent
medium所有支援的模型平衡模式,適度節省 token一般 Agent 任務
high所有支援的模型預設值;高效能表現複雜推理、程式撰寫、Agent 任務
xhigh(新增)僅限 Opus 4.7能力介於 high 與 max 之間;擅長長期任務建議作為程式撰寫與 Agent 任務的起始設定
maxOpus 系列最高能力前沿研究問題

​AIHubmix Claude 原生 API — Opus 4.7 範例

from anthropic import Anthropic

client = Anthropic(
    api_key="<AIHUBMIX_API_KEY>",
    base_url="https://aihubmix.com"
)

response = client.messages.create(
    model="claude-opus-4-7",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    output_config={"effort": "xhigh"},  # Options: low / medium / high / xhigh / max
    messages=[
        {
            "role": "user",
            "content": "A snail is at the bottom of a 10-meter well. Each day it climbs 3 meters, but each night it slides back 2 meters. How many days does it take to reach the top?"
        }
    ]
)

print(response.content[-1].text)

​3. AIHubmix Chat 統一介面的推理強度支援

AIHubMix Chat 統一介面遵循 OpenAI 規格,並透過 reasoning.effort 控制推理強度。不同的 Claude 模型會自動對應至相應的強度等級:

​reasoning_effort (Claude 模型的推理強度控制)

effort 值Opus >=4.7(新增)Opus 4.6 / 4.5Sonnet 4.6
minimallowlowlow
mediummediummediummedium
highhighhighhigh
xhighxhighmaxhigh
maxmaxmaxhigh

注意: xhigh 僅 Opus 4.7 原生支援。其他 Opus 模型會自動退回 max,Sonnet 系列則會退回 high。

​Chat 統一介面 — Opus 4.7 範例

from openai import OpenAI

client = OpenAI(
    base_url="https://aihubmix.com/v1",
    api_key="<AIHUBMIX_API_KEY>",
)

completion = client.chat.completions.create(
    model="claude-opus-4-7",
    # max_tokens=10000,  # Default is 4096; enable for longer outputs
    messages=[
        {
            "role": "user",
            "content": "A snail is at the bottom of a 10-meter well. Each day it climbs 3 meters, but each night it slides back 2 meters. How many days does it take to reach the top?"
        }
    ],
    extra_body={
        "reasoning": {"effort": "xhigh"}
    }
)

print(completion.choices[0].message.content)

​4. 在 Chat 統一介面中控制思考內容

在 OpenAI 相容介面中,reasoning 支援 display 欄位,可控制是否回傳思考摘要。Claude Opus 4.7 預設不會回傳思考內容。設定 "display": "summarized" 即可啟用。

欄位值說明
display(省略)不回傳思考內容(預設)
display"summarized"回傳思考摘要

​Opus 4.7 — 思考摘要範例

from openai import OpenAI

client = OpenAI(
    base_url="https://aihubmix.com/v1",
    api_key="<AIHUBMIX_API_KEY>",
)

completion = client.chat.completions.create(
    model="claude-opus-4-7",
    messages=[
        {
            "role": "user",
            "content": "A snail is at the bottom of a 10-meter well. Each day it climbs 3 meters, but each night it slides back 2 meters. How many days does it take to reach the top?"
        }
    ],
    extra_body={
        "reasoning": {"effort": "xhigh", "display": "summarized"}
    }
)

print(completion.choices[0].message.content)

​如需進一步了解,請參閱 AIHubmix 文件或 Anthropic 官方文件。

最後更新:2026-06-01