o4-mini
API guide
Chat completion
o4-mini is available through TheRouter's standard /v1/chat/completions endpoint. Use the same OpenAI SDK pattern as any other model β just change model to 'openai/o4-mini'. Note: deprecation announced; migrate to gpt-5.4-mini before Oct 2026.
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."}]}'Streaming
o4-mini supports streaming with fast time-to-first-token. Unlike o3-pro, o4-mini was designed for speed β streaming is the recommended mode for interactive use.
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}'Tool use / Function calling
o4-mini has full function calling support and was trained via reinforcement learning to reason about when and how to use tools. It can chain web search, Python execution, and file analysis autonomously.
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"]}}}]}'Structured Outputs
o4-mini supports structured outputs via response_format. Use json_object for flexible JSON or json_schema for strict type enforcement.
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"}}'Reasoning effort
o4-mini supports adjustable reasoning effort (low/medium/high). At high effort, o4-mini delivers its best performance β particularly on math and coding tasks. For maximum throughput, use low or medium.
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"}}'Part of
Recent coverage
Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | openai.com β | 2026-05-30 | verified |
| Training cutoff | developers.openai.com β | 2026-05-30 | verified |
| Model snapshot | developers.openai.com β | 2026-05-30 | verified |
| Predecessor | openai.com β | 2026-05-30 | verified |
| Successor | developers.openai.com β | 2026-05-30 | verified |
| Fine-tuning | developers.openai.com β | 2026-05-30 | verified |
| AIME 2025 (with Python) | openai.com β | 2026-05-30 | verified |
| AIME 2024 | pricepertoken.com β | 2026-05-30 | to verify |
| SWE-bench Verified | datacamp.com β | 2026-05-30 | to verify |
| Codeforces | openai.com β | 2026-05-30 | single source |
| MMMU | openai.com β | 2026-05-30 | single source |
| o4-mini officially deprecated β shutdown October 23, 2026 | developers.openai.com β | 2026-05-30 | verified |
| o4-mini removed from ChatGPT with GPT-5 launch | simonwillison.net β | 2026-05-30 | verified |
| OpenAI launches o4-mini β best model on AIME 2024 and 2025, with tool use and image reasoning | openai.com β | 2026-05-30 | verified |
| Is o4-mini deprecated? When will it stop working? | developers.openai.com β | 2026-05-30 | to verify |
| What should I migrate to from o4-mini? | developers.openai.com β | 2026-05-30 | to verify |
| How is o4-mini different from o3? | openai.com β | 2026-05-30 | to verify |
| Can o4-mini use tools like web search and Python? | openai.com β | 2026-05-30 | to verify |
| Can o4-mini process images? | openai.com β | 2026-05-30 | to verify |