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.

POST
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); } })();
RESPONSE
application/json
HTTP Response Codes
200 - OKResponse Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


messagesArray

An array of objects containing the role and content


rolestr

Could be "user", "assistant" or "system".


contentstr

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 CaseTemperatureMax TokensTop_PFrequency PenaltyNotes
Demand Forecasting0.24000.90.0Low randomness for precise numerical predictions.
Compliance & Audits0.15000.80.5Encourage concise, non-repetitive compliance flags.
Creative brainstorming0.83501.00.2Higher randomness to spark novel ideas.
Executive Summaries0.32500.70.0Balanced tone for clear, executive-style summaries.
Infrastructure Analysis0.26000.850.3Captures 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

  1. •Review the first draft for tone, depth, and accuracy.
  2. •Refine your prompt: adjust specificity, add examples, or tweak parameters.
  3. •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.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.