Skip to content

Independent directorynot affiliated with xAI

Catalog refreshed Nobody pays to be listed or rankedSponsor a slot

API Calculator

xAI Grok API pricing calculator and context window guide

Estimate what a custom bot or script will actually spend on the xAI API before you ship it. Every rate below — including Grok 4.7, Grok 4.3, Grok 4.20, Grok Build 0.1, the 200,000-token long-context doubling cliff, 20% Batch API discounts and server-side tool fees — was checked directly against xAI's developer docs on 22 November 2026.

Looking for the consumer Grok Bot app plans instead of pay-as-you-go API tokens? See our Grok Bot subscription pricing guide ($30 Premium, $100 Super and $200 Ultra per month).

  • Rates checked against docs.x.ai
  • Includes 200k cliff, caching, Batch API & tool fees
  • Independent · not affiliated with xAI
What does Grok 4.7 cost on the xAI API?
Under 200,000 prompt tokens, grok-4.7 costs $2.00 per 1M input tokens, $0.50 per 1M cached input tokens and $6.00 per 1M output tokens. At 200,000 prompt tokens or above, all tokens in the request bill at double ($4.00 / $1.00 / $12.00).
How big is the Grok API context window?
Grok 4.7, 4.6, 4.5 and Grok Build 0.1 have a 500,000-token context window. Grok 4.3 and the Grok 4.20 models (reasoning, non-reasoning and multi-agent) have a 1,000,000-token context window.
How do I get an xAI API key?
Create an API key in the xAI Console (console.x.ai), add prepaid billing credits, and send requests to `https://api.x.ai/v1/responses` with a Bearer token. API billing is separate from X Subscription plans.

Interactive xAI Grok API cost calculator

Pick a preset or enter your token volume, prompt-cache hit rate, Batch API mode and server-side tools. Rates verified against docs.x.ai on 2026-11-22.

Short-context tier (<200k)
Presets:

1. Workload inputs

Context window: 500k tokens
Batch API (async, 24h)20% off
Server-side tools per request (optional)Remote MCP = $0 fee

2. Estimated spend (grok-4.7)

Effective rates: $2.00 in · $0.50 cache · $6.00 out / 1M
Estimated 30-day cost
$2.94
300 requests/mo
Per request
$0.0098
Tokens $0.0098 · Tools $0.00
Daily cost
$0.10
10 req/day
Monthly savings activePrompt caching saves $0.90/mo.

Running personal automations instead of building an API backend? Compare with Grok Bot subscription plans ($30–$200/mo).

3. Side-by-side comparison across all xAI text models

Same workload inputs across every model · click any row to select it
Estimated monthly xAI API spend across models
ModelContextPer request30-day estimateRelative costTier 0 cap
grok-4.7500k$0.0098$2.94150 RPS · 50M TPM
grok-4.6500k$0.0098$2.94150 RPS · 50M TPM
grok-4.5500k$0.0094$2.82150 RPS · 50M TPM
grok-4.31,000k$0.0049$1.4737 RPS · 10M TPM
grok-4.20-0309-reasoning1,000k$0.0049$1.4737 RPS · 10M TPM
grok-4.20-0309-non-reasoning1,000k$0.0049$1.4737 RPS · 10M TPM
grok-4.20-multi-agent-03091,000k$0.0049$1.4737 RPS · 10M TPM
grok-build-0.1500k$0.0040$1.2037 RPS · 10M TPM
On this page 6 sections
  1. Interactive calculator
  2. xAI text API pricing and context windows (Nov 2026)
  3. Server-side tool fees, X Search and Remote MCP
  4. Rate limits, API keys and when to pick Grok Bot vs API
  5. Questions people ask
  6. Sources

xAI text API pricing and context windows (Nov 2026)

Every current xAI text model uses two price tiers split at 200,000 prompt tokens. Crossing 200k tokens doubles input, cached input and output rates for the entire request, not only the tokens past 200k. Keeping prompts under 200k — or using prompt caching and tighter context — is the single biggest lever on API spend.

