How Much Does xAI Grok API Cost? Pricing Explained

Written by Sudipto Paul | Jul 6, 2026 2:04:00 PM

xAI's Grok API is pay-as-you-go and billed per million tokens, with Grok 4.3 at $1.25 input and $2.50 output per 1M. This guide covers every model, tool, and add-on rate.

How much does the xAI Grok API cost?

The xAI Grok API is pay-as-you-go, billed per million tokens. The flagship Grok 4.3 costs $1.25/1M input and $2.50/1M output, with cached input at just $0.20/1M. The coding model Grok Build 0.1 is cheaper at $1.00 input and $2.00 output per 1M tokens. Image, video, and voice generation are priced separately, and server-side tools add a per-call fee.

How does xAI Grok API billing work?

xAI Grok API billing is usage-based and metered per million tokens, with separate rates for input, cached input, and output. Text and language models are billed by token; the Imagine API is billed per image or per second of video; and the Voice API is billed per minute, character, or hour depending on mode. Requests using xAI's server-side tools add a per-invocation charge on top of token costs.

What are the ways to reduce Grok API token costs?

There are three ways to change your token bill. The Batch API runs requests asynchronously for 20-50% off standard rates. Prompt caching drops repeated input tokens to $0.20/1M. Priority Processing goes the other way, 2x standard rates for lower-latency scheduling, charged only when the response confirms the priority tier.

How much do Grok 4.3 and Grok Build cost per token?

xAI's text models are billed per 1M tokens. Grok 4.3, the flagship chat model, costs $1.25/1M input and $2.50/1M output with a 1M-token context window; the Grok 4.20 multi-agent and reasoning variants are priced identically. Grok Build 0.1, the agentic coding model, is the cheapest at $1.00/1M input and $2.00/1M output over a 256k context. Cached input is $0.20/1M across all of them.

Model Context Input Cached in Output
Grok 4.3 (chat) 1M $1.25 $0.20 $2.50
Grok 4.20 multi-agent 1M $1.25 $0.20 $2.50
Grok 4.20 reasoning 1M $1.25 $0.20 $2.50
Grok 4.20 non-reasoning 1M $1.25 $0.20 $2.50
Grok Build 0.1 (code) 256k $1.00 $0.20 $2.00

*All rates are per 1M tokens. Grok Build is purpose-built for agentic coding; Grok 4.3 handles everything except code, audio, image, and video.

How much does Grok image and video generation cost?

The Grok Imagine API prices images per image and video per second. Standard image generation is $0.02/image, while the higher-quality model runs $0.05/image at 1K and $0.07 at 2K. Video generation ranges from $0.05/sec up to $0.25/sec at 1080p, with a small per-image or per-second media input fee on top. Image and video generation are billed at standard rates even in the Batch API.

Model Resolution Media input Output
grok-imagine-image-quality 1K $0.01/img $0.05/img
grok-imagine-image-quality 2K $0.01/img $0.07/img
grok-imagine-image 1K / 2K $0.002/img $0.02/img
grok-imagine-video-1.5 480p $0.01/img $0.08/sec
grok-imagine-video-1.5 720p $0.01/img $0.14/sec
grok-imagine-video-1.5 1080p $0.01/img $0.25/sec
grok-imagine-video 480p $0.01/sec
 $0.002/img
$0.05/sec
grok-imagine-video 720p $0.01/sec 
$0.002/img
$0.07 / sec

How much does the Grok Voice API cost?

The Grok Voice API is billed by mode. Realtime conversations cost $0.05/min ($3.00/hour), text-to-speech is $15.00 per 1M characters, and speech-to-text is $0.10/hour for batch or $0.20/hour streaming. Realtime text input is charged at $0.004 per message.

Mode Cost
Realtime (voice agent) $0.05/min ($3.00/hr)
Realtime text input $0.004/message
Text-to-speech $15.00/1M chars
Speech-to-text (REST/batch) $0.10/hr
Speech-to-text (streaming) $0.20/hr

How much do xAI Grok tools like web search and code execution cost?

xAI's server-side tools are billed per 1,000 invocations on top of token costs, since the agent decides how many calls to make. Web Search, X Search, and Code Execution are each $5 per 1k calls; Collections Search (RAG) is the cheapest at $2.50 per 1k calls; and File Attachments search is $10 per 1k calls. Image and video understanding are billed by tokens rather than per call.

Tool Cost/1k calls
Web Search $5/1k calls
X Search $5/1k calls
Code Execution $5/1k calls
File Attachments $10/1k calls
Collections Search (RAG) $2.50/1k calls
Image / X Video Understanding Token-based
Remote MCP Tools Token-based

Tool requests are billed for both token usage and server-side invocations, meaning costs scale with query complexity.

How can you lower xAI Grok API costs and what does storage cost?

