Microsoft

Phi 4 API Pricing 2026

Compare pricing, benchmarks, and providers for Phi 4. Find the best value for your use case.

8 Ways to Use Fewer Tokens
Last updated: November 21, 2026 at 08:43 AM

Overview

Phi 4 was released on January 10, 2025. Pricing starts at $0.070 per million input tokens and $0.140 per million output tokens. The model supports a context window of up to 16K tokens. API access is available through Microsoft.

Context Window
16K
tokens
Pricing
Input$0.070
Output$0.140
per 1M tokens
Speed
Output-
TTFT-
median latency
Capabilities
Tools

Phi 4 is priced at $0.070 per million input tokens and $0.140 per million output tokens. It has a context window of 16,384 tokens. It is available from 2 providers, with DeepInfra the cheapest at $0.070 per million input tokens. On benchmarks, Phi 4 scores Intelligence 30.4 (56th percentile), MMLU Pro 47.6 (90th percentile), GPQA 20.8 (55th percentile).

Pricing Comparison

Compare Phi 4 with 10 similar models by price.

Current Pricing (per 1M tokens)

11 models

Sponsored The Grid | Spot Priced LLM API
The Grid | Spot Priced LLM API — Why pay list price when providers will bid for your API usage? Up to 80% off.
View spot prices
Provider
Model
Input $/M
Output $/M
Coding
MMLU
GPQA
Context
Actions
$0.070
$0.140
—
47.6
20.8
16,384
Try
$0.060
$0.180
—
—
—
-
Try
$0.060
$0.400
—
—
—
202,752
Try
$0.064
$0.224
—
—
—
40,960
Try
$0.065
$0.750
—
—
—
262,144
Try
$0.065
$0.260
—
—
—
1,000,000
Try
$0.070
$1.400
—
—
91.7
1,048,576
Try
$0.070
$0.280
—
—
—
160,000
Try
$0.070
$0.280
—
—
—
131,072
Try
$0.070
$0.070
—
—
—
8,192
Try
$0.070
$0.350
—
—
—
32,000
Try

* Some models use tiered pricing based on prompt length. Displayed prices are for prompts ≤ 200k tokens.

Compare Providers

Phi 4 is available from multiple providers with different pricing and availability.

2
Providers
$0.070
Cheapest Input/M
$0.140
Cheapest Output/M
DeepInfra
Best Price

Provider Pricing

2 models

Sponsored The Grid | Spot Priced LLM API
The Grid | Spot Priced LLM API — Why pay list price when providers will bid for your API usage? Up to 80% off.
View spot prices
Provider
Input $/M
Output $/M
Cache Read $/M
Cache Write $/M
Uptime
DeepInfra
DeepInfra
Best Price
$0.070
$0.140
-
-
100.0%
OpenRouter
OpenRouter
Best Price
$0.070
$0.140
-
-
-
Provider pricing data sourced from OpenRouter and Helicone

Community Rankings

How does Phi 4 perform? Vote based on your experience.

Cost vs. Quality

Compare Phi 4's benchmark performance against all models.

X-axis:
Y-axis:
Loading chart...
Phi 4
Other models

Detailed Benchmark Scores

Intelligence
30.4 (56th pct)
Coding
-
Math
-
MMLU Pro
47.6 (90th pct)
GPQA
20.8 (55th pct)
LiveCodeBench
-
AIME
-
Aider
-
Benchmark data from Artificial Analysis and HuggingFace Open LLM Leaderboard

Try Phi 4

Use our Calculator

Estimate your costs based on expected token usage.

Open Cost Calculator

Try in Playground

Test Phi 4 directly in your browser.

Open Playground

Frequently Asked Questions

Phi 4 costs $0.000070 per 1,000 input tokens and $0.000140 per 1,000 output tokens.
Phi 4 is available from 2 providers. DeepInfra offers the best price.
DeepInfra offers Phi 4 at $0.070 per million input tokens.
Phi 4 scores Intelligence 30.4 (56th percentile), MMLU Pro 47.6 (90th percentile), GPQA 20.8 (55th percentile). Only benchmarks with published data for this model are shown.
We compare Phi 4 with 10 similarly-priced models. See the benchmark scatter plot above to compare quality vs cost.

All Microsoft Models

See pricing for all Microsoft models.

View all Microsoft models →