Microsoft

Phi 4

$0.07 per 1M input tokens and $0.14 per 1M output tokens · 16K context · JSON, open weights.

Prices checked Dec 6, 2026 · tracked by LLM Cost Index since Oct 21, 2026

Scheduled for retirement on 2026-12-31. Plan a replacement — for example DeepSeek V4.1 Flash 1017, or see the cheaper alternatives below.
$0.07
input / 1M tokens
$0.14
output / 1M tokens
16K
context window
15K
max output

What Phi 4 costs per month

Estimated monthly bill for typical workloads. Try your own numbers in the cost calculator.

WorkloadPer month
Customer chatbot
1,000 conversations a day, 8 turns each
$36.96
Document Q&A (RAG)
500 questions a day over retrieved documents
$7.35
Coding / tool-using agent
200 tasks a day, long tool-heavy contexts
$28.56
Content generation
30 long articles a day
$0.504
Classification / extraction
100,000 short items a day
$69.30

Price history

No input price change since Oct 21, 2026. See all recent price changes.

Where to run Phi 4: 2 providers

DeepInfra is the cheapest at $0.056 input / $0.112 output per 1M tokens. Uptime is the average over the last 30 days as reported by OpenRouter; see provider reliability.

ProviderInput / 1MOutput / 1MContextUptimeNotes
DeepInfra$0.056$0.11216K100% flex tier, bf16
DeepInfra$0.07$0.1416K100% bf16

Cheaper alternatives to Phi 4

Models with the same structured output for at least 20% less (3:1 input/output mix), most capable first.

Cheaper alternatives to Phi 4
Model Input / 1M Output / 1M Context Capabilities
$0.02 $0.20 1.05M visiontoolsreasoningJSONopen weights
$0 $0 1.05M visionJSON
$0 $0 1.05M visionJSON
Tinsel Alpha
Stealth
$0 $0 1.05M visionaudiotoolsreasoningJSON
Solar Mini 4.5
Upstage
$0.01 $0.04 524K toolsreasoningJSON

What to switch to before Phi 4 is retired

Replacements with the same must-have capabilities (text) and enough context, most capable first. See all models being retired.

ReplacementInput / 1MOutput / 1MPrice vs today
Claude Fable 5.2$8.00$40.00 18186% more
Gemini 4 Neon$3.00$15.00 6757% more
GPT-6.2 Astra$8.00$40.00 18186% more
Gemini 4 Carbon$4.00$20.00 9043% more

How to pay less for Phi 4

For a customer chatbot (1,000 conversations a day, 8 turns each) that costs $36.96 a month at list price without caching:

OptionPer monthYou save
Move to DeepSeek V4.1 Flash 1017 (similar capabilities)$19.90$17.06 (46%)
Route to DeepInfra (flex tier)$29.57$7.39 (20%)

Other workloads: cut-your-bill tool for Phi 4.

Specifications

Model IDmicrosoft/phi-4
Inputtext
Outputtext
Tool callingNo
Structured outputYes
Reasoning modeNo
Open weightsYes — microsoft/phi-4
Knowledge cutoff2024-06-30
ReleasedJan 10, 2025

FAQ

How much does Phi 4 cost?
$0.07 per million input tokens and $0.14 per million output tokens. Prices as of Dec 6, 2026.
What is the context window of Phi 4?
16K tokens, with up to 15K output tokens per response.
Does Phi 4 support images, tools and structured output?
Images as input: no. Tool calling: no. Structured (JSON) output: yes. Reasoning mode: no.
What are cheaper alternatives to Phi 4?
Models with the same key capabilities for at least 20% less include DeepSeek V4.1 Flash 1017 ($0.02 / $0.20), Lyria 3 Clip Preview ($0 / $0), Lyria 3 Pro Preview ($0 / $0).

More from Microsoft: all Microsoft models · how we collect prices