← Blog

o3 and o4-mini API — OpenAI reasoning models via one key

How to call OpenAI's o3 and o4-mini reasoning models through InferAll's OpenAI-compatible endpoint. Same SDK, same key — no separate API access needed.

InferAll Team

3 min read
OpenAIo3o4-minireasoning modelsLLM APIAI gatewaydeveloper tools

Retired, 2026-11-05. OpenAI retired o4-mini, o3-mini and o1; a call to any of them now fails, and InferAll answers with a "retired by its provider" error. o3 is still served, and the samples below use it.

Correction, 2026-09-02: pricing. An earlier version of this post said premium provider tokens are billed at the provider's rate with zero markup. That was not accurate: InferAll bills premium tokens at its own published per-token rates, which sit above the underlying provider cost. Current rates are on /pricing. The post has been corrected; nothing else about the models or the setup has changed.

OpenAI's reasoning model family — o1, o3, o3-mini, o4-mini — is now available through InferAll's OpenAI-compatible endpoint. Same SDK you already use, same ifu_... key.

Model Input Output Best for
o3 $10.00/M $40.00/M Hardest reasoning, math proofs, complex code
o4-mini Retired by OpenAI, 2026-11-05
o3-mini Retired by OpenAI, 2026-11-05
o1 Retired by OpenAI, 2026-11-05

All at OpenAI's published list rates.


Quick start

Using a new key? A no-card trial key routes to the free NIM models only, so the paid model in these snippets returns a 402 until you add a card. To get a working first call right now, keep everything below and swap the model to nvidia/nemotron-3-ultra-550b-a55b.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.inferall.ai/v1",
    api_key="ifu_your_key_here",  # get one at inferall.ai/keys
)

# o3 — for hard problems
response = client.chat.completions.create(
    model="openai/o3",
    messages=[
        {"role": "user", "content": "Prove that there are infinitely many prime numbers."}
    ],
)

print(response.choices[0].message.content)

The only difference from calling OpenAI directly: base_url="https://api.inferall.ai/v1". Your existing code, streaming, and tool use all work unchanged.


TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.inferall.ai/v1",
  apiKey: process.env.INFERALL_API_KEY,
});

const response = await client.chat.completions.create({
  model: "openai/o3",
  messages: [
    { role: "user", content: "Write a SQL query to find the top 10 customers by revenue in the last 90 days." }
  ],
});

console.log(response.choices[0].message.content);

When to use each model

o4-mini was the lower-cost choice until OpenAI retired it on 2026-11-05. o3 is the reasoning model InferAll serves today.

o3 handles multi-step deduction, long-horizon planning and formal proofs. For cheaper follow-up calls, use GPT-4.1-mini.

o1 is the previous generation of deliberate reasoner. o3 is significantly more capable at similar or lower cost — there's no strong reason to use o1 in new projects.


Same key for everything else

The same ifu_... key that calls o3 also routes to:

  • GPT-4.1 / GPT-4.1-mini / GPT-4.1-nano
  • Claude Opus 4 / Sonnet 4
  • Gemini 2.5 Flash / Pro
  • 10+ NVIDIA NIM open models at our open-model rate

Switch between providers by changing one string. Useful when you want to compare o3 vs Claude Opus 4 on a hard task, or fall back to GPT-4.1-mini for cheaper follow-up calls after o3 generates the plan.


Note on reasoning token behavior

OpenAI's o-series models think before they respond. They generate internal reasoning tokens that count toward your usage but aren't returned in the output. InferAll passes the full response through unchanged, so usage.completion_tokens includes both reasoning and output tokens as reported by OpenAI.


Sign up at inferall.ai/keys and fund a key with the $5 starter pack — usage credit you can spend on o3 or any other model at our published per-token rates (inferall.ai/models).

Try it with one key: create a free account and your first 25 calls on open models are free, no card needed.

Start building free