Microsoft: Phi 4API pricing
Phi 4 is Microsoft's small language model, built to answer prompts in a chat format and aimed mainly at math, coding and general reasoning. It is trained chiefly on English text, so it is not intended for multilingual use.
- 每100万枚代币的价格
- $0.07 / $0.14input / output
- 上下文
- 16K tokens16K max output
- 服务提供商
- 4
服务提供商
4 家服务商 ·
- Route 1 · bf1616K context · 14K max outputCache $0.059*Input $0.059Cache read $0.059 (no cache discount: the input price)Output $0.12Latency —Speed —Uptime —$0.059 in$0.12 out
- Route 2 · bf1616K context · 14K max outputCache $0.073* · 0.11 s · 95 tok/s · 100 %0.11 s · 95 tok/sInput $0.073Cache read $0.073 (no cache discount: the input price)Output $0.15Latency 0.11 sSpeed 95 tok/sUptime 100 %$0.073 in$0.15 out
支持的参数12
- 抽样
温度top_ptop_kmin_p种子logit_bias- 处罚
重复惩罚频率惩罚存在惩罚- 输出
停止response_format结构化输出- 未确认
工具
16K context
支持的参数10
- 抽样
温度top_ptop_k种子logit_bias- 处罚
频率惩罚存在惩罚- 输出
停止response_format结构化输出- 未确认
工具
16K context · 16K max output
支持的参数11
- 抽样
温度top_ptop_k种子logit_bias- 处罚
存在惩罚- 输出
停止response_format结构化输出- 工具
工具工具选择
- 1 more provider through partner hosts · from $0.073 in · $0.15 out
价格走势
API
curl https://api.opencheap.si/v1/chat/completions \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "opencheap/phi-4", "messages": [{ "role": "user", "content": "Hi" }] }'import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.chat.completions.create(model="opencheap/phi-4",
messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });
const r = await client.chat.completions.create({ model: "opencheap/phi-4",
messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);致电 Phi 4 使用 OpenAI SDK:将其指向 https://api.opencheap.si/v1 并传递模型 ID opencheap/phi-4;其余代码保持不变。
About Phi 4
- 标价
- $0.07 / $0.14in / out per 1M
- 请求示例
- $0.0008410,000 in + 1,000 out
- 端点
https://api.opencheap.si/v1- 模型 ID
每个请求都会发送给模型中成本最低且状态正常的提供者,而每个响应都会报告其成本为 使用成本. Every model on OpenCheap is called with one key at the same OpenAI-compatible endpoint, https://api.opencheap.si/v1.
用文字表述价格
Phi 4 costs from $0.07 per 1M input tokens and $0.14 per 1M output tokens on OpenCheap. Its list price is $0.07 per 1M input tokens and $0.14 per 1M output tokens, the same as here. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.00084, and 1,000 such requests about $0.84.
4 providers serve Phi 4 on OpenCheap. Its context window is 16K tokens (16,384), room for roughly 12,000 words of English in one request.
Phi 4 is one of 9 Microsoft models on OpenCheap.
The public list price is $0.07 per 1M input tokens and $0.14 per 1M output tokens. OpenCheap is from $0.07 and $0.14, as of 2026-12-04 11:48 UTC.
Prices as of 2026-12-04 11:48 UTC.
关于定价的问题
How much does the Phi 4 API cost per 1M tokens?
Phi 4 costs from $0.07 per 1M input tokens and $0.14 per 1M output tokens on OpenCheap. Prices as of 2026-12-04 11:48 UTC.
What does one Phi 4 request cost?
A request with 10,000 input tokens and 1,000 output tokens costs about $0.00084, and 1,000 such requests about $0.84. Every answer reports its own cost in usage.cost.
Is Phi 4 cheaper on OpenCheap than its list price?
Its list price is $0.07 per 1M input tokens and $0.14 per 1M output tokens, the same as here.
Which providers serve Phi 4?
4 providers serve Phi 4 on OpenCheap. Each request goes to the cheapest healthy provider of the model; the table on this page lists every provider with its price, speed and uptime.
What is the context window of Phi 4?
Its context window is 16K tokens (16,384), room for roughly 12,000 words of English in one request.
How do I call the Phi 4 API?
Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/phi-4. One OpenCheap key works for every model; the rest of your code stays the same.
More from Microsoft
- Mai Thinking 1mai-thinking-1$2.00 / $8.00 per 1M · 256K context
- Phi 3.5 Vision Instructphi-3.5-vision$0.40 / $1.60 per 1M
- Phi 4 Mini Instructphi-4-mini$0.12 / $0.48 per 1M · 128K context
- Phi 4 Mini (reasoning)phi-4-mini-reasoning$0.12 / $0.12 per 1M · 128K context
- Phi 4 Multimodal Instructphi-4-multimodal$0.07 / $0.11 per 1M · 128K context
- WizardLM-2 8x22Bwizardlm-2-8x22b$0.49 / $0.49 per 1M · 65K context
- Microsoft-Decision-1microsoft-decision-1$0.048 per 1M input · 32K context
- Microsoft-Decision-1.1microsoft-decision-1.1$0.048 per 1M input · 32K context
类似型号
- GLM 4.7Zhipu · 202K context$0.032 / $0.14 per 1M8 % cheaper
- GLM 4.6Zhipu · 202K context$0.044 / $0.18 per 1M
- Reka EdgeReka · 16K context$0.10 / $0.10 per 1M14 % cheaper
- Xiaomi Mimo V2.6 Pro小米 · 1M 上下文$0.054 / $0.11 per 1M23 % cheaper
- Hy-MT2-1.8BTencent · 8.1K context$0.046 / $0.19 per 1M
- Schematron V2 TurboInference.net · 128K context$0.03 / $0.15 per 1M