O4 Mini
OpenAI o4-mini enhances decision-making by processing text and images with advanced reasoning capabilities.
API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const axios = require('axios');
const fs = require('fs');
const path = require('path');
// helper function to help you convert your local images into base64 format
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/o4-mini";
const data = {
"messages": [
{
"role": "user",
"content": [{"type":"image_url","image_url":{"url":"https://segmind-sd-models.s3.us-east-1.amazonaws.com/display_images/kling-1.6-i2v-ip.png"}},{"type":"text","text":"Describe this image."}]
},
{
"role": "assistant",
"content": "The image shows..."
}
]
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
Attributes
An array of objects containing the role and content
Could be "user", "assistant" or "system".
A string containing the user's query or the assistant's response.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Resources to get you started
Everything you need to know to get the most out of O4 Mini
Effective Guide to Using OpenAI o4-mini
OpenAI o4-mini combines multi-modal inputs, chain-of-thought reasoning, and advanced natural language generation to tackle everything from compliance audits to creative brainstorming. Follow these tips and parameter recommendations to get the most out of your prompts.
1. Crafting Your Prompt
- •Be Descriptive for Depth
Provide context, objectives, and constraints in 2 to 4 sentences.
Example: “Analyze this patent diagram for potential infringement risks and explain step-by-step how you reached your conclusions.” - •Keep It Concise for Quick Answers
When you need short responses (definitions, status checks), limit to 1 sentence and add “Briefly” or “In one sentence.”
2. Trigger Chain-of-Thought
- •Add phrases like “Explain your reasoning” or “Show your step-by-step analysis.”
- •Use for high-stakes tasks (legal, healthcare, risk assessments) to get transparent logic.
3. Leveraging Image Inputs
- •Upload diagrams, whiteboard photos, or product shots via the
image
field. - •Ask o4-mini to “Annotate the key components” or “Identify compliance issues in this chart.”
4. Parameter Recommendations
Use Case | Temperature | Max Tokens | Top_P | Frequency Penalty | Notes |
---|---|---|---|---|---|
Demand Forecasting | 0.2 | 400 | 0.9 | 0.0 | Low randomness for precise numerical predictions. |
Compliance & Audits | 0.1 | 500 | 0.8 | 0.5 | Encourage concise, non-repetitive compliance flags. |
Creative brainstorming | 0.8 | 350 | 1.0 | 0.2 | Higher randomness to spark novel ideas. |
Executive Summaries | 0.3 | 250 | 0.7 | 0.0 | Balanced tone for clear, executive-style summaries. |
Infrastructure Analysis | 0.2 | 600 | 0.85 | 0.3 | Captures detailed, step-by-step schematic insights. |
> Tip: If you need even faster, more accurate outputs under tight SLAs, switch to the o4-mini-high
variant.
5. Iteration & Refinement
- •Review the first draft for tone, depth, and accuracy.
- •Refine your prompt: adjust specificity, add examples, or tweak parameters.
- •Repeat until output aligns with your objectives.
6. Best Practices
- •Set a Clear Objective
“Summarize patient MRI findings with focus on anomalies.” - •Define Output Format
“Provide bullet-point takeaways” or “Return JSON: {finding, confidence}.” - •Use System Messages
Frame the role: “You are a compliance auditor: it’s Q4 closeout.”
By combining clear prompts, thoughtful parameters, and iterative refinement, o4-mini becomes a versatile partner in decision-making, creative ideation, and rigorous analysis. Happy prompting!
Other Popular Models
Discover other models you might be interested in.
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

storydiffusion
Story Diffusion turns your written narratives into stunning image sequences.

insta-depth
InstantID aims to generate customized images with various poses or styles from only a single reference ID image while ensuring high fidelity

sdxl1.0-txt2img
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software
