What the Grok API costs. And Grok 4.6 for 20 to 25% less.
xAI's prices per million tokens next to what Grok 4.6 costs on APIsRouter. xAI doubles the price once a prompt reaches 200K tokens; APIsRouter charges one price at any length, so a 250,000-token document with a 2,000-token answer costs $1.02 at xAI and $0.38 here.
The same traffic for 30 days
Tokens per request: agent 12,000 in and 2,500 out; extraction 2,000 in and 300 out; chatbot 2,000 in and 500 out. No cached input, and every prompt stays under xAI's 200K threshold.
| xAI | APIsRouter | |
|---|---|---|
| Coding agent, 300 tasks a day (Grok 4.6) | $351 | $263 |
| Data extraction, 2,000 records a day (Grok 4.6) | $348 | $261 |
| Support chatbot, 1,000 answers a day (Grok 4.6) | $210 | $158 |
| Total | $909 | $682 |
Grok API prices, per million tokens
xAI's list for prompts under 200K tokens, next to APIsRouter's price for each model we sell below xAI on every token type. xAI prices from docs.x.ai/developers/models, September 2026. From 200K prompt tokens, xAI bills every token of the request at twice these prices.
| Model | Input: xAI / APIsRouter | Cached input: xAI / APIsRouter | Output: xAI / APIsRouter |
|---|---|---|---|
| Grok 4.6 | $2 / $1.50 | $0.50 / $0.40 | $6 / $4.50 |
| Grok 4.7 | $2 / Not on APIsRouter | $0.50 / Not on APIsRouter | $6 / Not on APIsRouter |
| Grok 4.3 | $1.25 / Not on APIsRouter | $0.20 / Not on APIsRouter | $2.50 / Not on APIsRouter |
| Grok Build 0.1 | $1 / Not on APIsRouter | $0.20 / Not on APIsRouter | $2 / Not on APIsRouter |
How Grok API billing works
- Long prompts cost double at xAI: Once a prompt reaches 200K tokens, xAI bills every token of that request at the higher rate: $4 / $12 per million input and output tokens on Grok 4.6. APIsRouter charges $1.50 / $4.50 at any length.
- Cached input: Cached input tokens bill at $0.50 per million on Grok 4.6 at xAI and $0.40 on APIsRouter.
- One key for Grok and the rest: The same APIsRouter key calls Claude, GPT, Gemini, DeepSeek, Kimi and GLM, all paid from one balance, with no xAI account.
- Pay as you go: No subscription needed: top up from $10, with +30% on the first top-up. Unused credit never expires.
Switch with one line
- Get a key: Start free on the $2 trial credit, or top up from $10 below. A top-up key arrives by email.
- Point the OpenAI SDK at APIsRouter: Set base_url to https://api.apisrouter.com/v1. Model IDs are xAI's, such as grok-4.6. Grok takes OpenAI-format requests only, so it does not run in Claude Code.
- Send requests: Every request shows up in your console with its tokens and cost.
from openai import OpenAI
client = OpenAI(
base_url="https://api.apisrouter.com/v1",
api_key="sk-your-apisrouter-key",
)
reply = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)Two ways to pay
Both fill one balance, spent at the prices above.
FAQ
How much does the Grok API cost?
At xAI, Grok 4.6 costs $2 / $6 per million input and output tokens, and $4 / $12 once a prompt reaches 200K tokens. On APIsRouter it costs $1.50 / $4.50 at any length.
How do I get an xAI API key?
Sign up at console.x.ai for an xAI key, or use one APIsRouter key for Grok and every other model: start on the $2 trial credit from your dashboard, or top up from $10 and get the key by email.
Is the Grok API free?
xAI bills the API per token. On APIsRouter you can start on a $2 trial credit: sign in and claim it from your dashboard, no card needed.
Can I use Grok 4.7 on APIsRouter?
No. Grok 4.7 is xAI's flagship, at $2 / $6 per million input and output tokens at xAI, the same list price as Grok 4.6. On APIsRouter, Grok 4.6 costs $1.50 / $4.50.
Is the Grok API OpenAI-compatible?
Yes. Set base_url (baseURL in Node) to https://api.apisrouter.com/v1, use your APIsRouter key and xAI's model IDs, such as grok-4.6. Grok on APIsRouter takes OpenAI-format requests only, so it does not work in Claude Code.
Do I need an xAI account?
No. One APIsRouter key calls Grok, Claude, GPT, Gemini, DeepSeek and more, all paid from one balance.