Text

Grok 4

Grok 4 is xAI's flagship reasoning model, built for STEM-heavy tasks, real-time information awareness, and agentic tool use. The Grok line emphasizes long-context reasoning, math and coding benchmarks, and integration with live data sources. Use it for research assistants, technical analysis, and applications that benefit from up-to-date world knowledge alongside frontier-class reasoning.

Pricing

Input

$3.00 / 1M

Output

$15.00 / 1M

Pay only for what you use. No subscriptions, no minimums.

Specs

Context
128K
Max output
256K
Latency
Medium
Category
Text
Arabic
Partial

Quick start

Use any OpenAI-compatible client. Just change base_url and your key.

from openai import OpenAI

client = OpenAI(
    api_key="tl-xxxxxxxxxxxxxxxxxxxxxxxx",
    base_url="https://api.thalam.ai/v1",
)

response = client.chat.completions.create(
    model="xai/grok-4",
    messages=[
        {"role": "user", "content": "Hello from Thalam!"}
    ],
)

print(response.choices[0].message.content)

Similar models

GPT-5.6 Sol

NEWTextArabic

The top tier of OpenAI's GPT-5.6 generation. Frontier reasoning, coding, and agentic work with a 1M-token context and image input.

Context
1M
Max output
128K
Latency
Medium
Input price
$5.00 / 1M
Output price
$30.00 / 1M

GPT-5.6 Terra

NEWTextArabic

The balanced tier of OpenAI's GPT-5.6 generation. Same 1M-token context and image input, tuned for everyday production work.

Context
1M
Max output
128K
Latency
Medium
Input price
$2.00 / 1M
Output price
$12.00 / 1M

GPT-5.6 Luna

NEWTextArabic

The fast, high-volume tier of OpenAI's GPT-5.6 generation. Keeps the 1M-token context and image input at the lowest rate in the family.

Context
1M
Max output
128K
Latency
Fast
Input price
$0.20 / 1M
Output price
$1.20 / 1M

More from xAI

All xAI models (2)