xAI API cost is not just one model price. Tokens, tools, media, storage and retries all change the bill.

1. Who this is for
This is for builders planning a support assistant, analyst tool, coding workflow, document feature or research product on the xAI API. You are close enough to shipping that the pricing page has started to matter.
The first trap is pricing by request count. One user message can be a short answer, a long report, a web search session, a code execution run or a media generation flow.
The second trap is mixing up chat subscriptions with API billing. SuperGrok is for a person using Grok. API pricing is for software calling xAI models.
2. How much does the Grok API cost?
The xAI pricing docs list Grok 4.5 at USD 2 per 1 million input tokens, USD 0.30 cached input and USD 6 per 1 million output tokens for prompts under 200k tokens. Grok 4.3 is listed lower at USD 1.25 input, USD 0.20 cached input and USD 2.50 output. Grok Build 0.1 is listed at USD 1.00 input, USD 0.20 cached input and USD 2.00 output.
Watch the long context tier. Both models double in price once a prompt reaches 200k tokens, and the higher rate applies to every token in that request, not just the tokens above the threshold.
The model docs list Grok 4.5 with a 500k token context window, Grok 4.3 with a 1 million token context window and Grok Build 0.1 with 256k tokens. Bigger context can be helpful, but filling it without a reason is an easy way to spend more.
Output tokens deserve special attention. Teams often limit uploads, then let the model write long reports by default. If users only need a short decision note, design for that.
How to read token prices
Input is what you send. Cached input is reused prompt content served from cache. Output is what the model writes back. Reasoning, image tokens and tool-related tokens can also appear depending on the request path.
A short answer with no tools and a research answer that searches, opens pages and runs code are not the same cost event.
3. How do tools change the API bill?
The xAI pricing docs list server-side tool invocation charges on top of token usage. Web Search, X Search and Code Execution are each listed at USD 5 per 1,000 calls.
File Attachments search is listed at USD 10 per 1,000 calls, and Collections Search at USD 2.50 per 1,000 calls. Image and X video understanding through search are described as token-based rather than a separate tool-call charge.
That means agent behaviour matters. A short answer with no tools and a research answer that searches, opens pages and runs code are not the same cost event.
4. Media, voice and storage
The pricing docs list Grok Imagine image and video prices separately from chat tokens. For example, Grok Imagine Video 1.5 output is listed at USD 0.08 per second for 480p, USD 0.14 for 720p and USD 0.25 for 1080p.
Voice also has its own lines. Realtime is listed at USD 0.05 per minute, text to speech at USD 15 per 1 million characters, and speech to text at USD 0.10 per hour for REST or USD 0.20 per hour for streaming.
Files and collections can keep costing after the answer is written. xAI lists file storage at USD 0.025 per GiB per day, collection storage at USD 0.10 per GiB per day and downloads at USD 0.20 per GiB.
5. How do you estimate Grok API cost?
A useful pilot logs model name, input tokens, cached input tokens, output tokens, tool calls, media outputs, storage, retries, latency, errors and whether a human accepted the result. Without that log, the bill is just a surprise with decimals.
Keep the source limits in mind. Public pricing pages can change, and your account may have different availability by region, account status or negotiated terms.
6. The bottom line
The xAI API can be cheap or expensive depending on product design. Short text answers, cached prompts and narrow tools behave very differently from agents that search, execute code and create media.
Takeaway: price from real prompts before launch. The pricing table is the starting point, but your users decide the bill through what they ask for and what your app allows.