xAI
About xAI
Official Grok API documentation from SpaceXSI. Build with Grok: chat, image and video generation, voice, tool calling, and structured outputs. Quickstarts, guides, and API reference.
Build with the Grok API: intelligent, fast, and cost-effective models across code, text, voice, image, and video.
Our flagship model for code and everything else: agentic tool calling, minimal hallucinations, configurable reasoning.
Real-time conversations, speech-to-text, and text-to-speech.
Website ↗Documentation ↗
Source ↗ · 2026-11-12T03:22:37.849527987ZService status
unknown
Official sampled inference probes by source region, target, model and endpoint; not a platform uptime SLA
Official status page ↗16 indexed models
16 matching models
x-ai/grok-4.7-20260916
Grok 4.7 is SpaceXAI's flagship model for coding, agentic tasks, and knowledge work, succeeding Grok 4.6. It is particularly strong at long-running software engineering tasks, verifying its own work, and managing long context, and it improves on its predecessor at professional kn
- Context window
- 500,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput
Benchmarks
- Artificial Analysis: 35.5
- LMArena: 1,398.47
- OpenRouter Benchmarks: 75.333%
- Vercel AI Gateway: 3.526%
Inference prices
- Cached input / 1M tokens : $0.50 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $2.00 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $6.00 / output_tokens_per_million · xAI ↗
x-ai/grok-4.6-20260810
Grok 4.6 is a model from SpaceXAI with frontier performance on coding, knowledge work, and STEM. It is succeeded by [Grok 4.7](/x-ai/grok-4.7).
- Context window
- 500,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput
Benchmarks
- Artificial Analysis: 31
- LMArena: 1,429.883
- OpenRouter Benchmarks: 92.845%
Inference prices
- Cached input / 1M tokens : $0.50 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $2.00 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $6.00 / output_tokens_per_million · xAI ↗
x-ai/grok-4.5-20260708
Grok 4.5 is a model from SpaceXAI with frontier performance on coding, knowledge work, and STEM.
- Context window
- 500,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput, webSearch
Benchmarks
- Artificial Analysis: 38.8
- LMArena: 1,448.048
Inference prices
- Cached input / 1M tokens : $0.30 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $2.00 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $6.00 / output_tokens_per_million · xAI ↗
x-ai/grok-build-0.1-20260520
Grok Build 0.1 is SpaceXAI’s fast coding model trained specifically for agentic software engineering workflows. It supports text and image inputs with text output, and is optimized for interactive coding agents, tool use, and multi-step development tasks. The model powers SpaceXA
- Context window
- 256,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput, webSearch
Benchmarks
- Artificial Analysis: 27.2
- LMArena: 1,163.967
Inference prices
- Cached input / 1M tokens : $0.20 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $1.00 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $2.00 / output_tokens_per_million · xAI ↗
x-ai/grok-4.3-20260430
Grok 4.3 is a reasoning model from SpaceXAI. It accepts text and image inputs with text output, and is suited for agentic workflows, instruction-following tasks, and applications requiring high factual accuracy. Reasoning can be configured between none/low/medium/high (default lo
- Context window
- 1,000,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput, webSearch
Benchmarks
- Artificial Analysis: 24.9
- LMArena: 1,396.986
Inference prices
- Cached input / 1M tokens : $0.20 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $1.25 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $2.50 / output_tokens_per_million · xAI ↗
x-ai/grok-4.20-multi-agent-20260309
Grok 4.20 Multi-Agent is a variant of SpaceXAI’s Grok 4.20 designed for collaborative, agent-based workflows. Multiple agents operate in parallel to conduct deep research, coordinate tool use, and synthesize information across complex tasks. Reasoning effort behavior: - low / me
- Context window
- 2,000,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput, webSearch
Benchmarks
Inference prices
- Cached input / 1M tokens : $0.20 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $1.25 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $2.50 / output_tokens_per_million · xAI ↗
xAI/grok-voice-2.0
Previous-generation voice model
- Input modalities
- audio, text
- Output modalities
- audio, text
- Capabilities
- audioInput, multimodal, speechOutput, toolCalling
Inference prices
- Per voice minute : $0.08 / audio_minute · xAI ↗
xAI/grok-voice-3.0
Flagship voice model
- Input modalities
- audio, text
- Output modalities
- audio, text
- Capabilities
- audioInput, multimodal, reasoning, speechOutput, toolCalling
Inference prices
- Per voice minute : $0.08 / audio_minute · xAI ↗
xAI/grok-voice-transcribe-2.0
Our best transcription model. Default when model is omitted.
- Input modalities
- audio
- Output modalities
- transcription
- Capabilities
- audioInput, transcription
Inference prices
- Per input audio hour : $0.10 / hour · xAI ↗
x-ai/grok-4.20-20260309
Grok 4.20 is a reasoning model from SpaceXAI with industry-leading speed and agentic tool calling capabilities. It combines the lowest hallucination rate on the market with strict prompt adherance, delivering consistently precise and truthful responses. Reasoning can be enabled/
- Context window
- 2,000,000
- Input modalities
- text, image, file
- Output modalities
- text
- Capabilities
- fileInput, multimodal, promptCaching, reasoning, structuredOutputs, toolCalling, visionInput, webSearch
Benchmarks
- Artificial Analysis: 25.7
Inference prices
- Cached input / 1M tokens : $0.20 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $1.25 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $2.50 / output_tokens_per_million · xAI ↗
x-ai/grok-imagine-video-20260512
Grok Imagine Video is SpaceXAI's fast, text-, image-, and reference-conditioned video generation model. It produces short videos (1–15 seconds, 24 fps) at 480p or 720p across seven aspect ratios - 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, and 2:3. The model supports three generation modes
- Context window
- 0
- Input modalities
- text, image
- Output modalities
- video
- Capabilities
- multimodal, structuredOutputs, videoOutput, visionInput
Benchmarks
Inference prices
- Per generated video second : $0.05 / second · xAI ↗
x-ai/grok-imagine-video-1.5-20260719
Grok Imagine Video 1.5 is a video generation model from SpaceXAI. It creates videos from text prompts, with an optional starting image to guide the scene. It can direct subject and camera motion, pacing, atmosphere, and physical behavior while maintaining visual continuity, and c
- Context window
- 0
- Input modalities
- text, image
- Output modalities
- video
- Capabilities
- audioInput, multimodal, structuredOutputs, videoOutput, visionInput
Benchmarks
- LMArena: 1,487.501
- Vercel AI Gateway: 2.204%
Inference prices
- Per generated video second : $0.08 / second · xAI ↗
x-ai/grok-imagine-video-1.5-lite-20261001
Grok Imagine Video 1.5 Lite is a faster, lower-cost video generation model from SpaceXAI, distilled from [Grok Imagine Video 1.5](/x-ai/grok-imagine-video-1.5). It supports text-to-video and image-to-video, trading some quality for speed and price. 1080p output is rendered at 720
- Context window
- 0
- Input modalities
- text, image
- Output modalities
- video
- Capabilities
- multimodal, structuredOutputs, videoOutput, visionInput
Benchmarks
- Vercel AI Gateway: 1.795%
Inference prices
- Per generated video second : $0.02 / second · xAI ↗
cloudflareWorkersAI/xai/grok-4.20-0309-non-reasoning
xAI's Grok 4.20 non-reasoning model. Skips the thinking trace for fast, single-pass responses while keeping the same training as the reasoning variant.
- Context window
- 2,000,000
- Input modalities
- text
- Output modalities
- text
- Capabilities
- multimodal, structuredOutputs, toolCalling, visionInput, webSearch
Inference prices
- Cached input / 1M tokens : $0.20 / cache_read_tokens_per_million · xAI ↗
- Input / 1M tokens : $1.25 / input_tokens_per_million · xAI ↗
- Output / 1M tokens : $2.50 / output_tokens_per_million · xAI ↗
cloudflareWorkersAI/xai/grok-imagine-image
xAI's Grok Imagine image model. Generates and edits images from text and reference-image inputs with configurable aspect ratio and resolution.
- Input modalities
- text, image
- Output modalities
- image
- Capabilities
- imageOutput, multimodal, structuredOutputs, visionInput
Benchmarks
Inference prices
- Per generated image : $0.02 / image · xAI ↗
x-ai/grok-imagine-image-2.0-20260811
Grok Imagine Image 2.0 is an image generation and editing model from xAI. It is suited for creating images from text prompts and editing images from references, with low and medium quality modes.
- Context window
- 65,536
- Input modalities
- text, image
- Output modalities
- image
- Capabilities
- imageOutput, multimodal, structuredOutputs, visionInput
Benchmarks
- LMArena: 1,436.928
- Vercel AI Gateway: 1.804%
Inference prices
- Per generated image : $0.04 / image · xAI ↗