GPT-5.6 API 模型 ID 与调用方式
模型 ID
GPT-5.6 系列在 API 中的模型 ID:
| 规格 | API Model ID | 用途 |
|---|---|---|
| Sol | gpt-5.6-sol | 旗舰推理,ultra/max 档位 |
| Terra | gpt-5.6-terra | 均衡主力,日常生产 |
| Luna | gpt-5.6-luna | 高效入门,高吞吐 |
注意:GPT-5.6 系列只在 OpenAI 官方 API 平台(platform.openai.com)提供。在 Azure OpenAI、Amazon Bedrock 等第三方平台上的模型 ID 可能不同。
快速上手
Python(Responses API,推荐)
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.6-sol",
input=[
{
"role": "user",
"content": "用 Python 写一个快速排序,加上详细注释"
}
],
# 指定推理强度档位
reasoning={
"effort": "medium" # low / medium / high / xhigh / max
}
)
print(response.output_text)
推理强度配置
# Sol + max(单智能体最高)
response = client.responses.create(
model="gpt-5.6-sol",
input=[task],
reasoning={"effort": "max"}
)
# Sol + ultra(四智能体并行)
response = client.responses.create(
model="gpt-5.6-sol",
input=[task],
multi_agent={"enabled": True, "num_agents": 4}
)
# Terra + high(日常主力)
response = client.responses.create(
model="gpt-5.6-terra",
input=[task],
reasoning={"effort": "high"}
)
# Luna + low(高吞吐)
response = client.responses.create(
model="gpt-5.6-luna",
input=[task],
reasoning={"effort": "low"}
)
旧 Chat Completions API(仍兼容)
GPT-5.6 仍然兼容旧的 Chat Completions API,但建议迁移到 Responses API 以获得全部新特性:
# 旧 API(兼容模式)
response = client.chat.completions.create(
model="gpt-5.6-sol",
messages=[
{"role": "user", "content": "你好"}
]
)
基本响应结构
Responses API 返回的结构:
{
"id": "resp_xxx",
"model": "gpt-5.6-sol",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{"type": "output_text", "text": "..."}
]
}
],
"usage": {
"input_tokens": 1234,
"output_tokens": 567,
"total_tokens": 1801
},
"reasoning": {
"effort": "medium",
"summary": "..."
}
}
认证
使用 API 需要:
- 注册 platform.openai.com 账户
- 创建 API Key
- 充值或绑定信用卡(GPT-5.6 系列是付费模型)
- 设置为环境变量:
export OPENAI_API_KEY=sk-xxx
或在代码中直接指定:
client = OpenAI(api_key="sk-xxx")
第三方平台
Amazon Bedrock
| 规格 | Bedrock Model ID | 可用区域 |
|---|---|---|
| Sol | openai.gpt-5.6-sol | US East (N. Virginia), US East (Ohio) + CRIS |
| Terra | openai.gpt-5.6-terra | 同上 |
| Luna | openai.gpt-5.6-luna | 同上 |
CRIS(Cross-Region Inference)让 Sol 可以在 25+ AWS Regions 使用。
Azure OpenAI
| 规格 | 可用性 |
|---|---|
| Sol | 全球标准版,所有 Azure 区域 |
| Terra | 全球标准版 |
| Luna | 全球标准版 |
Jatevo 等第三方 API 网关
部分第三方 API 网关也提供 GPT-5.6 系列,用于需要统一多个模型供应商的场景。
注意事项
Luna 的模型 ID 可能变化
OpenAI 有时会微调和重命名非旗舰模型。如果 API 返回"model not found",检查最新的模型列表:
GET https://api.openai.com/v1/models
上下文长度限制
GPT-5.6 系列的上下文窗口(最大输入 + 输出 Token)默认 270K。如果你的需求更大,可以联系 OpenAI 企业销售。
速率限制
API 账户有 QPS 和 Token 速率限制。具体额度取决于你的账户等级和用量。超过限制会返回 429 错误。