xAI Grok text API pricing per 1 million tokens and context windows, checked 22 Nov 2026
ItemContextShort (<200k) In / Cache / OutLong (≥200k) In / Cache / OutBatch API
grok-4.7Current flagship500k$2.00 / $0.50 / $6.00$4.00 / $1.00 / $12.0020% off
grok-4.6500k$2.00 / $0.50 / $6.00$4.00 / $1.00 / $12.0020% off
grok-4.5500k$2.00 / $0.30 / $6.00$4.00 / $0.60 / $12.0020% off
grok-4.31M context1M$1.25 / $0.20 / $2.50$2.50 / $0.40 / $5.0020% off
grok-4.20-0309 (reasoning / non-reasoning / multi-agent)1M context1M$1.25 / $0.20 / $2.50$2.50 / $0.40 / $5.0020% off
grok-build-0.1Lowest token rate500k$1.00 / $0.20 / $2.00$2.00 / $0.40 / $4.00No batch discount
All prices in USD per 1 million tokens from docs.x.ai/developers/pricing (checked 22 Nov 2026). Reasoning tokens and completion tokens bill at the output rate.

Sources: xAI API pricingGrok API models and context windows

Server-side tool fees, X Search and Remote MCP

Grok models on the API have no live access to current events unless you enable server-side tools. Requests that use xAI's built-in tools pay both model tokens (input, cached, reasoning, completion) and per-invocation tool fees.

One notable exception for builders: Remote MCP tools carry $0 per-invocation fee — you pay only for the tokens processed when Grok reads tool schemas and responses. You can connect our read-only Grok Bot Templates MCP server at `https://www.grokbottemplates.dev/api/mcp` with zero tool surcharge.

xAI API server-side tool invocation costs, checked 22 Nov 2026
ItemTool nameBilling basisPrice
Web Search`web_search`Per 1,000 calls (includes image search)$5.00 / 1k calls
X Search`x_search`Per item returned (including parent & quoted posts)$5 / 1k posts · $10 / 1k profiles
Code Execution`code_execution`Per 1,000 sandbox calls$5.00 / 1k calls
File Attachments Search`attachment_search`Per 1,000 calls$5.00 / 1k calls
Collections Search (RAG)`collections_search`Per 1,000 queries$2.50 / 1k queries
Remote MCP Tools`mcp` (Streamable HTTP / SSE)Tokens only — no invocation fee$0 tool fee
Source: docs.x.ai/developers/pricing and docs.x.ai/developers/tools/remote-mcp, checked 22 Nov 2026.

Sources: xAI API pricingRemote MCP tools (xAI API)

Rate limits, API keys and when to pick Grok Bot vs API

xAI assigns API teams to Tier 0 through Tier 4 based on cumulative spend since 1 January 2026 ($0, $50, $250, $1,000 and $5,000). Once unlocked, tiers never downgrade. Batch API jobs run asynchronously (typically within 24 hours), save 20% on eligible models and do not count against per-minute rate limits.

Choose Grok Bot (plans from $30/month) when you want a persistent cloud computer, built-in Gmail/Calendar/Slack/GitHub apps, approval cards and ready-made templates. Choose the xAI API when you are building your own software, running high-volume batch jobs or need predictable per-token billing without a weekly pool.

xAI API rate limit tiers and RPS / TPM caps, checked 22 Nov 2026
ItemCumulative spendGrok 4.7 / 4.6 / 4.5 (RPS · TPM)Grok 4.3 / 4.20 (RPS · TPM)
Tier 0$0 (default)150 RPS · 50M TPM37 RPS · 10M TPM
Tier 1$50172 RPS · 53M TPM50 RPS · 15M TPM
Tier 2$250208 RPS · 60M TPM75 RPS · 25M TPM
Tier 3$1,000312 RPS · 74M TPM125 RPS · 45M TPM
Tier 4$5,000500 RPS · 100M TPM208 RPS · 85M TPM
From docs.x.ai/developers/rate-limits (checked 22 Nov 2026). Exceeding RPS or TPM returns HTTP 429.
  • Keep system prompts stable at the start of messages so prompt caching cuts input rates by 75–84%.
  • Stay below 200,000 input tokens per request when possible; crossing 200k doubles every token in the call.
  • Move overnight classification, summarisation and evaluation jobs to the Batch API for an automatic 20% discount.
  • Cap `x_search` result counts carefully because X Search bills per returned post ($5/1k) including parent and quoted posts.

Sources: xAI API rate limitsxAI API pricingThe X Subscription: pricing

