Try Phi 4
Generate with Phi 4 right here. Verify your email to start with free credits.
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.
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 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." }]
}'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
- In n8n, open the nodes panel, search for GenMagic and install it (a verified community node), then add it to your workflow.
- Set Resource to Text and Operation to Generate.
- In Model Name or ID, pick Microsoft: Phi 4, or enter
microsoft/phi-4as an expression. - 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.
| Model | Provider | Price | Context |
|---|---|---|---|
| Microsoft: Phi 4 (this model) | Microsoft | $0.10 in / $0.21 out per 1M tokens | 16K |
| PrismML: Ternary Bonsai 2 9B | Prism Ml | $0.12 in / $0.20 out per 1M tokens | 262K |
| Reka Edge | Reka | $0.15 in / $0.15 out per 1M tokens | 16K |
| Mistral: Ministral 3 3B 2512 | Mistral AI | $0.15 in / $0.15 out per 1M tokens | 131K |
| Google: Gemma 3 12B | $0.075 in / $0.23 out per 1M tokens | 131K | |
| Tencent: Hy-MT2-1.8B | Tencent | $0.066 in / $0.27 out per 1M tokens | 8K |
More from Microsoft
All 5 Microsoft modelsMicrosoft AI: MAI-Image-2.6
ImageMAI-Image-2.6 is an image generation and editing model from Microsoft AI, the precision tier of the MAI-Image-2.6 family alongside the faster MAI-Image-2.6 Flash. It is suited for design-ready visuals and...
View modelMicrosoft AI: MAI-Image-2.6 Flash
ImageMAI-Image-2.6 Flash is the lower-latency, lower-cost member of the MAI-Image-2.6 family from Microsoft AI, built for latency-sensitive, high-throughput production image generation and editing at comparable quality to the precision tier....
View modelMicrosoft AI: MAI-Image-2.5 Pro
ImageMicrosoft AI's MAI-Image-2.5 is a high-quality image generation model available via Azure AI Foundry. It produces photorealistic and artistic images from text prompts with support for various aspect ratios.
View modelMicrosoft AI: MAI-Image-2.5
ImageMicrosoft AI's MAI-Image-2.5 is a high-quality image generation model available via Azure AI Foundry. It produces photorealistic and artistic images from text prompts with support for various aspect ratios.
View modelPrice 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.
| Date | Change | Before | After |
|---|---|---|---|
| Nov 1, 2026 | Price 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.