Grok API
UnificAlly serves 19 xAI models through one API key: 8 language models, 2 image models, 7 video models and 2 audio models. Language models start at $0.15 per 1M input tokens (Grok Build 0.1). Image, video and audio models start at $0.01/sec (Grok Imagine 1.5 Lite Video) and $0.01 per image (Grok Imagine 1.0 Image). Everything is billed from a prepaid balance with no subscription.
Call the language models in the OpenAI format at /v1/chat/completions or the Anthropic format at /v1/messages, with streaming and tool use; the image, video and audio models take POST /v1/tasks with a model ID and an input object.
UnificAlly is an independent API, not affiliated with or endorsed by xAI: you use a UnificAlly API key and balance, not an account with xAI.
The xAI image and video models in the table are grouped, with a playground on each, on the Grok Imagine API page.
All 19 xAI models on UnificAlly
| 모델 | 유형 | 시작 요금 |
|---|---|---|
| Grok 4.7 API LLM 500k context, image input, four reasoning efforts, 46.3% CursorBench 4.0, #5 Harvey Legal Agent. | LLM | $0.3 in / $0.9 out per 1M tokens |
| Grok 4.6 API LLM 500k context, image input, four reasoning efforts, 95.6% SWE-bench Verified, #1 CursorBench 3.2. | LLM | $0.3 in / $0.9 out per 1M tokens |
| Grok 4.5 API LLM 500k context, image input, three reasoning efforts, 79.3% Terminal-Bench 2.1, trained with Cursor. | LLM | $0.3 in / $0.9 out per 1M tokens |
| Grok 4.3 API LLM 1M context, image input, four reasoning efforts incl. none, 115.8 tok/s, 98% Tau2-Bench Telecom. | LLM | $0.1875 in / $0.375 out per 1M tokens |
| Grok 4.20 Reasoning API LLM 1M context, image input, thinking on, agentic tool calling, 98.9 tok/s, 72.2% SWE-bench Verified. | LLM | $0.1875 in / $0.375 out per 1M tokens |
| Grok 4.20 Non-Reasoning API LLM 1M context, image input, no thinking phase, 0.64s first token, 95.8 tok/s, agentic tool calling. | LLM | $0.1875 in / $0.375 out per 1M tokens |
| Grok 4.20 Multi-Agent API LLM Leader agent plus 4 or 16 sub-agents in parallel, 1M context, image input, Responses API only. | LLM | $0.1875 in / $0.375 out per 1M tokens |
| Grok Build 0.1 API LLM 256k context, image input, agentic coding with function calling and MCP, 0.53s first token. | LLM | $0.15 in / $0.3 out per 1M tokens |
| Grok Imagine 2.0 Image API 텍스트-이미지 Quality-focused xAI text-to-image and reference editing with up to 5 input images. | 텍스트-이미지 | from $0.02 per image |
| Grok Imagine 1.0 Image API 텍스트-이미지 Fast xAI text-to-image and reference editing with up to 5 images. | 텍스트-이미지 | $0.01 per image |
| Grok Imagine 1.5 Lite Video API 텍스트-비디오 Cheapest Grok video: T2V or I2V, 1–15s, 480p to 1080p, with sound. | 텍스트-비디오 | from $0.01/sec |
| Grok Imagine 1.5 Fast Video API 텍스트-비디오 T2V, I2V, or reference images with style presets, faster results at 480p, 720p, or 1080p. | 텍스트-비디오 | from $0.04/sec |
| Grok Imagine 1.5 Fast Video Extend API 비디오-비디오 Extend a finished Fast video by 6 or 10 seconds, preset or custom mode. | 비디오-비디오 | from $0.04/sec |
| Grok Imagine 1.5 Video API 텍스트-비디오 T2V, I2V or 14 references, end frame, voices, 1–15s at native 1080p. | 텍스트-비디오 | from $0.04/sec |
| Grok Imagine 1.0 Video Edit API 비디오-비디오 Prompt-driven edit of any clip by URL, 1.0 model, same length and ratio, up to 720p. | 비디오-비디오 | from $0.025/sec |
| Grok Imagine 1.0 Video Extend API 비디오-비디오 Add 2–10 seconds to any 2–15 second clip from its URL, 1.0 model, up to 720p. | 비디오-비디오 | from $0.025/sec |
| Grok Imagine Upscale API 비디오-비디오 Upscale a finished Grok Imagine video to HD from its task ID. | 비디오-비디오 | $0.05 per video |
| Grok Text to Speech API 텍스트 음성 변환 xAI TTS: preset voices, 20 languages, speed control, mp3, wav, or pcm. | 텍스트 음성 변환 | $0.0075/1000 characters |
| Grok Speech to Text API 음성 텍스트 변환 xAI transcription: word timestamps, language detection, speaker diarization. | 음성 텍스트 변환 | $0.05/hour |
How to call the Grok API
Use your UnificAlly API key and any model ID from the model pages. Existing OpenAI clients only need the base URL changed to https://api.unifically.com/v1.
OpenAI format: POST /v1/chat/completions
curl -X POST https://api.unifically.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "xai/grok-4.7",
"messages": [
{"role": "user", "content": "Analyze the tradeoffs in this architecture."}
]
}'Image and video models: POST /v1/tasks
# 1. Start a task
curl -X POST https://api.unifically.com/v1/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "xai/grok-imagine-2.0-image",
"input": {
"prompt": "A cinematic portrait with natural skin texture and detailed lighting",
"aspect_ratio": "2:3"
}
}'
# 2. Read the result with the task_id from step 1
curl https://api.unifically.com/v1/tasks/TASK_ID \
-H "Authorization: Bearer YOUR_API_KEY"Grok API FAQ
- Is this the official Grok API from xAI?
- No. UnificAlly is an independent API that serves xAI's models; it is not affiliated with or endorsed by xAI. You sign up with UnificAlly, create a UnificAlly API key and pay from a UnificAlly balance. The request formats are the same OpenAI and Anthropic formats, so existing code needs a new base URL, API key and model ID.
- How much does the Grok API cost on UnificAlly?
- Each model has its own rate, shown in the table above and on the pricing page. The lowest language model rate right now is $0.15 per 1M input tokens (Grok Build 0.1). Image, video and audio models start at $0.01/sec (Grok Imagine 1.5 Lite Video) and $0.01 per image (Grok Imagine 1.0 Image). You pay per token or per generation from a prepaid balance: no subscription, no monthly minimum, and the balance does not expire. Failed generations are not charged. The Grok 4.6 API pricing guide breaks the rates down model by model.
- Is Grok Imagine included in the Grok API?
- Yes. The 9 Grok Imagine models for images and video run on the same API key through POST /v1/tasks, and the Grok Imagine API page groups them by generation. Every Grok language model works on /v1/chat/completions except Grok 4.20 Multi-Agent, which xAI serves on the Responses API only (/v1/responses).
- Can I call the Grok models with the OpenAI SDK?
- Yes. Point your OpenAI client at https://api.unifically.com/v1, use a UnificAlly API key and set model to an ID such as xai/grok-4.7 (each model page lists its ID). Anthropic SDK code works too on /v1/messages.
- Can I try the Grok models before topping up?
- Yes. A new UnificAlly account starts with a $0.50 signup balance, and every model page has a browser playground that runs on it, so you can compare models before writing any code.