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
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/o3-mini";
const data = {
"messages": [
{
"role": "user",
"content" : "tell me a joke on cats"
},
{
"role": "assistant",
"content" : "here is a joke about cats..."
},
{
"role": "user",
"content" : "now a joke on dogs"
},
]
};
(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);
}
})();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.
OpenAI o3-mini is a small, cost-efficient reasoning model built for developers and organizations that need strong analytical performance without the overhead of larger models. Part of OpenAI's o-series reasoning family, o3-mini uses extended chain-of-thought reasoning — thinking through problems step-by-step before responding — making it substantially smarter than a standard chat model for logic-intensive tasks. It matches or exceeds o1 performance in math, coding, and science while delivering faster response times at lower cost. Through Segmind's serverless API, you can access o3-mini instantly without managing infrastructure, authentication complexity, or rate limit queues.
o3-mini is the right tool when your task requires genuine reasoning rather than pattern-matched retrieval.
Software engineering: Debugging complex code, reviewing pull requests, explaining algorithmic tradeoffs, generating test cases, and refactoring legacy code benefit from o3-mini's high SWEbench ranking.
Mathematics and science: Solving multi-step math problems, deriving formulas, interpreting scientific datasets, and validating numerical outputs are areas where o3-mini consistently outperforms general-purpose models.
Data validation and policy decisions: Feed structured data into o3-mini to evaluate whether records conform to business rules, flag anomalies, or make policy-driven routing decisions in automation pipelines.
Research and literature synthesis: Summarizing scientific papers, comparing methodologies, and extracting key findings from dense academic text are well-suited for the model's reasoning depth.
o3-mini responds well to clearly structured prompts. Use delimiters — XML tags, triple quotes, or section headers — to separate different parts of your input. For coding tasks, include language, constraints, and expected behavior explicitly. Avoid asking the model to reason more extensively within the prompt itself; the reasoning effort parameter handles this. Role prompting helps set tone: starting with something like You are a senior software engineer reviewing code for security vulnerabilities produces more focused, expert-level output. For multi-step problems, break the task into numbered sub-questions rather than asking everything at once.
Does o3-mini support image or file inputs? No — o3-mini is a text-only model. It accepts text prompts and returns text responses. For multimodal tasks, consider o4-mini or GPT-4o.
How does reasoning effort affect my usage? Higher reasoning effort means the model spends more internal computation before answering, which improves accuracy on hard problems but increases token usage and response time. For straightforward queries, low or medium effort is sufficient.
When should I use o3-mini instead of o3? Choose o3-mini when cost and latency are a priority and the task is primarily STEM-oriented. Use o3 when you need maximum reasoning capability on the hardest problems regardless of cost.
Is o3-mini suitable for conversational chat? Technically yes, but it is overkill for casual conversation. It is optimized for technical reasoning, so general chat models like GPT-4o mini are more cost-effective for simple Q&A.
Can I use o3-mini in automated batch pipelines? Yes — o3-mini supports the Batch API, making it well-suited for processing large volumes of reasoning tasks asynchronously at reduced cost.
What is the context window? o3-mini supports a large context window suitable for feeding in long code files, scientific papers, or detailed instruction sets. Check Segmind's API docs for current limits.