The biggest saving is the Batch API, which cuts token costs 20-50% for requests that can wait up to 24 hours. Priority Processing does the opposite, charging 2x for lower latency. Beyond compute, xAI bills storage: files at $0.025/GiB/day, collections at $0.10/GiB/day, and downloads from either at a flat $0.20/GiB.

Option Rate
Batch API (text/language) 20-50% off standard
Priority processing 2x standard
File storage $0.025/ GiB/day
Collection storage $0.10/GiB/day
File/collection downloads $0.20/GiB
Usage guideline violation fee $0.05/request

The batch discount applies to text and language models only; image and video generation stay at standard rates.

What does a typical Grok API request actually cost?

A typical Grok 4.3 chat turn, roughly 2,000 input tokens and 500 output tokens, costs about $0.0038, so around $3.75 per 1,000 such turns. Heavier workloads scale linearly: a 100k-token input document summarized to 2k tokens on Grok 4.3 runs about $0.13, and the Batch API would roughly halve it.

Scenario Math Cost
Grok 4.3 chat turn (2k in/500 out) (2k×$1.25 + 500×$2.50)/1M ~$0.0038
1,000 such chat turns 1,000×$0.0038 ~$3.75
100k-token doc summary, Grok 4.3 (100k×$1.25 + 2k×$2.50)/1M ~$0.13
Same summary via Batch API (≈50% off) ~$0.13 × 0.5  ~$0.065
Grok Build coding task (50k in/10k out) 50k×$1.00 + 10k×$2.00)/1M  ~$0.07
10-sec 1080p video, grok-imagine-video-1.5 10×$0.25 + $0.01 ~$2.51

*Estimates exclude tool-invocation fees and cached-input discounts; enabling caching or batching lowers real cost.

Should you use the real-time, batch, or priority tier?

Choose the tier by how much you value speed. Real-time is the default at standard rates with immediate responses. Batch is best for large non-urgent job, 20–50% cheaper but up to 24 hours to complete, and it doesn't count against rate limits. Priority Processing is for latency-sensitive text requests, at 2x standard rates.

How do you make your first xAI Grok API call?

You make your first Grok API call in three steps: create an API key in the xAI console, set it as an environment variable, then POST a chat request to the Grok endpoint. The API is OpenAI-compatible, so most existing SDK code works with just a base-URL and key change.

  1. Create your API key: Generate one in the xAI console under API Keys, then export it locally.

    export XAI_API_KEY="your-api-key-here"

  2. Send a chat request to Grok 4.3: POST your messages to the chat completions endpoint with the model name.

    curl https://api.x.ai/v1/chat/completions \
      -H "Authorization: Bearer $XAI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "grok-4.3",
        "messages": [{"role": "user", "content": "Explain our product launch in 30 seconds"}]
      }'
  3. Add tools or realtime data if needed: Grok has no knowledge of current events on its own. Enable server-side Web Search or X Search ($5/1k calls) to pull live data into a response. Use grok-4.3 for the latest stable release, or a dated alias like grok-4.20-0309 for reproducible workflows.

Frequently asked questions about xAI Grok API pricing

1. Is there a free tier or minimum spend for the Grok API?

xAI's published pricing is pay-as-you-go per token with no listed minimum. Billing and model access can vary by region and account. Check the xAI console's billing page for current terms.

2. What is the difference between Grok 4.3 and Grok Build?

Grok 4.3 is the general-purpose chat model ($1.25 in / $2.50 out per 1M, 1M context). Grok Build 0.1 is a dedicated agentic coding model, cheaper at $1.00 in / $2.00 out per 1M over a 256k context.

3. What are cached input tokens and why are they cheaper?

Cached input tokens are prompt tokens served from cache instead of recomputed, billed at $0.20/1M versus $1.25 standard on Grok 4.3. Caching discounts are applied before any Priority Processing multiplier.

4. Are tool invocations billed separately from tokens?

Yes. Tool-using requests are billed for both token usage and per-invocation tool fees. Total cost scales with how many tools the agent calls.

5. Does xAI charge for blocked or violating requests?

Yes. xAI still charges for generation on requests deemed to violate usage guidelines, and applies a $0.05 fee per request for violations caught before generation in the Responses API.

Who is the xAI Grok API best for?

The xAI Grok API is best for teams that want a capable general model at competitive per-token rates with a large 1M-token context. Grok 4.3 at $1.25/$2.50 per 1M sits below many flagship rivals, and the $0.20 cached-input rate plus 20–50% Batch discount reward high-volume, cache-friendly workloads. Coding teams should default to the cheaper Grok Build, and anyone needing live data should budget for the $5/1k search-tool fees.

Pick Grok Build for code and Grok 4.3 for everything else, lean on prompt caching and the Batch API to cut costs, and reserve Priority Processing for genuinely latency-sensitive traffic. Rates and model availability change, so confirm current pricing in the xAI console before committing to a production budget.

Check out our AI API pricing guide to evaluate API costs for other leading AI platforms.