Questions people ask

Does an X Subscription or SuperGrok plan include xAI API credits?

No. The xAI Developer API is billed separately through console.x.ai using prepaid credits or invoices, while Grok Bot and Grok app plans live on The X Subscription ($30 Premium, $100 Super, $200 Ultra). You cannot spend consumer weekly usage pools on API token calls.

Sources: xAI API pricingThe X Subscription: pricing

How does the 200,000-token long-context price jump work?

On xAI's text models, any request whose prompt reaches 200,000 tokens or more is billed at the higher long-context rate for every token in that request — input, cached input and output — not just the tokens above 200,000. On grok-4.7 that doubles input from $2 to $4 per million.

Source: xAI API pricing

Which Grok API model has the largest context window?

Grok 4.3 and the Grok 4.20 variants (reasoning, non-reasoning and multi-agent) all support a 1,000,000-token context window at $1.25 input and $2.50 output per million tokens under 200k. Grok 4.7, 4.6, 4.5 and Grok Build 0.1 support 500,000 tokens.

Sources: Grok API models and context windowsxAI API pricing

Which Grok models support the 20% Batch API discount?

Grok 4.7, 4.6, 4.5, 4.3 and the Grok 4.20 models all receive 20% off standard rates across input, cached, reasoning and output tokens on the Batch API, and batch calls do not count against per-minute rate limits. Grok Build 0.1 has no batch discount.

Source: xAI API pricing

Sources

Checked

Product facts on this page come from these pages, each read on the date shown. Pages marked first-party are published by xAI or Cursor; we quote community reports only for known bugs.

  1. xAI API pricing (opens in a new tab)xAI · first-partychecked 22 Nov 2026Text API rates per 1M tokens for grok-4.7, grok-4.6, grok-4.5, grok-4.3, grok-4.20 variants and grok-build-0.1; the 200k-token long-context doubling rule; cached input rates; 20% Batch API discounts; image, video, voice and server-side tool invocation fees (web_search, x_search, code_execution, collections_search, Remote MCP).
  2. Grok API models and context windows (opens in a new tab)xAI · first-partychecked 22 Nov 2026Current API model IDs, 500k and 1M context window sizes, Grok 4.7 as the recommended default for chat and coding, and no real-time web access unless server-side search tools are enabled.
  3. xAI API rate limits (opens in a new tab)xAI · first-partychecked 22 Nov 2026Cumulative-spend rate limit tiers (Tier 0 $0, Tier 1 $50, Tier 2 $250, Tier 3 $1,000, Tier 4 $5,000) and per-model requests per second (RPS) and tokens per minute (TPM) caps.
  4. Remote MCP tools (xAI API) (opens in a new tab)xAI · first-partychecked 22 Nov 2026Connecting external Streamable HTTP and SSE MCP servers via the Responses API tools array (server_url, server_label, allowed_tools, headers), with token-only billing and no per-invocation fee.
  5. The X Subscription: pricing (opens in a new tab)xAI · first-partychecked 5 Nov 2026page updated 11 Oct 2026Monthly and annual prices, included usage multiples, team seat prices, Plus not including Grok Bot, one shared weekly pool, tax.

Engineering bots that ask before acting

Prefer ready-made templates over building a custom API wrapper? Start from an engineering listing or browse all engineering bots.

All 146
  • Vet

    Inspects Grok Bot templates and existing teammates for malicious intent, hidden instructions, dangerous skills, and unattended routines. Issues a pass, warn, or fail verdict. Read-on…

    • Connects to: No apps named
    • Asks first
    • On demand· usage when run
  • Claude Code Commander

    Text your bot a coding task from anywhere: it hands it to Claude Code on your Mac, runs an adversarial reviewer in its own tab, and pings you with results. A real-world gate hook hol…

    • Connects to: Slack, GitHub
    • Asks first
    • On demand· usage when run
    • Checked 5 Nov
  • Connector Scope Check

    Before connecting Gmail, Drive, Stripe, GitHub, or calendar to a Grok Bot (or right after Adding a marketplace template), run a minimum-scope checklist and return CLEAR or NEEDS ACTI…

    • Connects to: Email, Calendar +1
    • Asks first
    • On demand· usage when run
    • Checked 5 Nov