OpenAI MaaS API
约 2 分钟阅读
- OpenAI API
- Responses / OpenResponses
- OpenAI compatible servers
- Tools
- 价格
Chat / Responses
- Chat Completions 是常见兼容接口。
- Responses API 是 OpenAI 新一代统一接口。
- MaaS 网关通常需要同时兼容 OpenAI Chat Completions、Responses 以及厂商私有字段。
Streaming
- OpenAI streaming 细节见 sse笔记MaaS SSE第一个 chunk 通常只有 ,没有内容。 · 后续 chunk 通常有 ,没有 。 · 最后的 chunk 里 和 可能分开出现。 · 第一个 chunk 和最后一个 chunk 通常不应该包含正常 content。 · 有些供应商为了紧凑,会在第一个 chunk 包含内容。打开:/notes/ai/maas/spec/sse。
ToolChoice
auto- 自动选择工具。
required- 必须使用工具。
none- 不使用工具。
Role
| role | 说明 |
|---|---|
developer | 新版 OpenAI 指令角色,优先级高于 user |
system | 系统指令 |
user | 用户消息 |
assistant | 模型回复 |
tool | 新版 OpenAI 工具结果 role |
function | 旧版 OpenAI function calling role |
Reasoning details
{
"type": "reasoning.summary",
"summary": "The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...",
"id": "reasoning-summary-1",
"format": "anthropic-claude-v1",
"index": 0
}typereasoning.summaryreasoning.encryptedreasoning.text
- 用于维护思考细节信息。
- 相关模型/能力
- OpenAI o 系列
- Claude 3.7+ thinking
- Gemini Reasoning
- xAI Reasoning
参考:openrouter.ai/docs/guides/best-practices/reasoning-tokens
Prompt caching
- OpenAI prompt cache 细节见 cache笔记MaaS Prompt Cache| 模型 / 场景 | 最小缓存 Token 数 | · | Claude Opus 4.5 | 4096 | · | Claude Opus 4.1, 4 | 1024 | · | Claude Sonnet 4.5, 4, 3.7 | 1024 |打开:/notes/ai/maas/spec/cache。
- 参考
错误码
Models
| model | in | cache read | cache write | out | note |
|---|---|---|---|---|---|
gpt-5.6 | $5.00 | $0.50 | $6.25 | $30.00 | alias,路由到 gpt-5.6-sol |
gpt-5.6-sol | $5.00 | $0.50 | $6.25 | $30.00 | flagship / frontier capability |
gpt-5.6-terra | $2.50 | $0.25 | $3.125 | $15.00 | balanced,约等于旧 mini 档位 |
gpt-5.6-luna | $1.00 | $0.10 | $1.25 | $6.00 | efficient / high-volume,约等于旧 nano 档位 |
gpt-5.5 | $5.00 | $0.50 | - | $30.00 | 旧 flagship;>272K 同样有 long-context tier |
gpt-5.5-pro | $30.00 | - | - | $180.00 | 旧独立 Pro 模型;GPT-5.6 改为 reasoning.mode: "pro" |
- Context Window
- GPT 5.5, GPT 5.6 - 1.05M, 128K Output, 272K Long Context
GPT 5.6
gpt-5.6是 alias,默认指向gpt-5.6-sol;生产建议按需要 pin 到gpt-5.6-sol/gpt-5.6-terra/gpt-5.6-luna。gpt-5.6-sol:最高能力,适合复杂 coding、agentic workflow、深度分析。gpt-5.6-terra:能力和成本平衡,适合作为多数生产 workload 的默认候选。gpt-5.6-luna:最低成本、最高吞吐取向,适合高频、批量、低延迟或成本敏感场景。- 支持
reasoning.effort: none | low | medium | high | xhigh | max。 - 支持
reasoning.mode: "pro";GPT-5.6 不再通过单独*-promodel slug 表达 Pro mode。 - 支持 explicit prompt caching:cache write 按 uncached input 的 1.25× 计费,cache read 仍为折扣价。
| input tokens | input / cache read / cache write | output | 说明 |
|---|---|---|---|
<=272K | 1× | 1× | 标准价格 |
>272K | 2× | 1.5× | long-context tier,注意可能按整次 request / session 计价 |
参考:
- developers.openai.com/api/docs/pricing.md
- developers.openai.com/api/docs/guides/latest-model
- developers.openai.com/api/docs/models/gpt-5.6-sol
- developers.openai.com/api/docs/models/gpt-5.6-terra
- developers.openai.com/api/docs/models/gpt-5.6-luna
- developers.openai.com/api/docs/models/gpt-5.5
GPT-5.5
亚洲AV
GPT-6-Astra
Winvalid түркистан关联信息
反向链接、本文链接的其他页面和外部资料。
站内链接
- MaaS Prompt Cache笔记 · cache
| 模型 / 场景 | 最小缓存 Token 数 | · | Claude Opus 4.5 | 4096 | · | Claude Opus 4.1, 4 | 1024 | · | Claude Sonnet 4.5, 4, 3.7 | 1024 |
- MaaS SSE笔记 · sse
第一个 chunk 通常只有 ,没有内容。 · 后续 chunk 通常有 ,没有 。 · 最后的 chunk 里 和 可能分开出现。 · 第一个 chunk 和最后一个 chunk 通常不应该包含正常 content。 · 有些供应商为了紧凑,会在第一个 chunk 包含内容。
参考资料
GitHub1 条
- code-yeongyu/pi-apply-patchgithub.com/code-yeongyu/pi-apply-patch
其他外链17 条
- developers.openai.com/api/docs/guides/latest-modeldevelopers.openai.com/api/docs/guides/latest-model
- developers.openai.com/api/docs/guides/prompt-cachingdevelopers.openai.com/api/docs/guides/prompt-caching
- developers.openai.com/api/docs/guides/tools-apply-patchdevelopers.openai.com/api/docs/guides/tools-apply-patch
- developers.openai.com/api/docs/models/gpt-5.5developers.openai.com/api/docs/models/gpt-5.5
- developers.openai.com/api/docs/models/gpt-5.6-lunadevelopers.openai.com/api/docs/models/gpt-5.6-luna
- developers.openai.com/api/docs/models/gpt-5.6-soldevelopers.openai.com/api/docs/models/gpt-5.6-sol
- developers.openai.com/api/docs/models/gpt-5.6-terradevelopers.openai.com/api/docs/models/gpt-5.6-terra
- developers.openai.com/api/docs/pricingdevelopers.openai.com/api/docs/pricing
- developers.openai.com/api/docs/pricing.mddevelopers.openai.com/api/docs/pricing.md
- docs.vllm.ai/en/v0.10.2/api/vllm/entrypoints/openai/serving_completion.htmldocs.vllm.ai/en/v0.10.2/api/vllm/entrypoints/openai/serving_completion.html
- help.openai.com/en/articles/11481834-chatgpt-rate-card-business-enterpriseeduhelp.openai.com/en/articles/11481834-chatgpt-rate-card-business-enterpriseedu
- help.openai.com/en/articles/20001106-codex-rate-cardhelp.openai.com/en/articles/20001106-codex-rate-card
- openrouter.ai/docs/guides/best-practices/reasoning-tokensopenrouter.ai/docs/guides/best-practices/reasoning-tokens
- platform.openai.com/docs/api-reference/chat/createplatform.openai.com/docs/api-reference/chat/create
- platform.openai.com/docs/guides/error-codesplatform.openai.com/docs/guides/error-codes
- platform.openai.com/docs/guides/prompt-cachingplatform.openai.com/docs/guides/prompt-caching
- www.openresponses.orgwww.openresponses.org/