Seedance 2.0 20% OFF | Create in Video Generator →
xai
x-ai/grok-4.20

x-ai/grok-4.20

2,000,000 context · $2.00/M input tokens · $6.00/M output tokens

Grok 4.20 is xAI's newest flagship model with industry-leading speed and agentic tool calling capabilities. It combines the lowest hallucination rate on the market with strict prompt adherance, delivering consistently...

Pricing

Pay-per-use

No upfront costs, pay only for what you use

Input$2.00 / M Tokens
Output$6.00 / M Tokens
Cache Read$0.20 / M Tokens

Try the model

x-ai/grok-4.20
Online
xai
Hi! I am a helpful AI assistant. What can I do for you?

API Usage

Use the following code examples to integrate with our API:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://llm.wavespeed.ai/v1"
)

response = client.chat.completions.create(
    model="x-ai/grok-4.20",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

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

Info

Providerxai
Typellm

Supported Functionality

Input
TextImage
Output
Text
Context2,000,000
Max Output-
Vision✓ Supported
Function Calling✓ Supported

API Access Guide

Base URLhttps://llm.wavespeed.ai/v1
API Endpointchat/completions
Model IDx-ai/grok-4.20

Grok 4.20 API

x-ai/grok-4.20

Grok 4.20 is xAI's newest flagship model with industry-leading speed and agentic tool calling capabilities. It combines the lowest hallucination rate on the market with strict prompt adherance, delivering consistently...

Input

$2 /M

Output

$6 /M

Context

2000K

Vision

Supported

Tool Use

Supported

Try Grok 4.20 on WaveSpeedAI

Access Grok 4.20 through our unified API — OpenAI-compatible, no cold starts, transparent pricing.

Frequently Asked Questions about Grok 4.20

How much does Grok 4.20 cost via the API?+

Pricing on WaveSpeedAI: $2.00 per million input tokens and $6.00 per million output tokens. Prompt caching and batch processing are billed separately and reduce effective cost on long, repetitive workloads.

What is the context window of Grok 4.20?+

Grok 4.20 supports up to 2000K tokens of context with up to — tokens of output per request.

Is Grok 4.20 OpenAI-compatible?+

Yes. WaveSpeedAI exposes Grok 4.20 through an OpenAI-compatible endpoint at https://llm.wavespeed.ai/v1. Point the official OpenAI SDK at this base URL with your WaveSpeedAI API key — no other code changes required.

How do I get started with Grok 4.20?+

Sign in to WaveSpeedAI, create an API key in Access Keys, then send a request to https://llm.wavespeed.ai/v1/chat/completions with model id set to the value shown above. New accounts receive free credits to evaluate Grok 4.20 before paying per token.

Related LLM APIs