xAI
Grok-4-Fast
xAI Grok-4 快速版本,在保持强大能力的同时提供更快响应速度
上下文长度128K tokens
模型类型大语言模型 (LLM)
特色能力快速响应 + 实时搜索
定价与规格
💰 定价
输入$0.2 / M tokens
输出$0.5 / M tokens
⚙️ 规格
上下文长度128K tokens
模型类型大语言模型 (LLM)
特色能力快速响应 + 实时搜索
响应速度优化延迟
API 调用示例
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.xairouter.com/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="grok-4-fast",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)cURL
curl https://api.xairouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "grok-4-fast",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'