impulse

Phi 4

Open weightsRetiring 17 Jan 2027

[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.

API id Phi-4Released 10 Jan 2025 (Jan 2025)
Azure AI Foundry retires it on 17 Jan 2027 (in 59 days). 1 host keeps serving it.
Input / 1M
$0.125
at Azure AI Foundry
Output / 1M
$0.50
at Azure AI Foundry
Context window
16K
tokens
Max output
16K
tokens per reply
Hosts
2
2 listings
Released
Jan 2025
10 Jan 2025

Pricing

List prices at Azure AI Foundry, in US dollars per million tokens.

TierInput / 1MOutput / 1M
Standard$0.125$0.50

What it costs a month

At Azure AI Foundry list prices, 30 days.

  • Chat assistant5,000 requests a day, 2K in / 0.5K out$75.00
  • RAG over documents2,000 requests a day, 8K in / 0.6K out$78.00
  • Coding agent1,000 requests a day, 40K in / 2K out$180
  • Overnight batch20,000 requests a day, 4K in / 0.4K out$420
Use your own numbers

Where to run it

2 hosts serve Phi 4. The comparison is on blended price, 3 parts input to 1 part output.

HostIn / out per 1M
$0.125 / $0.50
Retires 17 Jan 2027
DeepInfraInference
phi-4
$0.07 / $0.14
−60% vs headline

Capabilities

Core

  • Streaming
  • Function calling
  • JSON mode
  • Structured outputs

Multimodal

  • Vision
  • Image input
  • Audio
  • Image generation
  • Video

Advanced

  • Reasoning
  • Tool calling
  • MCP
  • Prompt caching
  • Batch API
  • Embeddings
Takes in
Text
Produces
Text
Open weights
License: MIT
Runs in about 35.2 GB of GPU memory
Runtimes: Ollama, llama.cpp, vLLM

Cheaper alternatives

Current models that cost less and keep most of what this one can do: tools, vision, reasoning, structured output, caching and enough context.

Same model, cheaper host

  • DeepInfra
    phi-4
    $0.07 / $0.14
    60% less

Smaller Microsoft models

No cheaper Microsoft model keeps its key capabilities.

Other frontier labs

  • Claude Haiku 5.5
    Anthropic · on Anthropic
    $0.10 / $0.50
    Has every key capability
    9% less
  • GPT-6 Luna
    OpenAI · on OpenAI
    $0.10 / $0.50
    Has every key capability
    9% less

Open-weight picks

  • Ministral 14B 2512
    Mistral AI · on Mistral AI
    $0.20 / $0.20
    Has every key capability
    9% less
  • Qwen3.8 Flash
    Alibaba Qwen · on AIHubMix
    $0.113 / $0.38
    Has every key capability
    18% less
  • Nemotron 3.5 Super VL
    NVIDIA · on Kyma API
    $0.081 / $0.472
    Has every key capability
    18% less
  • Gemma 4 31B IT
    Google · on W&B Inference
    $0.10 / $0.34
    Has every key capability
    27% less

Benchmarks

Scores published on the model card.

  • BBH52.4%
  • GPQA20.8%
  • IFEval5.9%
  • MATH Lvl 531.6%
  • MMLU-Pro47.6%
  • MUSR23.8%
  • Open LLM Average30.4%

Call it

Using Azure AI Foundry's API.

Python
from litellm import completion

response = completion(
    model="azure_ai/Phi-4",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Quick answers

How much does Phi 4 cost?

On Azure AI Foundry, Phi 4 costs $0.125 per million input tokens and $0.50 per million output tokens. The cheapest host is DeepInfra, at $0.07 per million input tokens and $0.14 per million output tokens.

Which APIs offer Phi 4?

Phi 4 runs on 2 APIs: Azure AI Foundry and DeepInfra.

What is Phi 4's context window?

16K tokens, with up to 16K tokens in one reply.

Is Phi 4 being retired?

Azure AI Foundry retires it on 17 Jan 2027. 1 host keeps serving it.

What are cheaper alternatives to Phi 4?

Models that cost less and keep most of what it can do: Claude Haiku 5.5 on Anthropic (9% less), GPT-6 Luna on OpenAI (9% less) and Ministral 14B 2512 on Mistral AI (9% less). Phi 4 itself costs 60% less on DeepInfra. Savings are on a mix of 3 input tokens to 1 output token.

When was Phi 4 released?

Microsoft released it on 10 Jan 2025.

What is Phi 4's API model id?

Use Phi-4 with Azure AI Foundry. Other hosts use their own ids: phi-4 on DeepInfra.

Sources

Raw catalog entry for Phi-4 on Azure AI Foundry
{
  "deprecation_date": "2027-01-17",
  "deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
  "successor_model": "microsoft--phi-4",
  "input_cost_per_token": 1.25e-7,
  "litellm_provider": "azure_ai",
  "max_input_tokens": 16384,
  "max_output_tokens": 16384,
  "mode": "chat",
  "output_cost_per_token": 5e-7,
  "source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'",
  "supports_function_calling": true,
  "supports_pdf_input": false,
  "supports_tool_choice": true,
  "supports_vision": false
}