Back to Models

o4-mini

openaiopenai/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
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
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
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
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
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"}}'

Recent coverage

Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-30verified
Training cutoffdevelopers.openai.com β†—2026-05-30verified
Model snapshotdevelopers.openai.com β†—2026-05-30verified
Predecessoropenai.com β†—2026-05-30verified
Successordevelopers.openai.com β†—2026-05-30verified
Fine-tuningdevelopers.openai.com β†—2026-05-30verified
AIME 2025 (with Python)openai.com β†—2026-05-30verified
AIME 2024pricepertoken.com β†—2026-05-30to verify
SWE-bench Verifieddatacamp.com β†—2026-05-30to verify
Codeforcesopenai.com β†—2026-05-30single source
MMMUopenai.com β†—2026-05-30single source
o4-mini officially deprecated β€” shutdown October 23, 2026developers.openai.com β†—2026-05-30verified
o4-mini removed from ChatGPT with GPT-5 launchsimonwillison.net β†—2026-05-30verified
OpenAI launches o4-mini β€” best model on AIME 2024 and 2025, with tool use and image reasoningopenai.com β†—2026-05-30verified
Is o4-mini deprecated? When will it stop working?developers.openai.com β†—2026-05-30to verify
What should I migrate to from o4-mini?developers.openai.com β†—2026-05-30to verify
How is o4-mini different from o3?openai.com β†—2026-05-30to verify
Can o4-mini use tools like web search and Python?openai.com β†—2026-05-30to verify
Can o4-mini process images?openai.com β†—2026-05-30to verify
Help & contact