Microsoft: Phi-4

Microsoft: Phi-4

byMicrosoft

Phi-4 is a language model from Microsoft released on Dec 11, 2024. It reads text and writes text, with a 16K token context window and up to 16K tokens per reply.

Show more

It costs $0.07 per million input tokens and $0.14 per million output tokens.

It supports structured JSON output, and its weights are open, so you can host it yourself.

6 providers serve it, including Deep Infra, Hugging Face and Azure. The lowest input price is $0.056 per million tokens at Kilo Gateway.

Modalities
In / out price
$0.07 / $0.14 per 1M
Context
16K
Max output
16K
Released
Dec 11, 2024
Knowledge cutoff
Jun 2024
  • Tool calling
  • Structured output
  • Reasoning
  • Prompt caching
  • Open weights
  • Free to use

Phi-4 pricing

USD, as listed on Nov 29, 2026. Most bills are input heavy, so the cached input rate matters as much as the headline price.

Input$0.07 / 1M tokens
Output$0.14 / 1M tokens

Phi-4 providers

6 providers serve it, including Deep Infra, Hugging Face and Azure. The lowest input price is $0.056 per million tokens at Kilo Gateway. Each host sets its own price and limits, so the cheapest one is not always the one with the longest context.

ProviderInput /MOutput /MCache read /MContextMax output
Deep Infra$0.07$0.14n/a16K16K
Hugging Face$0.07$0.14n/a16K16K
Azure$0.125$0.50n/a16K16K
Kilo Gateway$0.056$0.112n/a16K15K
Eden AI$0.07$0.14n/a16K16K
Azure Cognitive Services$0.125$0.50n/a16K16K

What Phi-4 costs per month

Pick a workload close to yours or type your own volumes.

Phi-4 per month
$6.72
Without caching
$6.72
Per request
$0.0002

Supported request parameters

What you can set when you call Phi-4 through an OpenAI compatible API.

  • Structured outputsstructured_outputs
  • Temperaturetemperature

Alternatives to Phi-4

Models that take the same inputs, closest in price, cheaper ones first.

  • Reads text. Tool calling, structured output, reasoning. Served by 16 providers.

    by nvidiaAug 11, 2026262K context$0.06/M input tokens$0.16/M output tokens16 providers

  • Reads text. Tool calling, structured output. Served by 5 providers.

    by cohereDec 13, 2024$0.0375/M input tokens$0.15/M output tokens5 providers

  • Reads text. Structured output. Served by 6 providers.

    by grypheAug 10, 2023$0.08/M input tokens$0.11/M output tokens6 providers

  • Reads text. Tool calling, structured output, reasoning. Served by 7 providers.

    by ibm-graniteAug 25, 2026$0.06/M input tokens$0.15/M output tokens7 providers

  • Reads text. Served by 2 providers.

    by tencentMay 21, 2026$0.0466/M input tokens$0.1873/M output tokens2 providers

  • Reads text.

    by microsoftFeb 26, 2025$0.07/M input tokens$0.11/M output tokens

More from Microsoft

All Microsoft models

Phi-4 questions

How much does the Phi-4 API cost?

$0.07 per million input tokens and $0.14 per million output tokens. The estimator on this page turns that into a monthly bill for your own workload.

What is the context window of Phi-4?

16,384 tokens of input, and it can write up to 16,384 tokens in one reply. As a rough guide, a million tokens is around 750,000 English words.

Which providers serve Phi-4?

6 providers serve it, including Deep Infra, Hugging Face and Azure. The lowest input price is $0.056 per million tokens at Kilo Gateway. Prices differ by host, so the Providers table on this page lists each one with its input and output price.

Does Phi-4 support tool calling?

Not through the standard tools parameter. For an agent that calls your APIs, pick a model from the alternatives below that does.

Is Phi-4 open source?

Its weights are published, so you can run it on your own hardware or a cloud of your choice. Read the license before commercial use.

When was Phi-4 released?

Dec 11, 2024, with training data up to Jun 2024.

Catalog data from models.dev (MIT licensed), refreshed daily, last on Nov 29, 2026. The summary is written from these facts.