Eliminating the 4 Hidden Taxes: AI Tokens, Manual Work, SaaS Cliffs & AI Scrapers Sponsor this header →

Microsoft: Phi 4 API Pricing & Cost Breakdown

[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion...

microsoft/phi-4
Open Weight
Last checked: Nov 21, 2026
Input / 1M Tokens
$0.07
Prompt & context tokens
Output / 1M Tokens
$0.14
Generated completion tokens
Blended (3:1) / 1M
$0.087
Tier: ultra-budget
Context Window
16K
Max output: 15K

Technical Specifications

Canonical IDmicrosoft/phi-4
ProviderMicrosoft
Input Modalitiestext
Output Modalitiestext
Open-WeightYes
Reasoning OptimizedStandard
Vision SupportText-only

Estimated Monthly API Spend

StageMonthly TokensEst. Cost
Prototype / MVP
500 req/day
22.5M in / 6.0M out $2.42/mo
Growing SaaS
10,000 req/day
600.0M in / 150.0M out $63.00/mo
Scale Production
100,000 req/day
7500.0M in / 1800.0M out $777.00/mo
Simulate Custom Volume → Cut Cost via 3-Tier Cascade →

Deploy or Route Microsoft: Phi 4

Multi-Provider Gateway

OpenRouter

Unified API gateway for 300+ LLMs with automatic fallbacks and unified billing.

Call via OpenRouter →
Open-Weight Inference

Together AI

High-throughput serverless inference & fine-tuning for Llama, DeepSeek, and Qwen.

Run on Together AI →
Fastest Tokens/Sec

GroqCloud

LPU-accelerated inference delivering hundreds of tokens per second for real-time voice & agents.

Test on Groq →

Some outbound infrastructure and API gateway links on KostoZero are partner referrals that help keep this observatory free and independent at no extra cost to you.

Cheaper Alternatives to Microsoft: Phi 4

ModelProviderInput / 1MOutput / 1MBlendedContext
Tencent: Hy-MT2-1.8B Tencent $0.044 $0.177 $0.077 8K
DeepSeek: DeepSeek V4 Flash Latest DeepSeek $0.044 $0.132 $0.066 1.05M
Cohere: Command R7B (12-2024) Cohere $0.037 $0.15 $0.066 128K
Amazon: Nova Micro 1.0 Amazon $0.035 $0.14 $0.061 128K
Inference.net: Schematron V2 Turbo Inference Net $0.03 $0.15 $0.06 128K
Mistral: Mistral Small 3 Mistral AI $0.05 $0.08 $0.058 33K

Frequently Asked Questions

How much does Microsoft: Phi 4 API cost per 1M tokens?

Microsoft: Phi 4 costs $0.07 per 1M input tokens and $0.14 per 1M output tokens ($0.087 blended at a 3:1 ratio).

What is the maximum context window of Microsoft: Phi 4?

Microsoft: Phi 4 supports up to 16,384 tokens (16K) of input context and up to 14,745 output completion tokens.

What are cheaper alternatives to Microsoft: Phi 4?

Lower-cost options tracked right now include Tencent: Hy-MT2-1.8B ($0.077/1M), DeepSeek: DeepSeek V4 Flash Latest ($0.066/1M), Cohere: Command R7B (12-2024) ($0.066/1M).

Get Instant Price-Drop (>10%), New AI Bot & SaaS Cliff Alerts

Every 6 hours our autonomous sync checks 40+ LLMs, AI crawlers, and SaaS pricing cliffs—alerting you when prices drop >10% or new scrapers appear.