AI Models/x-ai/xAI: Grok 4
x-aiChat

xAI: Grok 4

x-ai/grok-4
256KContext Window
Supported Protocols:reasoninginclude_reasoningstructured_outputsmax_tokenstemperaturetop_pseedlogprobstop_logprobsresponse_formattoolstool_choice
Online

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 & Reasoningmodels.reasoning

Technical Specs

Input Modality
Image、Text、Text
Output Modality
Text
Arch

Pricing

Pay per use, no monthly fees
Input Token< ¥0.001/1K Token
Output Token< ¥0.001/1K Token

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

Ready to get started?

Get 1M free tokens on registration, no monthly fees or minimum spend

Register Now →