Skip to content

Specs

Model IDmicrosoft/phi-4
Context window16K tokens
Max output15K tokens
Input price$0.07 / 1M tokens
Output price$0.14 / 1M tokens
Inputs → outputsText → Text
Open weightsYes

How to use Phi 4 in your app

The quickest way is through an API gateway such as OpenRouter, which uses the same format as the OpenAI API. Create a key, then send a request with the model ID microsoft/phi-4:

curl https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "microsoft/phi-4", "messages": [{"role": "user", "content": "Explain this in simple words..."}] }'

Prefer no code? Many tools in our AI tools directory run on models like this one.

More models from Microsoft

Phi-2Microsoft

A 2.7B model that matched models many times its size on reasoning tests.

Context 2K
Open weights
Phi-1Microsoft

A 1.3B coding model trained on "textbook-quality" data, showing small models can be strong with good data.

Context 2K
Open weights

Questions about Phi 4

What is Phi 4?

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

How big is the context window of Phi 4?

Phi 4 can read up to 16,384 tokens in one request, roughly 12,288 words.

How much does Phi 4 cost?

Through OpenRouter, Phi 4 costs about $0.07 / 1M tokens for input and $0.14 / 1M tokens for output. Prices change, so check before large jobs.

Is Phi 4 open source?

Phi 4 has open weights, so you can download and run it yourself, subject to its licence.

What can Phi 4 take as input?

Phi 4 accepts text and produces text.

Latest AI models

MiniMax: MiniMax M3.1 Flash (free)Minimax

MiniMax-M3.1-Flash is a multimodal model from MiniMax. Compared with M3, it delivers significant improvements across multiple benchmarks, particularly in complex agentic tasks, coding, and cybersecurity. It is built for complex,...

Context 1M
New
DeepSeek: DeepSeek V4.1 Flash 1017Deepseek

DeepSeek V4.1 Flash 1017 is the October 17, 2026 snapshot of DeepSeek V4.1 Flash, served by DeepSeek under the `deepseek-flash` API model name. V4.1 Flash is a sparse mixture-of-experts model...

Context 1MIn $0.15 · Out $0.60 /1M
NewOpen weights
Elorian: GlimpseElorian

Glimpse is a multimodal visual reasoning model from Elorian, built for visual understanding and complex visual reasoning in the physical world. It reasons directly over images and video rather than...

Context 262KIn $0.60 · Out $3.00 /1M
New
XingChen: Xing4.0 29B A4B (free)Xingchen Agi

Xing4.0-29B-A4B is an open-weight mixture-of-experts language model from China Telecom's AI team (TeleAI) and the successor to the TeleChat series. It has 29B total parameters with 4B active per token...

Context 262K
NewOpen weights
Reflection: Beam 1.0 501B A23BReflection

Beam 1.0 is Reflection's open-weight reasoning model for coding and long-horizon agentic workflows. It uses a sparse mixture-of-experts architecture with 501B total and 23B active parameters per token, and a...

Context 1MIn $0.30 · Out $1.00 /1M
NewOpen weights
Inception: Mercury 3Inception

Mercury 3 is a diffusion-based language model from Inception, and the lab's most capable model to date. It is suited for agentic workflows and real-time applications where latency compounds, such...

Context 1MIn $0.10 · Out $0.35 /1M
New

Specs and prices come from OpenRouter and the provider, and are refreshed daily. Last checked 10 Jan 2025.

Type what you want to do — e.g. “edit video”, “write emails”, “Claude”. Press Enter to see all results.

Suggest an AI

Paste a name and a website. The autopilot checks it isn't listed yet, scans it for safety, reads the site and sorts it into the right category.

Chat with us