# Microsoft: Phi 4 Mini Instruct

Phi 4 Mini Instruct is Microsoft's 3.8B-parameter open model from the Phi-4 family, built on synthetic and filtered web data with a focus on reasoning. It is aimed at memory- and compute-constrained settings and is strong at math and logic.

- **Model id:** `opencheap/phi-4-mini`
- **Price per 1M tokens:** $0.12 input / $0.48 output
- **Context:** 128K tokens, 4K max output

## Providers

2 providers. Prices are per 1M tokens. As of 2026-12-04 12:05 UTC.

| Provider | Input price | Cache price | Output price | Context | Max output |
| --- | --- | --- | --- | --- | --- |
| AiHubMix · quantization unknown | $0.12 | $0.12* | $0.48 | 128K | 4K |
| NanoGPT · quantization unknown | $0.17 | $0.085 | $0.68 | 8.1K | 4K |

\* No cache discount from this provider: cached tokens cost the input price.

A request picks by price (`:floor`) or by speed (`provider.sort`, `:nitro`), or sets a floor on tokens per second. [How routing works](https://docs.opencheap.si/speed)

### Supported parameters

The parameters each provider supports on this model, from its published list and our own tests of whether answers show the parameter taking effect. A test is a snapshot, not a guarantee; `provider.require_parameters` sends a request only to providers that support every parameter it sets. [Required parameters](https://docs.opencheap.si/speed#require-parameters)

- **AiHubMix:** `temperature`, `top_p`, `top_k`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format`, `structured_outputs`, `tools`, `tool_choice`
- **NanoGPT:** `temperature`, `top_p`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format` (tools not confirmed)

## Price history

Each provider's price over the last 24 hours, 7 days and 30 days is charted on [the page](https://opencheap.si/models/phi-4-mini#price-history).

## API

Point the OpenAI SDK at OpenCheap and pass the model id `opencheap/phi-4-mini`; the rest of your code stays the same.

```bash
curl https://api.opencheap.si/v1/chat/completions \
  -H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "opencheap/phi-4-mini", "messages": [{ "role": "user", "content": "Hi" }] }'
```

```python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.chat.completions.create(model="opencheap/phi-4-mini",
    messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)
```

```javascript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });
const r = await client.chat.completions.create({ model: "opencheap/phi-4-mini",
  messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);
```

## About Phi 4 Mini Instruct

Phi 4 Mini Instruct costs from $0.12 per 1M input tokens and $0.48 per 1M output tokens on OpenCheap. It has no public list price to compare with. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.0017, and 1,000 such requests about $1.68. Prices as of 2026-12-04 12:01 UTC.

2 providers serve Phi 4 Mini Instruct on OpenCheap. Each request goes to the cheapest healthy provider of the model, and every answer reports what it cost in `usage.cost`. Its context window is 128K tokens (128,000), room for roughly 96,000 words of English in one request.

Phi 4 Mini Instruct is one of [9 Microsoft models](https://opencheap.si/models/lab/microsoft) on OpenCheap. Every model on OpenCheap is called with one key at the same OpenAI-compatible endpoint, `https://api.opencheap.si/v1`.

## Pricing questions

### How much does the Phi 4 Mini Instruct API cost per 1M tokens?

Phi 4 Mini Instruct costs from $0.12 per 1M input tokens and $0.48 per 1M output tokens on OpenCheap. Prices as of 2026-12-04 12:01 UTC.

### What does one Phi 4 Mini Instruct request cost?

A request with 10,000 input tokens and 1,000 output tokens costs about $0.0017, and 1,000 such requests about $1.68. Every answer reports its own cost in usage.cost.

### Which providers serve Phi 4 Mini Instruct?

2 providers serve Phi 4 Mini Instruct on OpenCheap. Each request goes to the cheapest healthy provider of the model; the table on this page lists every provider with its price, speed and uptime.

### What is the context window of Phi 4 Mini Instruct?

Its context window is 128K tokens (128,000), room for roughly 96,000 words of English in one request.

### How do I call the Phi 4 Mini Instruct API?

Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/phi-4-mini. One OpenCheap key works for every model; the rest of your code stays the same.

## More from Microsoft

- [Mai Thinking 1](https://opencheap.si/models/mai-thinking-1) (`mai-thinking-1`): $2.00 / $8.00 per 1M · 256K context
- [Phi 3.5 Vision Instruct](https://opencheap.si/models/phi-3.5-vision) (`phi-3.5-vision`): $0.40 / $1.60 per 1M
- [Phi 4](https://opencheap.si/models/phi-4) (`phi-4`): $0.07 / $0.14 per 1M · 16K context
- [Phi 4 Mini (reasoning)](https://opencheap.si/models/phi-4-mini-reasoning) (`phi-4-mini-reasoning`): $0.12 / $0.12 per 1M · 128K context
- [Phi 4 Multimodal Instruct](https://opencheap.si/models/phi-4-multimodal) (`phi-4-multimodal`): $0.07 / $0.11 per 1M · 128K context
- [WizardLM-2 8x22B](https://opencheap.si/models/wizardlm-2-8x22b) (`wizardlm-2-8x22b`): $0.49 / $0.49 per 1M · 65K context
- [Microsoft-Decision-1](https://opencheap.si/models/microsoft-decision-1) (`microsoft-decision-1`): $0.048 per 1M input · 32K context
- [Microsoft-Decision-1.1](https://opencheap.si/models/microsoft-decision-1.1) (`microsoft-decision-1.1`): $0.048 per 1M input · 32K context

[All 9 Microsoft models](https://opencheap.si/models/lab/microsoft)

## Similar models

- [Qwen/Qwen2.5-72B-Instruct](https://opencheap.si/models/qwen2.5-72b): Qwen · 131K context · $0.36 / $0.40 per 1M · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-qwen2.5-72b)
- [meta-llama/Llama-3.1-70B-Instruct](https://opencheap.si/models/llama-3.1-70b): Meta · 131K context · $0.42 / $0.42 per 1M · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-llama-3.1-70b)
- [Qwen3.8 Flash](https://opencheap.si/models/qwen3.8-flash): Qwen · 1M context · $0.14 / $0.44 per 1M, 6 % cheaper · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-qwen3.8-flash)
- [LFM2.5 24B A2B](https://opencheap.si/models/lfm-2.5-24b-a2b): Liquid AI · 128K context · $0.047 / $0.66 per 1M · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-lfm-2.5-24b-a2b)
- [Cydonia 24B V4.1](https://opencheap.si/models/cydonia-24b-v4.1): TheDrummer · 131K context · $0.32 / $0.53 per 1M · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-cydonia-24b-v4.1)
- [Doubao Seed 2.0 Mini](https://opencheap.si/models/doubao-seed-2.0-mini-260215): ByteDance · 256K context · $0.10 / $0.48 per 1M · [Compare with Phi 4 Mini Instruct](https://opencheap.si/compare/phi-4-mini-vs-doubao-seed-2.0-mini-260215)

[Compare Phi 4 Mini Instruct with any model](https://opencheap.si/compare)

---

Source: https://opencheap.si/models/phi-4-mini · All models: https://opencheap.si/models · Prices as JSON: https://api.opencheap.si/v1/prices · Index for agents: https://opencheap.si/llms.txt
