Phi-4
Phi-4 is Microsoft's model at $0.07 input and $0.14 output per million tokens, with a 16K context window. On a typical 3:1 input-to-output mix that blends to roughly $0.088 per million tokens, placing it in the budget band of the 68 models tracked here — cheaper than 96% of them.
By price, Phi-4 ranks 5th cheapest of 68 on input and 4th on output. Its quality score of 76 ranks 60th of 68, and on value (quality score ÷ output price) it ranks 5th of 68. Its blended rate sits 97% below the catalog average.
In real billing terms: a support chatbot handling 50,000 turns a month (2,000 input / 500 output tokens each) costs about $11 per month on Phi-4, while a RAG workload of 20,000 queries (8,000 input / 800 output tokens each) runs about $13. Because output is priced 2.0× input here, long-generation tasks scale cost fastest — cap output length before you optimise anything else.
A 16K context window holds roughly 21 pages of A4 text (at ~750 tokens per page), ranking 67th of 68 here. That is on the smaller side, so long documents need retrieval and chunking rather than raw stuffing. Output runs at about 180 tok/s (11th fastest of 68), fast enough for real-time interaction and high-throughput batches.
We track 4 Microsoft models, and Phi-4's blended rate sits 21% below that provider's average. If your task tolerates a little less headroom, qwen3.5-flash (Alibaba) blends about 37% cheaper at a quality score of 82, and is worth benchmarking first. Going the other way, Hunyuan HY3 scores 87 on quality for about 14% more.
The closest model in Microsoft's line-up is Phi-4-mini ($0.02 input / $0.04 output, quality 68). Against it, Phi-4 scores 8 points higher on quality, runs 70 tok/s slower (about 28%), has a 112K smaller context window, costs 71% more blended. When two models sit this close on price, the deciding factor is usually the quality ceiling — run both against your real prompts before picking.
Estimated monthly cost
Monthly API spend across four common workloads, next to the cheapest model we track.
| Workload | Usage assumption | This model | Cheapest model |
|---|---|---|---|
| Support chatbot | 2,000 input / 500 output tokens per turn, 50,000 turns per month | $11 | $3.00 |
| RAG document Q&A | 8,000 input / 800 output tokens per query, 20,000 queries per month | $13 | $3.84 |
| Coding assistant | 12,000 input / 2,000 output tokens per request, 10,000 requests per month | $11 | $3.20 |
| Batch summarization | 4,000 input / 400 output tokens per item, 200,000 items per month | $67 | $19 |
Derived directly from the rates on this page. Excludes prompt caching, batch discounts and free tiers.
How it compares
The alternatives worth benchmarking alongside it, from the same dataset.
| Model | Provider | Blended /1M | Quality | Price delta |
|---|---|---|---|---|
| Phi-4 | Microsoft | $0.088 | 76 | — |
| qwen3.5-flashCheaper option | Alibaba | $0.055 | 82 | -37% |
| Hunyuan HY3Higher quality | Tencent | $0.10 | 87 | +14% |
| Phi-4-miniSame provider | Microsoft | $0.025 | 68 | -71% |
Best for
Modalities
Where it fits — and where it doesn't
Good fit
- Coding: writing, refactoring and debugging across multi-file project context.
- Chat and support: natural multi-turn conversation for user-facing products.
- High throughput and real-time UX: 180 tok/s keeps streamed responses feeling instant.
- High-volume, cost-sensitive batch work: low rates suit classification, tagging and summarization at scale.
Poor fit
- Whole-document ingestion: a 16K window needs RAG chunking for large files.
- Hard reasoning: a quality score of 76 is on the low side here; pick a stronger model for complex planning or maths.
- Image understanding: this model is text-only, so vision tasks need a multimodal alternative.
Frequently asked questions
How much does the Phi-4 API cost?
Phi-4 costs $0.07 per million input tokens and $0.14 per million output tokens. On a 3:1 input-to-output mix that blends to about $0.088 per million tokens.
What does Phi-4 cost per month?
It depends on volume. Using the four worked scenarios on this page: a support chatbot runs about $11/month, RAG document Q&A about $13/month, a coding assistant about $11/month, and batch summarization about $67/month. Plug your own token counts into the cost calculator for a tailored figure.
How large is the Phi-4 context window?
16K tokens — roughly 21 pages of A4 text at ~750 tokens per page, ranking 67th of the 68 models tracked here.
Phi-4 or qwen3.5-flash — which is better value?
qwen3.5-flash blends to about $0.055 per million tokens versus $0.088 for Phi-4 — roughly 37% cheaper — at a quality score of 82 against 76. If that quality gap does not show up on your task, take the cheaper one; if it does, stay with Phi-4. Benchmark both on your own data before deciding.
What is Phi-4 best suited for?
Tagged use cases: coding, chatbot, cheap, fast. Coding: writing, refactoring and debugging across multi-file project context. Less suitable: Whole-document ingestion: a 16K window needs RAG chunking for large files.
How current is this Phi-4 pricing?
Pricing here was last verified on 2026-07-10 against OpenRouter. llmprice.app runs a daily collection job, but providers can change rates between runs — confirm against Microsoft's official pricing page before you commit.
Estimate the real cost of this model
Bring tokens per request and monthly volume into the calculator to compare total model costs.
Related models
Continue by provider and use case.
Llama-3.3-70B-Instruct
MAI-DS-R1
Pricing, speed and quality scores change over time. Confirm official documentation before production use.