One key. Every model. Text, code, images, video, voice and live search — one usage-based API that works with the SDKs you already use.
Explain quantum computing
A request, and what comes back.
grok-4.7 · OpenAI-compatible · api.x.ai/v1
Quickstart
Create a key in the Console, paste it into the client you already have, send a request. The scene on the right is the whole thing.
import { xai } from "@ai-sdk/xai";
import { generateText } from "ai";
const { text } = await generateText({
model: xai.responses("grok-4.7"),
prompt: "Explain quantum computing",
});
console.log(text);Already using the Vercel AI SDK? Add @ai-sdk/xai and pass xai.responses("grok-4.7"). Those two lines are the whole migration.
API keys
No keys yet. Create one to start.
$ The APIs
Text and code, images and video, speech — each with its own endpoints and models, all on one key and one bill.
grok-4.7 and grok-4.6 and grok-4.5 for text, reasoning and code — structured outputs, tool calls, live web and X search, and collections over your files.
Images from text or a reference, edits with one to three source images, and video up to 15 seconds with audio, from text, an image or up to 14 references.
Speech to speech over WebSocket with tool calls and barge-in, text to speech across 25+ voices, speech to text with diarization.
Pricing
Prepaid credits or invoicing. Rate limits rise with use. Full, always-current rates for every model are in the docs.
For business
The same Grok models, with the controls your security team asks for. A team on the Business plan shares keys, credits and usage by user; the Enterprise plan adds the rest.
Console
Every account gets the Playground: chat, generate images and video, and test models before you integrate. The Console holds keys, usage, credits, billing and your team.
The same Grok models, in your cloud’s catalog