Phi 4

Chat model by Microsoft.

Phi-4 is Microsoft's 14-billion parameter language model engineered for complex reasoning, mathematical problem solving, and code generation, trained on synthetic reasoning datasets and curated web texts.

Models / Phi 4ID: azure_ai/Phi-4

Maker

Microsoft

Served On: Azure Foundry

Specifications

Context window, ranked against other chat models

Proportional scale: 0 to 1.05M tokens. Not ranked, no published context window: glm-5.3-prime, qwen3-235b-a22b-2507, qwen3.7-max-2026-05-17.

Context window

—

Max output

—

Modality

chat

Vision
Function calling
System prompt

Pricing

Rates are read live

Pricing for Phi-4 is fetched from the live catalogue on load, so it is never served from a cache that could outlive a repricing.

Availability

Not enough data yet

We have not collected enough health probes for this model to publish an uptime or latency figure. A percentage from a handful of samples is fabricated precision, so none is shown until the sample count supports one.

How Phi 4 is billed

Billed at the provider's list price, with no per-token markup.

Exact list price
Tokens settle at the published rate of the model that served your call.
Cache discounts passed through
Provider prompt-caching discounts reach your balance with no added fee.
Cost on every response
Each response carries the x-nr-request-cost header, so you can reconcile spend per request.

More from Microsoft

Start building with Phi-4

One API key, three steps. Choose your tool to begin.

  1. Set your API key

    export NROUTER_API_KEY="<YOUR_API_KEY>"
  2. Configure Claude Code

    Choose a tool, then copy its setup from the panel.

npm install -g @anthropic-ai/claude-code
Claude Code · azure_ai/Phi-4
# Point Claude Code to nRouter gateway
export ANTHROPIC_BASE_URL="https://api.nrouter.ai"
export ANTHROPIC_API_KEY="$NROUTER_API_KEY"

# Launch with azure_ai/Phi-4
claude --model azure_ai/Phi-4

Questions? Answers.

What is Phi 4?

Phi-4 is Microsoft's 14-billion parameter language model engineered for complex reasoning, mathematical problem solving, and code generation, trained on synthetic reasoning datasets and curated web texts.

How much does Phi 4 cost?

Phi 4 is billed at the provider's list price on nRouter with no per-token markup — tokens settle at the exact upstream rate. Input and output rates are read live, so see the pricing section above for the current figures.

Does Phi 4 support tool calling and structured outputs?

Yes. Phi 4 supports tool calling (function calling), so it can invoke external tools and APIs during a conversation.

What inputs and outputs does Phi 4 support?

Phi 4 takes text as input and returns text as output.

How do I use Phi 4 via nRouter?

Use any OpenAI-compatible client: point it at https://api.nrouter.ai/v1 with your nRouter API key and set the model to "azure_ai/Phi-4". The quick-start panel above has a copy-paste curl command for this model.

When was Phi 4 released?

Phi 4 was released on December 12, 2024.

Where is the Phi 4 documentation?

Start at nrouter.ai/docs. The quick-start guide (nrouter.ai/docs/getting-started/quick-start) covers API keys and your first request, and the API reference (nrouter.ai/docs/api-reference) lists every parameter.

What other text models does Microsoft have?

Other Microsoft text models on nRouter include Phi-4 Multimodal Instruct (nrouter.ai/models/phi-4-multimodal-instruct), Phi 4 Mini Instruct (nrouter.ai/models/phi-4-mini-instruct), Phi 4 Reasoning (nrouter.ai/models/phi-4-reasoning), Phi 4 Mini Reasoning (nrouter.ai/models/phi-4-mini-reasoning).