identity

open weights
Microsoft logo

phi-4Microsoft

from /1M in$0.06deepinfra inc.
context16Ktokens
providers11 region
price spread1.3x2 endpoints
endpoints
2
regions
1
api
chat
released
January 2025

capabilities 1/8

visionreasoningtoolscachingweb searchjson schemacomputer useimage gen

The same weights cost 1.3x more on deepinfra inc. than on deepinfra inc.. That is what the endpoints table is for.

endpoints

2 / 1 region
Providers serving phi-4, with pricing and measured performance. Best value in each column is coloured.
#flags
1DeepInfra Inc.Global16K$0.06$0.11-zdr
2DeepInfra Inc.Global16K$0.07$0.14$0.07zdr
provider price, no markupper 1M tokensblank where no qualifying sample

measured

through Sep 12

no measured traffic for this model yet. the endpoints table above carries provider pricing

benchmarks

artificial analysis
Benchmark scores, each normalised to 100
evalScore as a share of 100/100
MMLU Pro71.4
GPQA Diamond57.5
LiveCodeBench23.1
Math Index18.0
AIME 202518.0
Intelligence Index5.9
Terminal-Bench Hard3.8
Humanity's Last Exam3.8
τ²-Bench0.0
9 evalsmean22.4

Scores from Artificial Analysis and public leaderboards, normalised to 100. Bar colour is the band, not the rank: green 80 and up, blue 55 and up, amber 30 and up. Benchmarks measure narrow skills, so test on your own workload before committing. Released 2024-12-12.

call it

model=
deepinfra/microsoft/phi-4:flex

this model has no managed policy yet, so call the provider endpoint directly. every id in the endpoints table works the same way

Base url is https://router.requesty.ai/v1 for every id here. One key reaches the whole catalog.

quickstart

openai compatible
main.py
from openai import OpenAI client = OpenAI(    api_key="YOUR_REQUESTY_API_KEY",    base_url="https://router.requesty.ai/v1",) response = client.chat.completions.create(    model="deepinfra/microsoft/phi-4:flex",    messages=[        {"role": "user", "content": "Explain quantum computing in one paragraph."},    ],) print(response.choices[0].message.content)

Change the base url, use your Requesty key, set the model to any id in the call pane. Existing OpenAI SDK code needs no other edit, and the same key reaches every other model in the catalog, so switching later is a one-parameter change. Browse all models

notes

reference

Phi-4-reasoning-plus is an enhanced 14B parameter model from Microsoft, fine-tuned from Phi-4 with additional reinforcement learning to boost accuracy on math, science, and code reasoning tasks. It uses the same dense decoder-only transformer architecture as Phi-4, but generates longer, more comprehensive outputs structured into a step-by-step reasoning trace and final answer. While it offers improved benchmark scores over Phi-4-reasoning across tasks like AIME, OmniMath, and HumanEvalPlus, its responses are typically ~50% longer, resulting in higher latency. Designed for English-only applications, it is well-suited for structured reasoning workflows where output quality takes priority over response speed.

questions 5

Which providers serve phi-4?
phi-4 is available from 1 provider through Requesty: DeepInfra Inc.. All endpoints share one OpenAI-compatible API and one key, and Requesty fails over between them automatically.
How much does phi-4 cost?
Pricing starts at $0.06 per million input tokens and $0.11 per million output tokens on the cheapest provider. Prices vary by provider and region; the table above shows every endpoint. Requesty charges exactly what the upstream provider charges, with no markup.
Is phi-4 open weights?
Yes. phi-4 is an open-weights model from Microsoft, which is why multiple inference providers can host it. Provider choice affects price, latency, and data-privacy terms, all compared above.
What is the context window of phi-4?
phi-4 supports up to 16K tokens of context. Some providers expose a smaller window; check the per-endpoint context column above.
How do I use phi-4 with the OpenAI SDK?
Install the OpenAI SDK, set base_url to "https://router.requesty.ai/v1", set your API key to your Requesty key, and set the model to "deepinfra/microsoft/phi-4:flex" or any endpoint id from the table above. The quickstart section shows Python, JavaScript and cURL snippets.

more from microsoft 1

Other Microsoft models
modelcontextfrom /Mproviders
wizardlm-2-8x22b66K$0.621

route phi-4 through one endpoint

One key for 1 provider on this model and 600+ others. No markup on provider prices, automatic failover, caching built in. Weekly aggregates in the measured pane come from production traffic routed through Requesty, one line per provider on a shared axis. Methodology

phi-41 provider2 endpointsfrom $0.06 /1M inctx 16Kspread 1.3xupdated Sep 12