返回模型列表
o4-mini
openaiopenai/o4-mini
API 使用指南
Chat 调用
o4-mini 通过 TheRouter 标准 /v1/chat/completions 端点可用。使用与任何其他模型相同的 OpenAI SDK 模式——只需将 model 更改为 'openai/o4-mini'。注意:已宣布弃用;请在 2026 年 10 月前迁移至 gpt-5.4-mini。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/o4-mini","messages":[{"role":"user","content":"Explain Bayes Theorem with a practical example."}]}'流式输出
o4-mini 支持流式输出,具有快速的首 token 时间。与 o3-pro 不同,o4-mini 专为速度设计——流式输出是交互式使用的推荐模式。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/o4-mini","messages":[{"role":"user","content":"Write a Python function to find prime numbers efficiently."}],"stream":true}'工具调用 / 函数调用
o4-mini 拥有完整的函数调用支持,并通过强化学习训练以推理何时以及如何使用工具。它可以自主串联网络搜索、Python 执行和文件分析。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/o4-mini","messages":[{"role":"user","content":"What is the weather in Tokyo and should I bring an umbrella?"}],"tools":[{"type":"function","function":{"name":"get_weather","description":"Get current weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]}'结构化输出
o4-mini 通过 response_format 支持结构化输出。使用 json_object 进行灵活 JSON 输出,或使用 json_schema 进行严格类型强制。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/o4-mini","messages":[{"role":"user","content":"Extract: John Doe, 35, Software Engineer"}],"response_format":{"type":"json_object"}}'推理强度
o4-mini 支持可调节的推理强度(低/中/高)。在高强度下,o4-mini 提供最佳性能——尤其是在数学和编程任务上。为获得最大吞吐量,使用低或中等强度。
cURL
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/o4-mini","messages":[{"role":"user","content":"Solve this integral: ∫ x²e^x dx"}],"reasoning":{"effort":"high"}}'所属专题
近期动态
事实档案 — 本页每条断言可在此回溯来源
| 来源 | URL | 采集于 | |
|---|---|---|---|
| 发布日期 | openai.com ↗ | 2026-05-30 | 已核实 |
| 训练数据截止 | developers.openai.com ↗ | 2026-05-30 | 已核实 |
| 模型快照 | developers.openai.com ↗ | 2026-05-30 | 已核实 |
| 前身 | openai.com ↗ | 2026-05-30 | 已核实 |
| 接替模型 | developers.openai.com ↗ | 2026-05-30 | 已核实 |
| 微调 | developers.openai.com ↗ | 2026-05-30 | 已核实 |
| AIME 2025 (with Python) | openai.com ↗ | 2026-05-30 | 已核实 |
| AIME 2024 | pricepertoken.com ↗ | 2026-05-30 | 待核实 |
| SWE-bench Verified | datacamp.com ↗ | 2026-05-30 | 待核实 |
| Codeforces | openai.com ↗ | 2026-05-30 | 单一来源 |
| MMMU | openai.com ↗ | 2026-05-30 | 单一来源 |
| o4-mini 正式弃用——2026 年 10 月 23 日关闭 | developers.openai.com ↗ | 2026-05-30 | 已核实 |
| o4-mini 随 GPT-5 发布从 ChatGPT 中移除 | simonwillison.net ↗ | 2026-05-30 | 已核实 |
| OpenAI 发布 o4-mini——AIME 2024 和 2025 最佳模型,具备工具使用和图像推理能力 | openai.com ↗ | 2026-05-30 | 已核实 |
| o4-mini 是否已弃用?何时停止工作? | developers.openai.com ↗ | 2026-05-30 | 待核实 |
| 我应该从 o4-mini 迁移到什么? | developers.openai.com ↗ | 2026-05-30 | 待核实 |
| o4-mini 与 o3 有何不同? | openai.com ↗ | 2026-05-30 | 待核实 |
| o4-mini 可以使用网络搜索和 Python 等工具吗? | openai.com ↗ | 2026-05-30 | 待核实 |
| o4-mini 能处理图像吗? | openai.com ↗ | 2026-05-30 | 待核实 |