x-aiChat
xAI: Grok 4
x-ai/grok-4
256KContext Window
Supported Protocols:reasoninginclude_reasoningstructured_outputsmax_tokenstemperaturetop_pseedlogprobstop_logprobsresponse_formattoolstool_choice
Normal
Grok 4 is xAI's latest reasoning model with a 256k context window. It supports parallel tool calling, structured outputs, and both image and text inputs. Note that reasoning is not exposed, reasoning cannot be disabled, and the reasoning effort cannot be specified. Pricing increases once the total tokens in a given request is greater than 128k tokens. See more details on the [xAI docs](https://docs.x.ai/docs/models/grok-4-0709)
Capabilities
👁 Vision🧠 Reasoning🔧 Function CallingText GenerationCode GenerationAnalysis & ReasoningReasoning
Technical Specs
Input Modality
Image、Text、Text
Output Modality
Text
Arch
—
Default Temperature
0.7
Default Top_P
1
Pricing
Pay per use, no monthly fees| Billing Type | Unit | Price |
|---|---|---|
| Text Input | — | $3.0000/M tokens |
| Text Output | — | $15.0000/M tokens |
| Cache Read | — | $0.7500/M tokens |
| Web Search | — | $0.0050/次 |
Quick Start
from openai import OpenAI
client = OpenAI(
base_url="https://api.uniontoken.ai/v1",
api_key="YOUR_UNIONTOKEN_API_KEY",
)
response = client.chat.completions.create(
model="x-ai/grok-4",
messages=[
{"role": "user", "content": "Hello!"}
],
)
print(response.choices[0].message.content)FAQ
xAI: Grok 4
x-ai/grok-4
In< ¥0.001/1K
Out< ¥0.001/1K
Context Window256K
Related Models
View All → →Ready to get started?
Get 1M free tokens on registration, no monthly fees or minimum spend
Register Now →