xAI: Grok 4API pricing
Grok 4 is xAI's reasoning model, trained with reinforcement learning to call tools such as a code interpreter and web and X search. It suits hard research questions and real-time lookups, and a heavier parallel-compute variant, Grok 4 Heavy, is also offered.
- 每100万枚代币的价格
- $3.30 / $16.50input / output
- 缓存的输入
- $0.82per 1M tokens
- 上下文
- 256K tokens64K max output
- 服务提供商
- 1
服务提供商
1 provider ·
256K context · 64K max output
支持的参数11
- 抽样
温度top_ptop_k种子logit_bias- 处罚
存在惩罚- 输出
停止response_format结构化输出- 工具
工具工具选择
价格走势
API
curl https://api.opencheap.si/v1/chat/completions \
-H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "opencheap/grok-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/grok-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/grok-4",
messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);致电 Grok 4 使用 OpenAI SDK:将其指向 https://api.opencheap.si/v1 并传递模型 ID opencheap/grok-4;其余代码保持不变。
About Grok 4
- 请求示例
- $0.0510,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.
用文字表述价格
Grok 4 costs from $3.30 per 1M input tokens and $16.50 per 1M output tokens on OpenCheap, with cached input at $0.82 per 1M tokens. It has no public list price to compare with. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.05, and 1,000 such requests about $49.50.
One provider serves Grok 4 on OpenCheap today. Its context window is 256K tokens (256,000), room for roughly 190,000 words of English in one request.
Grok 4 is one of 22 xAI models on OpenCheap.
Prices as of 2026-12-04 11:09 UTC.
关于定价的问题
How much does the Grok 4 API cost per 1M tokens?
Grok 4 costs from $3.30 per 1M input tokens and $16.50 per 1M output tokens on OpenCheap, with cached input at $0.82 per 1M tokens. Prices as of 2026-12-04 11:09 UTC.
What does one Grok 4 request cost?
A request with 10,000 input tokens and 1,000 output tokens costs about $0.05, and 1,000 such requests about $49.50. Every answer reports its own cost in usage.cost.
Which providers serve Grok 4?
One provider serves Grok 4 on OpenCheap today. 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 Grok 4?
Its context window is 256K tokens (256,000), room for roughly 190,000 words of English in one request.
How do I call the Grok 4 API?
Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/grok-4. One OpenCheap key works for every model; the rest of your code stays the same.
More from xAI
- Grok 4.7grok-4.7$1.26 / $5.03 per 1M · 500K context
- Grok 2 Vision 1212grok-2-vision-1212每1M 1.80美元 / 9.00美元
- Grok 4.1 Fastgrok-4.1-fast-non-reasoning$0.20 / $0.50 per 1M · 1M context
- Grok 4.1 Fast (reasoning)grok-4.1-fast-reasoning$0.20 / $0.50 per 1M · 1M context
- grok-4.20grok-4.20$1.25 / $2.50 per 1M · 2M context
- Grok 4.20 Betagrok-4.20-beta$0.26 / $1.05 per 1M · 2M context
- Grok 4.20 Beta 0309grok-4.20-beta-0309-non-reasoning$2.00 / $6.00 per 1M · 2M context
- Grok 4.20 Beta 0309 (reasoning)grok-4.20-beta-0309-reasoning$2.00 / $6.00 per 1M · 2M context
类似型号
- 克劳德 作品4.5Anthropic · 200K context$2.45 / $12.25 per 1M26 % cheaper
- Sonar ProPerplexity · 200K context$3.15 / $15.75 per 1M
- GPT 5.5OpenAI · 100万上下文$2.00 / $12.00 per 1M28 % cheaper
- 克劳德 作品4.7Anthropic · 100万词上下文$3.25 / $16.25 per 1M
- Cohere Command ACohere · 256K context$2.50 / $10.00 per 1M38 % cheaper
- GPT 5OpenAI · 400K context$1.25 / $10.00 per 1M41 % cheaper