Generate text and code, create images and video, build voice agents, and search the web in real time, all through one API.
Zero to first token
Create an account, generate a key, and ship your first Grok request in about a minute.
Sign up at console.x.ai.
Create an API key on the “API Keys” page.
Set your base URL to https://api.x.ai/v1 and call grok-4.6.
Works with the AI SDKs you already use, in Python, TypeScript, or plain curl.
Usage-based pricing, billed per token. Prepaid credits and enterprise invoicing available. Our latest flagship is below. Full pricing for every Grok model lives in the docs.
Our newest flagship model that leads the industry in coding, non-hallucination rate, and agentic tool calling, with a particular focus on long-running agents and ambitious interactive and visual work.
| Model | Capabilities | Context window | Text Input / 1M tokens | Output / 1M tokens |
grok-4.6 NewOur newest flagship model that leads the industry in coding, non-hallucination rate, and agentic tool calling, with a particular focus on long-running agents and ambitious interactive and visual work. | 500k | $2.00 | $6.00 |
Image and video generation & editing
Text, Image → Image
Text, Image, Audio → Video
Text, Image → Image
Text, Image → Image
Text, Image, Video → Video
| Model | Media Input | Resolution | Output |
grok-imagine-image-2.0 Text, Image → Image | $0.01 / img | 1K / 2K | from $0.04 / img |
grok-imagine-video-1.5 Text, Image, Audio → Video | $0.01 / img | 480p / 720p / 1080p | from $0.08 / sec |
grok-imagine-image-quality Text, Image → Image | $0.01 / img | 1K / 2K | from $0.05 / img |
grok-imagine-image Text, Image → Image | $0.002 / img | 1K / 2K | $0.02 / img |
grok-imagine-video Text, Image, Video → Video | $0.01 / sec $0.002 / img | 480p / 720p | from $0.05 / sec |
Realtime, TTS, and STT
| Mode | Cost |
| Speech to Speech | Starting at $0.05 / min |
| Text to Speech | $15.00 / 1M characters |
| Speech to Text | $0.10 / hr (REST), $0.20 / hr (Streaming) |
Included with Console
The Playground comes with every Console account: chat with Grok, generate images and video, and test the latest models before you write any integration code. When you’re ready to ship, API usage is billed per token.
Intelligent coding models for software engineering, building apps, and orchestrating agents.
Powerful text and reasoning models for chat, analysis, and problem-solving.
Tap into the now with real-time search, pulling fresh, relevant data from the web and X instantly.
Upload documents and let Grok intelligently search and reason over your PDFs, spreadsheets, presentations, and more.
Generate and edit images, and create video with native audio, from a single API call.
Build realtime voice agents: speech-to-speech, text-to-speech, and speech-to-text.
Create and manage API keys, monitor usage on a real-time dashboard, top up prepaid credits, set up billing, invite your team, and test models in the Playground.
Launch your AI-powered product with:
Custom rate limits and hands-on support for your team.
Deploy Grok through the cloud you already trust, with first-party support across the major platforms.
https://api.x.ai/v1 and make your first call.https://api.x.ai/v1 with your SpaceXAI API key. Most integrations need no other changes.