All labs

Grok API

Grok models from xAI, through one OpenAI-compatible API.

xAI builds the Grok models: fast general-purpose and reasoning models with large context windows. UltraGPT serves every Grok model through the OpenAI-compatible API.

Models

9

From / 1M input

$2

Grok 4.7

Largest context

500K

Grok 4.7

xAI models and prices

Chat and embedding prices are USD per 1M tokens: input / output.

ModelTypePrice
Grok 4.7grok-4.7Chat$2 / $6
Grok 4.6grok-4.6Chat$2 / $6
Grok 4.5grok-4.5Chat$2 / $6
Grok Voicegrok-voiceText to speech$0.0150 / 1K chars
Grok Imagine Image 2.0grok-imagine-image-2.0Images~$0.060 / image
Grok Imagine Video 1.5grok-imagine-video-1-5Video$0.080 / sec
Grok Imagine Video 1.5 Litegrok-imagine-video-1-5-liteVideo$0.020 / sec
Grok Imagine Videogrok-imagine-videoVideo$0.050 / sec
Grok Imaginegrok-imagine-image-qualityImages~$0.050 / image

Call Grok 4.7 in a few lines

Swap the model id for any model in the table above; nothing else changes.

curl https://api.ultragpt.pro/v1/chat/completions \
  -H "Authorization: Bearer $ULTRAGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.7",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

Comparisons

FAQ

How do I get a Grok API key?

Sign in to UltraGPT Developers, top up your balance and create an API key. The same key works for every xAI model and every other model on UltraGPT - no separate xAI account needed.

How much does the Grok API cost on UltraGPT?

Chat models of xAI start at $2 per 1M input tokens (Grok 4.7). You pay per token from a prepaid balance, with no subscription; each model's page lists its exact input, cached-input and output prices.

Does it work with the official SDK?

UltraGPT is OpenAI-compatible: use the official OpenAI SDK (Python, Node.js) or any OpenAI-compatible tool with the base URL https://api.ultragpt.pro/v1 and the model id from the table.

Which xAI model has the largest context window?

Grok 4.7 (grok-4.7), with 500,000 tokens.

Quickstart → Use it in Cursor, Claude Code, Cline… → All models →