返回模型列表

GPT-5.1-Codex-Max

openaiopenai/gpt-5.1-codex-max

API 使用指南

Chat 调用

GPT-5.1-Codex-Max 通过标准 chat completions 端点访问。对于 agentic 编程工作流,请通过 Codex 或兼容框架路由以利用 apply_patch 和 shell 工具。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.1-codex-max","messages":[{"role":"user","content":"Write a Python script that monitors CPU usage and logs to a file"}],"reasoning_effort":"medium"}'

推理努力

GPT-5.1-Codex-Max 支持五级自适应推理。对非延迟敏感、需要最高准确率的任务使用 'xhigh',对大多数编程任务使用推荐的 'medium' 级别。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.1-codex-max","messages":[{"role":"user","content":"Refactor this entire codebase to use async/await"}],"reasoning_effort":"xhigh"}'

函数调用

GPT-5.1-Codex-Max 支持工具/函数调用,用于结构化 agentic 工作流。标准工具定义可通过 TheRouter API 使用。对于 Codex 原生工具(apply_patch、shell),请通过 Codex 兼容框架路由。

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.1-codex-max","messages":[{"role":"user","content":"Find all files larger than 10MB in the repo and list them"}],"tools":[{"type":"function","function":{"name":"list_large_files","description":"List files over a certain size","parameters":{"type":"object","properties":{"size_mb":{"type":"number","description":"Minimum size in MB"}},"required":["size_mb"]}}}],"tool_choice":"auto"}'
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期openai.com ↗2026-05-28已核实
OpenAI API 模型 idopenai.com ↗2026-05-28已核实
模型类型openai.com ↗2026-05-28已核实
推理类型openai.com ↗2026-05-28已核实
上下文压缩openai.com ↗2026-05-28已核实
Windows 环境支持openai.com ↗2026-05-28已核实
网络安全能力(Preparedness Framework)openai.com ↗2026-05-28已核实
许可——已核实
SWE-bench Verifiedopenai.com ↗2026-05-28已核实
SWE-Lancer IC SWEopenai.com ↗2026-05-28已核实
Terminal-Bench 2.0openai.com ↗2026-05-28已核实
OpenAI 发布 GPT-5.1-Codex-Max,具备压缩功能和 xhigh 推理openai.com ↗2026-05-28已核实
GPT-5.1-Codex-Max 与 GPT-5.1-Codex 有何不同?openai.com ↗2026-05-28待核实
GPT-5.1-Codex-Max 可通过 OpenAI API 访问,还是仅在 Codex 中可用?openai.com ↗2026-05-28待核实
GPT-5.1-Codex-Max 可以用于通用推理任务吗?openai.com ↗2026-05-28待核实
帮助与联系