Build with the most
powerful AI models.

Frontier models for reasoning, voice, vision, and more. One unified API, every modality, production-ready in minutes.

Products

Every modality, one API

Capabilities

Models that fit your needs

Text generation

Powerful text and reasoning models for chat, analysis, and problem-solving.

Code

Intelligent coding models for software engineering, building apps, and orchestrating agents.

Voice API

Build real-time voice agents with speech-to-text, text-to-speech, and conversational AI capabilities.

Search

Tap into the now with real-time search, pulling fresh, relevant data from the web and X instantly.

Image and Video generation

Generate high-quality images and short videos with synchronized audio from text prompts or static images.

File management

Upload documents and let Grok intelligently search and reason over your PDFs, spreadsheets, presentations, and more.

Quickstart

Start building in minutes

Our API is compatible with OpenAI and Anthropic's SDKs. Migrating is as easy as generating an API key and changing a URL.

import os
from xai_sdk import Client
from xai_sdk.chat import user

client = Client(
    api_key=os.getenv("XAI_API_KEY")
)

chat = client.chat.create(model="grok-4.3")
chat.append(user("Explain quantum computing"))

response = chat.sample()
print(response.content)

Models and pricing

grok-4.3
New

Our newest flagship model that leads the industry in non-hallucination rate and agentic tool calling capabilities. Supports both non-reasoning and reasoning modes.

Capabilities
Context window
1M
Text Input
$1.25
Output
$2.50
grok-build-0.1
New

xAI's fast coding model trained specifically for agentic coding, currently in early access.

Capabilities
Context window
256k
Text Input
$1.00
Output
$2.00

Imagine API

Image and video generation & editing

grok-imagine-image-quality

Text, Image → Image

Media Input
$0.01 / img
1K
$0.05 / img
2K
$0.07 / img
grok-imagine-image

Text, Image → Image

Media Input
$0.002 / img
1K
$0.02 / img
2K
$0.02 / img
grok-imagine-video

Text, Image, Video → Video

Media Input
$0.01 / sec
$0.002 / img
480p
$0.05 / sec
720p
$0.07 / sec

Voice API

Realtime, TTS, and STT

Realtime$0.05 / min ($3.00 / hr)
Text to Speech$15.00 / 1M characters
Speech to Text$0.10 / hr (REST), $0.20 / hr (Streaming)

All prices are per million tokens or as stated.

Full pricing can be found on our docs.

Available on your preferred cloud

Deploy Grok through the cloud you already trust, with first-party support across the major platforms.

Choose how to get started

Build on your own

Launch your AI-powered product with:


  • Access to all Grok models
  • Usage-based pricing
  • Automatically increasing rate limits
  • Comprehensive documentation and guides

Get extra support

Custom rate limits and hands-on support for your team.


  • Dedicated onboarding support
  • Custom rate limits
  • Billing via monthly invoices
  • Single sign-on and audit logging
  • Data residency options