Textby Microsoft

Phi 4

Microsoft Research 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...

  • By price it is among the cheapest of the 345 text models GenMagic runs (23rd cheapest).
  • Among the models GenMagic runs, it places in the top 10 on 1 of its 15 benchmarks: 5th of 19 on MMLU.
  • It was listed on Jan 10, 2025.

Data last changed Nov 13, 2026 · tracked since Oct 29, 2026 · Every model change

Try Phi 4

Generate with Phi 4 right here. Verify your email to start with free credits.

<$0.01
Try

Specifications

Context window

16K tokens

Max output

15K tokens

Knowledge cutoff

2024-06-30

Input price

$0.10 / 1M tokens

Output price

$0.21 / 1M tokens

Benchmarks

How Phi 4 scores on public benchmarks. Each card links to the benchmark explainer and to the original source.

AIMEMathematics

13.8%± 3.7

source date 2025-02-25
Source: epoch
BALROGAgentic & Tool Use

11.6%

Source: epoch
Chess PuzzlesReasoning & Knowledge

1%± 1.0

source date 2026-08-28
Source: epoch
GPQA DiamondReasoning & Knowledge

56.1%± 2.6

source date 2025-01-31
Source: epoch
LMArena (Coding)Instruction & Preference

1231 Elo

source date 2026-11-11
Source: lmarena
LMArena: Creative WritingInstruction & Preference

1181 Elo

source date 2026-11-11
Source: lmarena
LMArena: Hard PromptsInstruction & Preference

1220 Elo

source date 2026-11-11
Source: lmarena

1217 Elo

source date 2026-11-11
Source: lmarena
LMArena: MathMathematics

1254 Elo

source date 2026-11-11
Source: lmarena
LMArena: Multi-TurnInstruction & Preference

1206 Elo

source date 2026-11-11
Source: lmarena
LMArena (Overall)Instruction & Preference

1217 Elo

source date 2026-11-11
Source: lmarena
MATH (Level 5)Mathematics

64.9%± 1.1

source date 2025-01-31
Source: epoch
MMLUReasoning & Knowledge

84.8%

Source: epoch

Compare against every model in the full benchmark matrix.

Capabilities

Structured output

Returns validated JSON that conforms to a schema you define.

Use Phi 4 through the API

The model id is microsoft/phi-4. Requests bill your GenMagic balance at the price above, and each response reports what it cost.

curl
curl https://genmagic.co/api/v1/chat/completions \
  -H "Authorization: Bearer $GENMAGIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "microsoft/phi-4",
    "messages": [{ "role": "user", "content": "Explain vector databases in two sentences." }]
  }'
Python (openai SDK)
from openai import OpenAI

client = OpenAI(base_url="https://genmagic.co/api/v1", api_key="YOUR_GENMAGIC_API_KEY")

resp = client.chat.completions.create(
    model="microsoft/phi-4",
    messages=[{"role": "user", "content": "Explain vector databases in two sentences."}],
)
print(resp.choices[0].message.content)

From an AI agent, call generate_text with "model": "microsoft/phi-4" on the GenMagic MCP server. Keys, limits and every endpoint are in the API documentation.

Use Phi 4 in n8n

  1. In n8n, open the nodes panel, search for GenMagic and install it (a verified community node), then add it to your workflow.
  2. Set Resource to Text and Operation to Generate.
  3. In Model Name or ID, pick Microsoft: Phi 4, or enter microsoft/phi-4 as an expression.
  4. Connect your GenMagic API key (get one free). Each run is billed at the price above, and the node returns what it cost.

Ready-to-import workflows that already use the node are on GenMagic for n8n.

Similar-priced text models from other providers

Other text models GenMagic runs at a comparable price, on the same balance and API key.

ModelProviderPriceContext
Microsoft: Phi 4 (this model)Microsoft$0.10 in / $0.21 out per 1M tokens16K
PrismML: Ternary Bonsai 2 9BPrism Ml$0.12 in / $0.20 out per 1M tokens262K
Reka EdgeReka$0.15 in / $0.15 out per 1M tokens16K
Mistral: Ministral 3 3B 2512Mistral AI$0.15 in / $0.15 out per 1M tokens131K
Google: Gemma 3 12BGoogle$0.075 in / $0.23 out per 1M tokens131K
Tencent: Hy-MT2-1.8BTencent$0.066 in / $0.27 out per 1M tokens8K

More from Microsoft

All 5 Microsoft models

Price and listing history

Every change GenMagic has recorded for Phi 4 since it began tracking the model on Oct 29, 2026. Prices are GenMagic's, the same the studio and the API charge.

DateChangeBeforeAfter
Nov 1, 2026Price up 36%$0.077 in / $0.15 out per 1M tokens$0.10 in / $0.21 out per 1M tokens

Where these figures come from

  • Price: GenMagic's own price, what the studio and the API charge, recomputed from the provider's price list every few minutes and recorded daily. How pricing works.
  • Specs and description: as Microsoft publishes them (model card on Hugging Face), checked daily.
  • Benchmarks: 15 scores from Epoch AI, LMArena, re-read daily. Each score above links to its source.
  • Changes: the data on this page last changed on Nov 13, 2026, tracked since Oct 29, 2026. Every model's new listings, price changes and retirements are in the model changes log, and how every figure on GenMagic is sourced is on our sources page.

Generate with Phi 4 today

One GenMagic plan unlocks Phi 4 and every other model across text, image, audio, and video.