Reviewed by Jonathan West · Updated Oct 28, 2026

Grok API Pricing: Every Model's Cost per Token

Per-token rates for six public xAI models, with the cost of 1,000 typical requests calculated from xAI's published prices.

Reviewed by Jonathan West · Updated Oct 28, 2026

The Grok API costs $2.00 per million input tokens and $6.00 per million output tokens on grok-4.7, the flagship model on xAI's pricing page. grok-build-0.1 is cheapest at $1.00 input and $2.00 output.

The xAI developer console does not list a free API tier, meaning accounts require pre-loaded credits to issue API calls.


Grok API Prices per Model

xAI charges for its API using per-token rates split across standard input, cached input, standard output, and long-context processing.

On xAI's developer pricing page, grok-4.7 and grok-4.6 share the same rate of $2.00 per million input tokens and $6.00 per million output tokens, with cached input discounted to $0.50 per million tokens.

Coding workloads using grok-build-0.1 incur $1.00 per million input tokens, $0.20 per million cached input tokens, and $2.00 per million output tokens across a 256K token context window.

Workloads using grok-4.3 or grok-4.20-0309 cost $1.25 per million input tokens, $0.20 per million cached input tokens, and $2.50 per million output tokens across their 1M token context windows.

ModelContext windowStandard input (per 1M)Cached input (per 1M)Standard output (per 1M)Long-context input (per 1M)Long-context output (per 1M)
grok-4.7500K$2.00$0.50$6.00$4.00$12.00
grok-4.6500K$2.00$0.50$6.00$4.00$12.00
grok-4.5500K$2.00$0.30$6.00$4.00$12.00
grok-build-0.1256K$1.00$0.20$2.00$2.00$4.00
grok-4.31M$1.25$0.20$2.50$2.50$5.00
grok-4.20-03091M$1.25$0.20$2.50$2.50$5.00

For model-specific detail, consult the guides on Grok 4.6 API pricing and Grok 4.5 API pricing.

  • Cached input costs 75% less than standard input on grok-4.7 and grok-4.6, 85% less on grok-4.5, 84% less on grok-4.3 and grok-4.20-0309, and 80% less on grok-build-0.1
  • Context windows range from 256K on grok-build-0.1 up to 1M on grok-4.3 and grok-4.20-0309
  • Long-context rates apply to requests exceeding 200K tokens and double standard rates across all models
  • Detailed comparison of these rates alongside other vendors appears on the AI model pricing table

What 1,000 Grok API Requests Cost

Calculated from xAI's published rates, 1,000 Grok API requests of 2,000 input and 500 output tokens cost $3.00 to $7.00, depending on the model.

The baseline request has 2,000 input and 500 output tokens, with no caching.

The formula is cost per 1,000 requests = 1,000 x (input tokens x input rate + output tokens x output rate) / 1,000,000.

At those volumes, 1,000 requests to grok-4.7 consume 2 million input tokens ($4.00) and 500,000 output tokens ($3.00), totaling $7.00 per 1,000 requests.

The xAI Batch API takes 20% off, which lowers grok-4.7 to $5.60 per 1,000 requests.

ModelStandard cost (1,000 calls)Batch API cost (20% off)Input token assumptionsOutput token assumptions
grok-4.7$7.00$5.602,000 uncached input tokens500 generated tokens
grok-4.6$7.00$5.602,000 uncached input tokens500 generated tokens
grok-4.5$7.00$5.602,000 uncached input tokens500 generated tokens
grok-4.3$3.75$3.002,000 uncached input tokens500 generated tokens
grok-4.20-0309$3.75$3.002,000 uncached input tokens500 generated tokens
grok-build-0.1$3.00$2.402,000 uncached input tokens500 generated tokens

These figures are calculated from xAI's published rates as illustrative estimates and do not represent measured benchmarks of any live production environment.

  • 1,000 typical grok-4.7 calls require $7.00 in standard credits or $5.60 via batch processing
  • grok-4.3 and grok-4.20-0309 cut standard request costs to $3.75 per 1,000 calls
  • grok-build-0.1 offers the lowest rate at $3.00 standard or $2.40 batch per 1,000 calls
  • A team running 500,000 standard calls a month on grok-4.7 would project a $3,500 monthly token bill

Extra Charges: Long Context, Priority, Regional, and Tools

xAI applies several multipliers and surcharges based on token volume, processing speed, server routing, and attached tool calls.

A cost increase occurs when a request exceeds 200K tokens. When triggered, the long-context rate bills the whole request at double the standard rate rather than just metering the excess tokens above the threshold.

Priority processing doubles standard token rates on any model.

Routing requests through a United States regional endpoint applies a 1.1x pricing multiplier on token billing.

Using external retrieval tools incurs flat per-call fees alongside standard token processing: web search calls cost $5.00 per 1,000 executions, while X Search costs $5.00 per 1,000 posts queried.

