返回模型列表
GPT-5.1 Codex Mini
openaiopenai/gpt-5.1-codex-mini
API 使用指南
Chat 调用
GPT-5.1-Codex-Mini 使用标准的 chat completions 端点。为在交互式编程任务中获得最佳延迟,将 reasoning_effort 设为 'none'(默认)或 'low'。对于更复杂的编程任务,'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-mini","messages":[{"role":"user","content":"Write a function to merge two sorted arrays in TypeScript"}],"reasoning_effort":"low"}'推理努力
GPT-5.1-Codex-Mini 支持自适应推理。对于延迟敏感的编程任务,将 reasoning_effort 设为 'none'(默认)以获得快速直接响应。对于更复杂的代码生成或调试,请使用 'low' 或 'medium'。该模型不支持 'xhigh'(仅在 Codex-Max 上可用)。
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-mini","messages":[{"role":"user","content":"Debug why this React component is re-rendering infinitely:\n\nfunction Counter() { const [count, setCount] = useState(0); useEffect(() => { setCount(count + 1); }); return <p>{count}</p>; }"}],"reasoning_effort":"medium"}'函数调用
GPT-5.1-Codex-Mini 支持标准工具/函数调用,适用于轻量级 agentic 模式。对于简单的单工具编排(代码修复、文件编辑),它提供快速、经济高效的结果。复杂的多工具工作流请路由到 GPT-5.1-Codex 或 GPT-5.1-Codex-Max。
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-mini","messages":[{"role":"user","content":"Check if package.json exists in the project root"}],"tools":[{"type":"function","function":{"name":"file_exists","description":"Check if a file exists at a given path","parameters":{"type":"object","properties":{"path":{"type":"string","description":"File path to check"}},"required":["path"]}}}],"tool_choice":"auto","reasoning_effort":"none"}'事实档案 — 本页每条断言可在此回溯来源
| 来源 | URL | 采集于 | |
|---|---|---|---|
| 发布日期 | openai.com ↗ | 2026-05-28 | 已核实 |
| OpenAI API 模型 id | openai.com ↗ | 2026-05-28 | 已核实 |
| 模型类型 | openai.com ↗ | 2026-05-28 | 已核实 |
| 推理努力级别 | openai.com ↗ | 2026-05-28 | 已核实 |
| 输入模态 | openai.com ↗ | 2026-05-28 | 已核实 |
| 许可 | — | — | 已核实 |
| SWE-bench Verified | openai.com ↗ | 2026-05-28 | 未知 |
| OpenAI 为开发者发布 GPT-5.1、GPT-5.1-Codex 和 GPT-5.1-Codex-Mini | openai.com ↗ | 2026-05-28 | 已核实 |
| GPT-5.1-Codex-Mini 在 GitHub Copilot 公开预览中可用 | github.blog ↗ | 2026-05-28 | 已核实 |
| GPT-5.1 模型从 ChatGPT 退役(API 不受影响) | help.openai.com ↗ | 2026-05-28 | 已核实 |
| GPT-5.1-Codex-Mini 与 GPT-5.1-Codex 有何不同? | openai.com ↗ | 2026-05-28 | 待核实 |
| GPT-5.1-Codex-Mini 是否支持压缩或多窗口上下文? | openai.com ↗ | 2026-05-28 | 待核实 |
| 我可以将 GPT-5.1-Codex-Mini 用于非编程任务吗? | openai.com ↗ | 2026-05-28 | 待核实 |
| 我应该为 GPT-5.1-Codex-Mini 使用什么推理努力级别? | openai.com ↗ | 2026-05-28 | 待核实 |