O4-mini API is designed to deliver high performance in tasks such as mathematics, coding, science, and visual reasoning, while maintaining efficiency and accessibility.

Overview
The o4-mini is part of OpenAI’s o-series, a family of models trained to deliberate before responding, resulting in higher-quality answers for complex queries. It stands out for its ability to integrate tools like web browsing, Python code execution, image processing, and image generation, enabling it to tackle multi-step problems with a level of autonomy that approaches agent-like behavior.
Key Features of o4-mini
- Visual Reasoning: o4-mini can process and reason with images, including low-quality visuals like blurry photos or sketches. It can manipulate images (e.g., rotating, zooming) to support tasks like interpreting diagrams or scientific figures .
- Tool Integration: It has full access to ChatGPT’s tools, including web search, file analysis with Python, and image generation, making it versatile for complex workflows.
- Conversational Naturalness: The model exhibits improved instruction following and can reference past conversations, enhancing its usability in interactive settings.
- Efficiency and Scalability: Optimized for high-volume queries, o4-mini supports higher usage limits than o3, ideal for real-world applications.
- Cost-Effectiveness: Priced at $1.10 for input and $4.40 for output per million tokens, it offers a competitive balance of speed, cost, and performance.
Technical Details o4-mini
Model Architecture and Training
- Size and Efficiency: As a smaller model compared to o3, o4-mini is engineered for efficiency, prioritizing speed and cost without compromising performance.
- Training Approach: Utilizes large-scale reinforcement learning, following the trend where increased computational resources enhance model performance.
- API Capabilities: Supports function calling for custom tools and is accessible via the Chat Completions API and Responses API. Future updates will include built-in tools like web search, file search, and code interpreter.
Safety and Preparedness
- Safety Protocols: o4-mini has undergone rigorous stress-testing under OpenAI’s safety program and is evaluated using the updated Preparedness Framework.
- Risk Mitigation: It falls below the “High” risk threshold in areas like biological/chemical risks, cybersecurity, and AI self-improvement, with ~99% flagging accuracy for biorisk conversations during red-teaming.
- Transparency: OpenAI provides a detailed system card outlining safety and performance metrics.
Benchmark Performance
o4-mini has demonstrated exceptional performance across a range of benchmarks, showcasing its versatility and strength. The following table summarizes its results:
Benchmark | Accuracy (%) | Notes |
---|---|---|
AIME 2024 Competition Math | 93.4 | Best-performing model |
AIME 2025 Competition Math | 92.7 | Outperforms o3-mini (86.5) |
Codeforces Competition Code | 2719 ELO | With terminal, outperforms o3 (2706 ELO) |
GPQA Diamond PhD-Level Science | 81.4 | Outperforms o3-mini (77.0) |
MMMU College-level Visual | 81.6 | Outperforms o1 (77.6) |
MathVista Visual Math Reasoning | 84.3 | Outperforms o1 (71.8) |
CharXiv-Reasoning Scientific Figure | 72.0 | Outperforms o1 (55.1) |
SWE-Bench Verified Software | 68.1 | Outperforms o1 (48.9) |
Aider Polyglot Code Editing | 68.9% (whole), 58.2% (diff) | Outperforms o3-mini-high (61.7% diff) |
Scale MultiChallenge Multi-turn | 42.99 | Outperforms o3-mini (39.89) |
BrowseComp Agentic Browsing | 51.5 | With Python + browsing, outperforms o3 (49.7) |
Tau-bench Function Calling | 49.2% (Airline), 65.6% (Retail) | Outperforms o3-mini-high (32.4% Airline) |
Humanity’s Last Exam Expert-Level | 17.70 (no tools), 26.60 (with Python + browsing) | Outperforms o3-mini (14.28 no tools) |
SWE-Lancer IC SWE Diamond | $56,375 earned | Outperforms o3-mini-high ($17,375) |
Application Scenarios Example
1. Function Calling for Custom Tools
o4-mini supports function calling to integrate custom tools, such as web search and Python execution for data analysis:
{
"model": "o4-mini",
"messages": [
{"role": "user", "content": "What is the summer energy usage in California?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "web_search",
"description": "Search the web for information",
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "The search query"}
},
"required": ["query"]
}
}
},
{
"type": "function",
"function": {
"name": "python",
"description": "Execute Python code",
"parameters": {
"type": "object",
"properties": {
"code": {"type": "string", "description": "The Python code to execute"}
},
"required": ["code"]
}
}
}
],
"tool_choice": "auto"
}
- Workflow: o4-mini searches for energy usage data, analyzes it with Python, and can generate visual outputs like graphs.
- Access: Available through the CometAPI API, without organization verification required (API Verification).
2.Integration with Codex CLI
o4 mini is supported by Codex CLI, an open-source coding agent that runs locally in terminals, accessible on GitHub. This tool simplifies connecting o4-mini to local coding tasks, with support for GPT-4.1 planned soon.
See Also GPT-4.1 API and O3 API.
How to call o4-mini
API from CometAPI
o4-mini
API Pricing in CometAPI,20% off the official price:
- Input Tokens: $0.88 / M tokens
- Output Tokens: $3.52/ M tokens
Required Steps
- Log in to cometapi.com. If you are not our user yet, please register first
- Get the access credential API key of the interface. Click “Add Token” at the API token in the personal center, get the token key: sk-xxxxx and submit.
- Get the url of this site: https://api.cometapi.com/
Useage Methods
- Select the “
o4-mini
/ o4-mini-2025-04-16” endpoint to send the API request and set the request body. The request method and request body are obtained from our website API doc. Our website also provides Apifox test for your convenience. - Replace <YOUR_AIMLAPI_KEY> with your actual CometAPI key from your account.
- Insert your question or request into the content field—this is what the model will respond to.
- . Process the API response to get the generated answer.
For Model lunched information in Comet API please see https://api.cometapi.com/new-model.
For Model Price information in Comet API please see https://api.cometapi.com/pricing.
API Usage Example
Developers can interact with o4-mini
through CometAPI’s API, enabling integration into various applications. Below is a Python example :
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.cometapi.com/v1/chat/completions",
api_key="<YOUR_API_KEY>",
)
response = openai.ChatCompletion.create(
model="o4-mini",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain the concept of quantum entanglement."}
]
)
print(response['choices'][0]['message']['content'])
This script sends a prompt to the o4-mini
model and prints the generated response, demonstrating how to utilize o4-mini
for complex explanations.