Grok

Grok 4

xAI按量收費
Alias:grok-4
text
起始價格
輸入 / 輸出 · 1M
上下文
—
最大輸入窗口
模態
→
發佈於
Jul 2025

Pricing by Supplier

比較同一模型在不同供應商的價格與服務表現。

供應商1
USD · 每 1M tokens效能 · Last 24 hours
供應商Discount輸入/M輸出/M緩存讀取/M
xAI

xAI 官方 API

省40%
$1.98$3.3
$9.9$16.5
$0.495$0.825
刪除線金額為標準價。效能統計涵蓋最近 24 小時,實際表現隨請求變化。

左右滑動表格,查看完整價格與效能。

能力 / 支援的模態

串流輸出系統提示詞函數呼叫工具JSON 模式結構化輸出提示詞緩存
輸入
輸出

廠商與數據私隱

供應商
分詞器
Grok tokenizer (BPE)
許可證
Proprietary (commercial)商業閉源
數據保留4 日預設不會用於上游訓練

效能

基準測試

標準化評測得分。百分比越高越好,並展示排名百分位。

指標來源:Artificial Analysis 2026-09-30·Grok 4

目前基準快照不包含此模型。

缺少模型或測量值不代表零分。

基準圖表保留來源中的模型選擇和推理設定。缺少模型或測量值不代表零分,基準成本或速度也不是本站的服務承諾。

About Grok 4

Use Grok 4 through the API endpoints listed on this page. Compare its configured capabilities and supplier prices before choosing an integration.

查看介紹原文

为复杂问题整理证据与方案

Grok 4 可以处理多步推理、数学问题和代码分析,也适合把分散的文字材料整理成有依据的判断。例如比较两种系统架构的取舍,检查实验方案是否遗漏变量,或从需求、接口说明与故障记录中找出彼此冲突的条件。提问时给出目标、约束和可接受的结果,让模型围绕具体问题展开分析。

对于结论尚不确定的任务,可以要求它分别列出支持证据、反例和仍待确认的假设。需要比较方案时,先定义评价维度,如改动范围、维护成本或失败后的恢复方式,再让它说明每项判断对应哪段材料。这样更容易发现结论是来自证据,还是依赖了额外假设。

如何结合工具完成研究?

Grok 4 具备工具使用能力。接入并启用相应工具后,可以通过检索补充信息,或利用代码执行验证计算。工具需要由当前应用提供并允许使用;单纯发送文字请求,不代表已经搜索网页、查询 X 或运行程序。审阅结果时,检查实际检索到的页面、时间和执行输出。

怎样让代码与计算结果更容易核验?

提供最小可复现输入,并要求给出验证步骤。计算任务保留单位和中间公式,工程问题保留关键代码、环境与日志。把执行后的错误反馈给模型,再继续调整,比一次要求完整解决所有问题更容易控制质量。

Grok 4 属于较早一代模型。xAI 官方已将其基础版本 grok-4-0709 纳入退役重定向;复现历史结果或比较模型时,应同时确认当前渠道实际返回的模型,避免把请求名称当作固定版本保证。

Use cases and prompting

Starting points for evaluation; supported inputs and options are listed in API access.

Use cases to explore

  • Draft and revise text with explicit audience, tone and format requirements.
  • Summarize supplied documents and compare answers against the original sources.

Practical tips

Separate instructions from source material, describe the desired output and provide an example. Test tool use or structured output only when listed as supported.

Example prompt

Summarize the following document in five bullet points. Separate confirmed facts from open questions, cite the relevant passages and do not invent missing information. Document: [paste your text]

查看使用指南原文

例如准备重构缓存模块,可以输入:

“下面是现有缓存逻辑、两次故障记录和新需求。请先指出相互冲突的条件,再比较本地缓存与 Redis 两种方案。按一致性、故障恢复和改动范围列出依据,最后给出最小验证实验。没有证据支持的结论请列为假设。材料:{代码与日志}。”

先确认问题和评价标准,再让它细化选定方案。需要实时资料时,在应用中启用检索工具并限定日期范围;需要验证性能时,实际运行基准测试,将测量结果回传,继续修正分析。

API access

API 介面文件

呼叫示例

請求POST/v1/chat/completions
請求範例
參數
參數類型預設值 / 範圍說明資訊
temperature
number
=10 ~ 2
採樣溫度;越低越穩定
top_p
number
=10 ~ 1
核採樣累積概率
max_tokens
integer>= 1回應中最大 token 數
frequency_penalty
number
=0-2 ~ 2
懲罰高頻 token 的重複出現
presence_penalty
number
=0-2 ~ 2
鼓勵引入新話題
stop
array—最多 4 個停止生成的字串
seed
integer—盡量保證可復現的採樣種子
n
integer
=1>= 1
生成的候選條數
stream
boolean
=false
透過 SSE 串流返回 token
response_format
object—強制輸出 JSON 物件或符合 Schema 的結果
tools
array—模型可呼叫的工具 / 函數聲明
tool_choice
string
autononerequired
工具選擇策略或具體工具名
logprobs
boolean
=false
返回每個 token 的對數概率
top_logprobs
integer0 ~ 20每個 token 返回的 top 概率數量
logit_bias
object—按 token 的 logit 偏置映射
user
string—用於風險審計的終端用戶標識

替換 <YOUR_API_KEY> 替換為 API 金鑰頁面中的金鑰。

身份驗證

所有請求必須攜帶 Authorization: Bearer <TOKEN> 請求頭。Anthropic 格式的端點也接受 x-api-key 請求頭。

在「令牌」頁面生成 API Key,可以按模型、分組、IP、速率等維度精細化授權。

支援的參數

Generation parameters
參數類型預設值 / 範圍說明資訊
temperature
number
=10 ~ 2
採樣溫度;越低越穩定
top_p
number
=10 ~ 1
核採樣累積概率
max_tokens
integer>= 1回應中最大 token 數
frequency_penalty
number
=0-2 ~ 2
懲罰高頻 token 的重複出現
presence_penalty
number
=0-2 ~ 2
鼓勵引入新話題
stop
array—最多 4 個停止生成的字串
seed
integer—盡量保證可復現的採樣種子
n
integer
=1>= 1
生成的候選條數
stream
boolean
=false
透過 SSE 串流返回 token
response_format
object—強制輸出 JSON 物件或符合 Schema 的結果
tools
array—模型可呼叫的工具 / 函數聲明
tool_choice
string
autononerequired
工具選擇策略或具體工具名
logprobs
boolean
=false
返回每個 token 的對數概率
top_logprobs
integer0 ~ 20每個 token 返回的 top 概率數量
logit_bias
object—按 token 的 logit 偏置映射
user
string—用於風險審計的終端用戶標識

速率限制

供應商RPMTPMRPD
xAI無限制無限制無限制

無限制

Frequently asked questions about grok-4

What is grok-4?

Use grok-4 through the API endpoints listed on this page. Compare its configured capabilities and supplier prices before choosing an integration.

How do I call grok-4?

Create an API key with access to grok-4, then use the exact model ID and a supported endpoint from the API access section. Request fields depend on the selected endpoint.

How is grok-4 priced?

Pricing depends on the selected provider group and the model billing unit. The current input, output, request, or media prices are shown on this page before sign-up.

How should I evaluate grok-4 for my project?

Separate instructions from source material, describe the desired output and provide an example. Test tool use or structured output only when listed as supported.