SpaceXSI API: Grok Models, API Keys & Pricing
发布时间:2026-10-22 | 浏览:2
Generate text and code, create images and video, build voice agents, and search the web in real time, all through one API.
Works with your existing SDK
Usage-based pricing from $2/M tokens
Playground included with every account
Zero to first token
Start building with your API key
Create an account, generate a key, and ship your first Grok request in about a minute.
1 Sign up at console.x.ai .
Sign up at console.x.ai .
2 Create an API key on the “API Keys” page.
Create an API key on the “API Keys” page.
3 Set your base URL to https://api.x.ai/v1 and call grok-4.7 .
Set your base URL to https://api.x.ai/v1 and call grok-4.7 .
Works with the AI SDKs you already use, in Python, TypeScript, or plain curl.
xai-••••••••••••••••3kf9
xai-••••••••••••••••q7d2
Keys are shown once at creation. Store them securely.
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 for coding and knowledge work. It works longer on difficult tasks, checks its own work more carefully, and comes with our best-calibrated safeguards to date.
Our newest flagship model for coding and knowledge work. It works longer on difficult tasks, checks its own work more carefully, and comes with our best-calibrated safeguards to date.
Image and video generation & editing
Text, Image → Image
Text, Image, Audio → Video
Text, Image → Video
Text, Image → Image
Text, Image → Image
Text, Image, Video → Video
Text, Image → Image
Text, Image, Audio → Video
Text, Image → Video
Text, Image → Image
Text, Image → Image
Text, Image, Video → Video
Realtime, TTS, and STT
Included with Console
Try Grok in the Playground
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.
Everything you can build with the API
Intelligent coding models for software engineering, building apps, and orchestrating agents.
Text generation
Powerful text and reasoning models for chat, analysis, and problem-solving.
Live web & X search
Tap into the now with real-time search, pulling fresh, relevant data from the web and X instantly.
Files & collections
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.
Enterprise API controls, compliance, and support
The SpaceXSI enterprise API adds SSO, audit logging, invoicing, data residency, and dedicated support on top of the same Grok models you can try in the Console.
SSO and audit logging
SAML SSO, role-based access, and audit logging for your team.
Audited controls for security, availability, and confidentiality.
A BAA is available for healthcare applications that handle protected health information.
Regional processing options for teams that need them.
Invoicing and billing
Monthly invoicing for API usage, alongside prepaid credits in the Console.
Custom rate limits
Request and concurrency limits scaled to your production traffic.
Zero Data Retention
Team admins can enable ZDR in the Console so API prompts and outputs are not persisted.
Dedicated support
Hands-on onboarding and a dedicated support path for your team.
Manage everything in the SpaceXSI Console
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.
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
Free Playground on console.x.ai to test Grok models before you buy
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
Available on your preferred cloud
Deploy Grok through the cloud you already trust, with first-party support across the major platforms.
Azure AI Foundry
Microsoft Azure
OCI Generative AI
Vertex Model Garden
Introducing Grok Voice 3.0
Introducing Grok 4.7
Introducing Grok Voice Transcribe 2.0
Imagine Image 2.0
Frequently asked questions
How do I get an API key for Grok?
Is Grok free to use through the API?
How much does Grok cost through the API?
Can I use the OpenAI or Anthropic SDK with Grok?
Which Grok models are available in the API?
Where is the API documentation for Grok?
Can I use Grok through my cloud provider?
Is there an enterprise API for Grok?
Can I use Grok to generate videos, ads, logos, or voiceovers?