# o4-mini

A cost-efficient reasoning model from OpenAI, delivering stronger chain-of-thought performance than o3-mini with native tool use and vision support.

- **Model ID:** `openai/o4-mini`
- **Type:** chat
- **Providers:** azure, openai
- **Context window:** 200,000
- **Maximum output tokens:** 100,000
- **Pricing:** $1.1/1M input tokens, $4.4/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/o4-mini

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'openai/o4-mini',
  prompt: 'Why is the sky blue?'
})
```

## About

o4-mini was released on April 16, 2025 alongside o3 as a cost-efficient reasoning model from OpenAI. It advances the compact reasoning model line (following o1-mini and o3-mini) with improvements across reasoning quality, efficiency, and multimodal capability.

A key advancement is native vision support: o4-mini can reason over images, diagrams, mathematical notation, and screenshots, combining visual understanding with chain-of-thought analysis. Earlier mini reasoning models were text-only. This opens up visual reasoning tasks at the affordable mini-tier pricing.

The model supports function calling and tool use, making it suitable as the reasoning layer in lightweight agent architectures. Combined with the `reasoning_effort` parameter, it lets you build cost-optimized pipelines that apply just enough reasoning to each request.

## What to consider

o4-mini incorporates advances beyond o3-mini, including native vision support. It's a strong option for projects that need affordable chain-of-thought reasoning.

Unlike earlier mini reasoning models, o4-mini natively supports vision input, enabling reasoning over images, diagrams, and documents.

## When to use

### Best For

- **Affordable chain-of-thought reasoning:** Per-request deliberation on technical tasks at scale
- **Visual reasoning:** Analyzing diagrams, charts, mathematical notation, and screenshots with step-by-step thinking
- **Tool-using agents:** Lightweight reasoning backbone for agents that call external tools and APIs
- **Math and code reasoning:** Competition-level problems and algorithmic analysis at accessible cost
- **Mixed-difficulty pipelines:** Using `reasoning_effort` to optimize cost across varied query complexity

### Consider Alternatives When

- **Maximum reasoning depth:** o3 or o3-pro for the hardest problems requiring exhaustive deliberation
- **General-purpose tasks:** GPT-5 mini for workloads that don't benefit from chain-of-thought
- **Coding agent workflows:** Codex models for autonomous software engineering
- **Non-reasoning speed:** GPT-5.1 instant for the fastest possible general-purpose responses

## Best for

- **Affordable chain-of-thought reasoning:** Per-request deliberation on technical tasks at scale
- **Visual reasoning:** Analyzing diagrams, charts, mathematical notation, and screenshots with step-by-step thinking
- **Tool-using agents:** Lightweight reasoning backbone for agents that call external tools and APIs
- **Math and code reasoning:** Competition-level problems and algorithmic analysis at accessible cost
- **Mixed-difficulty pipelines:** Using `reasoning_effort` to optimize cost across varied query complexity

## Consider alternatives

- **Maximum reasoning depth:** o3 or o3-pro for the hardest problems requiring exhaustive deliberation
- **General-purpose tasks:** GPT-5 mini for workloads that don't benefit from chain-of-thought
- **Coding agent workflows:** Codex models for autonomous software engineering
- **Non-reasoning speed:** GPT-5.1 instant for the fastest possible general-purpose responses

## Frequently asked questions

### How does o4-mini improve over o3-mini?

It delivers stronger reasoning performance with greater efficiency, adds native vision support, and includes improved tool use capabilities.

### Does o4-mini support image input?

Yes. Unlike earlier mini reasoning models, it natively processes images, diagrams, and visual content as part of its chain-of-thought reasoning.

### What is the `reasoning_effort` parameter?

It controls how deeply the model reasons per request. Low effort for simple queries saves cost; high effort for hard problems enables thorough deliberation.

### What context window does o4-mini support?

200K tokens, providing ample capacity for complex reasoning tasks.

### How does AI Gateway handle authentication for o4-mini?

AI Gateway accepts a single API key or OIDC token for all requests. You don't embed OpenAI credentials in your application; AI Gateway routes and authenticates on your behalf.

### When should I use o3 instead of o4-mini?

When the hardest problems require maximum reasoning depth and the quality gap between o4-mini and o3 is consequential for your application.

### What are typical latency characteristics?

This page shows live throughput and time-to-first-token metrics measured across real AI Gateway traffic.

## Links

- [Model page](https://vercel.com/ai-gateway/models/o4-mini)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://platform.openai.com/docs/models/o4-mini)
- [Provider pricing](https://platform.openai.com/docs/pricing)
