Microsoft: Phi 4: AI model
Phi-4 is Microsoft's 14B reasoning-focused model, efficient in memory-limited settings, with a 16K-token context, via Hormouz.
- Context window:
- 16,384 tokens
- Input:
- $0.07/1M tokens
- Output:
- $0.14/1M tokens
- Type:
- text
- Streaming
Phi-4 is a 14B-parameter model from Microsoft Research, built to perform well on complex reasoning while staying efficient when memory is limited or quick responses are needed. It was trained on a mix of high-quality synthetic data, curated web content and academic material.
It has been carefully tuned to follow instructions accurately and maintain strong safety behaviour, and works best with English-language input.
Through Hormouz, Phi-4 is served behind an OpenAI-compatible API. Point your base URL at Hormouz, drop in a Hormouz key, and existing OpenAI SDK code runs unchanged. Pricing is usage-based: $0.07 per million input tokens and $0.14 per million output tokens, with no fixed monthly fee.
Hormouz provides stable access to Phi-4 from inside Iran, with no foreign credit card or circumvention tooling required.
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...
Quickstart
curl https://api.hormouz.net/v1/chat/completions \
-H "Authorization: Bearer ng-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "microsoft/phi-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'Specs
| Vendor | Microsoft |
|---|---|
| Type | Text |
| Context window | 16,384 tokens |
| Pricing | $0.07/M in · $0.14/M out |
| API | Chat Completions |
| Capabilities | Streaming |
Benchmarks
Reasoning
Coding
Agentic
Source: Artificial Analysis
Code example
curl https://api.hormouz.net/v1/chat/completions \
-H "Authorization: Bearer ng-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "microsoft/phi-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'from openai import OpenAI
client = OpenAI(api_key="ng-YOUR_API_KEY", base_url="https://api.hormouz.net/v1")
response = client.chat.completions.create(
model="microsoft/phi-4",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ apiKey: "ng-YOUR_API_KEY", baseURL: "https://api.hormouz.net/v1" });
const response = await client.chat.completions.create({
model: "microsoft/phi-4",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Buy the Microsoft: Phi 4 API, paid in rial
- Buy credit with an Iranian bank card; no foreign card or account needed.
- One Hormouz key reaches Microsoft: Phi 4 and 600+ other models, and you pay only for what you use.
- No VPN and no risk of a banned account; just change the base URL to api.hormouz.net/v1.
Use via Hormouz
Connect to this model and 600+ others with one API key, then see usage down to each request.
Request company accessFAQ
- What is Phi-4 and what is it good for?
- Phi-4 is Microsoft's 14B reasoning-focused model, strong on complex reasoning while staying compact.
- What is the context window of Phi-4?
- It supports up to 16K tokens of context, which suits focused reasoning and shorter documents.
- How much does Phi-4 cost?
- Pricing is usage-based: $0.07 per million input tokens and $0.14 per million output tokens. There is no fixed monthly fee. You pay only for what you use.
- How do I access Phi-4 from inside Iran?
- Create an account on Hormouz and generate an API key. Hormouz provides a stable path to Phi-4 from inside Iran, with no foreign credit card required.
- Is Phi-4 compatible with OpenAI code?
- Yes. Hormouz exposes an OpenAI-compatible API. Just change the base URL to Hormouz and swap in your Hormouz key. Your existing SDKs and code run without a rewrite.
Updated 2026-10-13