Phi 4 Pricing

    OSS

    As of August 21, 2026, Phi 4 API pricing is $0.07 per million input tokens and $0.14 per million output tokens. A typical 100K-in / 20K-out request costs $0.010. Source: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/

    Source: Microsoft pricing (https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/)

    Updated August 21, 202616K context$0.21 blended / 1M

    Input $/M

    $0.07

    Output $/M

    $0.14

    Blended / 1M

    $0.21

    100K / 20K request

    $0.010

    Phi 4 specs

    Context Window16K
    Max Output16K tokens
    Release Date2024-12-12
    Knowledge Cutoff2024-06-01
    LicenseOpen Source
    Throughput33 tok/s

    Phi 4 benchmarks

    GPQA56.1%
    GPQA Diamond56.1%
    SimpleQA3%
    IFEval63%
    AIME 202513.8%
    BFCL28.8%
    MMLU84.8%
    HumanEval82.6%
    MATH80.4%
    Arena-Hard75.4%
    DROP75.5%
    Lech Mazur Writing6.3%
    LiveBench47.6%
    MGSM80.6%
    MMLU-Pro70.4%
    Phibench56.2%

    Compare Phi 4

    Same search as the hub. Pick any model, or jump into a priced matchup.

    Phi 4 FAQ

    How much does Phi 4 cost per million tokens?

    As of August 21, 2026, Phi 4 Microsoft API pricing is $0.07 per million input tokens and $0.14 per million output tokens. Input tokens are the prompt you send; output tokens are the completion. Long answers therefore cost more than short ones even when the prompt stays the same. Source: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/

    What is the blended API cost for Phi 4?

    On this page the blended Phi 4 API cost is $0.21 for 1 million input tokens plus 1 million output tokens. That 1:1 mix is the comparison scale used across the LLM pricing table. A 3:1 mix (three million input tokens per one million output tokens), which some calculators use, would be about $0.35.

    How much does a typical Phi 4 request cost?

    A typical Phi 4 API request with 100K input tokens and 20K output tokens costs about $0.010 at current rates as of August 21, 2026. Multiply that by daily or monthly volume to estimate spend. Caching, batch APIs, and volume discounts from Microsoft can bring the real invoice lower than the public list rate at https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/.

    What is the context window for Phi 4?

    Phi 4 supports a 16K token context window and can generate up to 16K output tokens per request. The context window is the total prompt plus conversation history the model can see in one call. Larger windows cost more when you fill them, because every input token is billed per million tokens.

    Is Phi 4 open source?

    Yes. Phi 4 is an open-weight model by Microsoft. You can download the weights and self-host, or pay Microsoft's hosted API and skip GPU ops. Hosted API pricing on this page is the public per-million-token rate, not the electricity cost of running the weights yourself.

    What benchmarks does Phi 4 perform well on?

    Phi 4 currently reports GPQA 56.1%, GPQA Diamond 56.1%, SimpleQA 3%. See the performance table for the full eval set. Use those scores with the token prices above when you are choosing between a cheaper LLM and a frontier model. GPQA, SWE-bench, and HLE are the evals people usually compare first.

    Is Phi 4 good for coding?

    Phi 4 scores 82.6% on HumanEval. Pair that score with Microsoft API pricing on this page: a slightly worse SWE-bench model can still win if it is much cheaper per million tokens. Open the SWE-bench or coding leaderboard from the sidebar for the full ranking, then jump into an LLM comparison against a coding specialist.

    What is the knowledge cutoff for Phi 4?

    Phi 4 has a published knowledge cutoff of 2024-06-01. Facts after that date are not guaranteed to be in the weights. For current events you still need retrieval or tools, which adds input tokens and therefore API cost per million tokens.

    How do I compare Phi 4 with another LLM?

    Use the Compare picker on this page to start an LLM comparison. Search by model or provider, pick a second model, and AnotherWrapper opens a dedicated Phi 4 vs page with per-million-token prices, blended 1M-in / 1M-out cost, context window, throughput, and benchmarks. You can also open any model from the sidebar, or go back to the LLM pricing table to sort the full index.

    What are the cheapest alternatives to Phi 4?

    The cheapest LLM alternative depends on whether you optimize for blended token cost, coding evals, or context window. Start with the popular matchups on this page, then sort the LLM pricing table by blended cost to see which hosted APIs undercut Phi 4. Open-weight models can be cheaper still if you self-host, but that is not the same as Microsoft API pricing on this page.

    How do I use Phi 4 in my application?

    Phi 4 is called through Microsoft's API with an API key. Bill against input and output tokens separately; cache or shorten prompts if spend is high. If you are shipping a full product, AnotherWrapper includes pre-built API routes and templates for Microsoft and 5+ other providers with auth, payments, and deployment already configured.

    How accurate is this Phi 4 pricing data?

    This Phi 4 page tracks the latest published Microsoft API pricing from Microsoft, quoted per million tokens. List rates can differ from invoices because of prompt caching, batch discounts, committed-use tiers, and private contracts. Official rate sheet: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/. Benchmark scores come from official publications and independent evals, not from a private lab run by AnotherWrapper.

    How fast is Phi 4?

    Phi 4 has a measured throughput of about 33 tokens per second (tok/s). Throughput is how fast completions stream once the model starts generating; time-to-first-token can still lag under load. Faster APIs matter when you are building chat or agents, even if the per-million-token price is the same.

    About Phi 4 API pricing

    Phi 4 is a open-source model from Microsoft. Current API pricing is $0.07 per million input tokens and $0.14 per million output tokens, with a 16K token context window. A blended 1M-in / 1M-out workload costs $0.21.

    Rank it on the LLM leaderboard, SWE-bench, and Humanity's Last Exam.

    The index

    All Large Language Models

    281 models across 33 providers. Search or jump to a lab — every model page stays linked here.

    Baidu

    1 models

    Inception

    1 models

    inclusionAI

    1 models

    LG AI Research

    1 models

    Nous Research

    1 models

    Sakana AI

    1 models

    StepFun

    1 models

    Tencent

    1 models

    Thinking Machines

    1 models

    Unisound

    1 models

    Upstage

    1 models

    Next step

    You found the model. Now ship the product.

    Auth, billing, and the API layer are already decided. Fork 8 finished AI apps, or have us build the first version with you.