Microsoft

Phi 4

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

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

$0.07
input / 1M tokens
$0.14
output / 1M tokens
16K
context window
15K
max output
5.9
Artificial Analysis intelligence index

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

We started tracking Phi 4 on Oct 21, 2026; the chart appears as soon as there is a second data point. 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
GLM 5.3 Flash
Z.ai
$0.041 $0.12 1.05M visiontoolsreasoningJSONopen weights
Ling 3.0 Flash
inclusionAI
$0.021 $0.063 262K toolsreasoningJSONopen weights
Mercury 2.5
Inception
$0.04 $0.15 260K toolsreasoningJSON
gpt-oss-20b
OpenAI
$0.018 $0.09 131K toolsreasoningJSONopen weights
Llama 3.1 8B Instruct
Meta Llama
$0.05 $0.08 131K toolsJSONopen weights

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 GLM 5.3 Flash (similar capabilities)$16.82$20.14 (54%)
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 Oct 21, 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 GLM 5.3 Flash ($0.041 / $0.12), Ling 3.0 Flash ($0.021 / $0.063), Mercury 2.5 ($0.04 / $0.15).

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