Grok 4.7 Fast, priced at $4.00 input and $12.00 output per million tokens, is available only inside Cursor and Grok Build rather than via the public API.

  • Long-context threshold: surpassing 200K tokens doubles rates across the entire request payload
  • Priority processing: doubles standard per-token costs to 2x
  • Regional routing: US regional endpoints apply an additional 10% premium (1.1x multiplier)
  • Search tools: billed at $5.00 per 1,000 calls for web search and $5.00 per 1,000 posts for X Search
  • grok-4.7 Fast: excluded from public endpoints and restricted to Cursor and Grok Build environments

Is the Grok API Free?

The Grok API is not free for standard developer accounts. On xAI's developer quickstart documentation, setting up an API key requires signing up at the xAI console and loading the account balance with paid credits.

The quickstart documentation lists no free tier, recurring free developer allowance, or trial token balance for self-serve accounts.

The primary path to zero-cost usage is the Grok for Startups program, operated by xAI under SpaceX Super Intelligence LLC (SpaceXSI).

The startup program provides a credit grant with no published dollar amount across Grok, Grok Build, Grok Bot, and the Grok API from a single balance without separate allocations. Detailed grant terms appear in the Grok for Startups guide.

xAI's FAQ says each application is checked for venture backing, a live product and a company email that matches the website. The Grok for Startups application form also asks for funding, revenue, AI spend and team size.

Under xAI's startup program terms, approved credits expire 6 months after they are applied unless the approval email says otherwise. Credits cannot pay for taxes or third-party items. xAI releases 20% at approval and the other 80% after the initial onboarding steps.

  • Self-serve API keys require loading paid credits into the xAI console before use
  • Standard documentation outlines no free credit tier or free request tier for regular developers
  • Grok for Startups grants shared credits across Grok, Grok Build, Grok Bot, and API endpoints
  • Startup credits disburse in a 20% and 80% split and expire 6 months after they are applied, unless the approval email says otherwise
  • Personal email accounts and self-funded ventures without venture capital backing do not qualify for credits

Which Grok Model to Budget For

Teams processing high-volume workloads should budget for grok-build-0.1 or grok-4.3. Grok-build-0.1 costs $1.00 input and $2.00 output per million tokens, cutting standard call expenses to $3.00 per 1,000 standard requests.

Reserve grok-4.7 where the strongest model matters at $2.00 input and $6.00 output per million tokens ($7.00 per 1,000 standard requests).

Developers running background extraction or indexing should route calls through the Batch API to capture an automatic 20% discount on all token fees.

Keep total payload sizes under 200K tokens per request whenever possible to avoid triggering the 2x long-context pricing penalty across the entire prompt and completion.

What would change these budget calculations: xAI publishing revised rates on its developer pricing page, altering token context brackets, or modifying add-on tool costs.

Estimate monthly requests and tokens per request, then pick the model from the rate table.

  • High-volume and coding automation: budget for grok-build-0.1 ($1.00 input / $2.00 output)
  • Large-context reasoning jobs: budget for grok-4.3 or grok-4.20-0309 ($1.25 input / $2.50 output)
  • Where the strongest model matters: budget for grok-4.7 ($2.00 input / $6.00 output)
  • Offline data workflows: route calls through the Batch API to lower overall token expenses by 20%
  • Prompt hygiene: monitor total tokens to prevent payloads exceeding the 200K long-context threshold

Frequently Asked Questions

  • No, the Grok API is not free for standard developers. xAI's developer quickstart requires users to create an account at the xAI console and load it with purchased credits before issuing requests. Early-stage companies can apply to Grok for Startups for credit grants if they meet venture backing and eligibility criteria.
  • Monthly costs depend entirely on token volume and model selection. Calculated from xAI's published rates, a workload averaging 2,000 input tokens and 500 output tokens costs $7.00 per 1,000 requests on grok-4.7 and $3.00 per 1,000 requests on grok-build-0.1. Scaling that baseline to 100,000 monthly requests yields an estimated monthly token spend of $700 on grok-4.7 or $300 on grok-build-0.1.
  • Yes, using the Batch API applies an automatic 20% discount to all token costs. Calculated from xAI's published rates for a 2,000 input and 500 output token request, batch processing lowers grok-4.7 from $7.00 to $5.60 per 1,000 requests. It lowers grok-build-0.1 from $3.00 to $2.40.
  • Sign up for an account at the xAI console, navigate to the API Keys section, and load credits to fund your balance. Once generated, store the key securely in an environment variable named XAI_API_KEY. For complete implementation details, review the guide on how to use Grok.
  • Grok API input rates run from $1.00 to $2.00 per million tokens, so the answer depends on which rival model you compare. Grok-build-0.1 costs $1.00 input and $2.00 output per million tokens, while grok-4.7 costs $2.00 input and $6.00 output per million tokens. To compare these figures directly against current rates from competing model providers, review the AI model pricing index.

Need help managing your AI API expenses?

Layer3Labs helps engineering and operations teams audit model usage, optimize prompt token consumption, and choose the most cost-effective architecture for production workflows.

Book a Free Audit