NEW: Real-Time Usage Tracking for AI Agents — track Claude Code, Kimi, Codex & more. Try it free →

CostGoat Logo

CostGoat

LAST UPDATED: MAY 21, 2026

Grok API Pricing Calculator & Complete Cost Guide

Calculate Grok API costs for the current xAI lineup per token and per month. Compare Grok 4.3, Grok 4.20 (reasoning, non-reasoning, multi-agent), and Grok Build 0.1 with cached input pricing.

CalculatorPricing GuideExamplesSave MoneyFAQ

Pricing TLDR

  • Prepaid credits or monthly invoiced billing (no subscription)
  • Grok 4.3 (flagship) & Grok 4.20 family: $1.25/$0.20 cached/$2.50 per M tokens • Grok Build 0.1 (coding): $1.00/$2.00
  • Cached input ~85% off • 1M-2M context windows • Built-in web, X, code, file search tools

Official pricing:

xAI

Quality Scores: Theozard

Grok API Cost Calculator - Monthly Pricing

Calculate by

Input Tokens

Output Tokens

API Calls / Month

Quick Examples:

Reasoning Options:

Grok 4.3 (grok-4.3)

Context

1M

Quality

88

Per 1M Tokens

In: $1.25

Out: $2.50

Monthly Cost

$2.50

Grok 4.20 (Reasoning) (grok-4.20-0309-reasoning)

Context

1M

Quality

80

Per 1M Tokens

In: $1.25

Out: $2.50

Monthly Cost

$2.50

Grok 4.20 (Non-Reasoning) (grok-4.20-0309-non-reasoning)

Context

1M

Quality

49

Per 1M Tokens

In: $1.25

Out: $2.50

Monthly Cost

$2.50

Grok Build 0.1 (grok-build-0.1)

Context

256K

Quality

48

Per 1M Tokens

In: $1.00

Out: $2.00

Monthly Cost

$2.00

Grok 4.20 Multi-Agent Beta (grok-4.20-multi-agent-0309)

Context

2M

Quality

-

Per 1M Tokens

In: $1.25

Out: $2.50

Monthly Cost

$2.50

Tracking your xAI Grok spending?

Monitor your Grok API usage and costs in real-time.

Try free for 7 daysLearn more →

Privacy-first desktop app. No sign-up required.

CostGoat desktop app showing AI agent quotas, usage costs, credit balances, and subscriptions

About Grok API

What is Grok API?

The Grok API provides programmatic access to xAI's Grok models. The current flagship is Grok 4.3 (quality 88) with 1M context and configurable reasoning effort. The Grok 4.20 family offers reasoning, non-reasoning, and multi-agent (2M context) variants at the same per-token price, and Grok Build 0.1 is a cheaper coding specialist. The API includes built-in web search, X search, code execution, and file attachments.

  • Frontier Reasoning: Grok 4.3 scores 88 on quality benchmarks with configurable reasoning effort (none, low, medium, high). The Grok 4.20 (Reasoning) variant scores 80; the v2 reasoning variant scores 82. All current models include cached-input pricing at $0.20/M.
  • Large Context Windows: Grok 4.3 and Grok 4.20 (Reasoning, Non-Reasoning) support 1M-token context. Grok 4.20 Multi-Agent Beta supports 2M tokens. Grok Build 0.1 (coding) supports 256K. Requests above 200K context may carry a higher per-token rate (see xAI docs).
  • Built-in Tools & Search: Web Search and X Search at $5/1K calls, Code Execution at $5/1K, File Attachments at $10/1K, Collections Search at $2.50/1K. Image and X-video understanding are billed in tokens only.

When to Use Grok API

Start with Grok 4.3 for most use cases — quality 88 with configurable reasoning effort at $1.25/$2.50 per M tokens. Use Grok Build 0.1 for dedicated coding workloads at $1.00/$2.00. Choose Grok 4.20 Multi-Agent Beta when you need the 2M context window for long-document or orchestration workloads.

Ideal for

  • Real-time information retrieval with built-in web and X search
  • Complex reasoning at frontier quality with Grok 4.3
  • Long document analysis with 1M-2M context windows
  • Agentic workflows with tool calling and configurable reasoning effort
  • Dedicated coding workloads on Grok Build 0.1

Not ideal for

  • Applications requiring <100ms latency
  • Use cases needing guaranteed deterministic outputs
  • Tasks requiring specialized domain knowledge without context
  • Regions where xAI API is not available

Grok API Pricing Breakdown

Billing Options

xAI offers flexible billing with prepaid credits or monthly invoiced billing. Promotional credits may be available for new users and are applied before prepaid credits.

  • Sign up at console.x.ai to get started
  • Prepaid credits - buy in advance, deducted as you use
  • Monthly invoiced billing - pay at end of month (requires setting spending limit)
  • Promotional/free credits applied first when available

Included Features

Cached Input ($0.20/M)

Repeated context is billed at $0.20/M tokens across the current Grok 4.3 / 4.20 / Build 0.1 lineup — roughly 85% off the cache-miss input rate ($1.25/M or $1.00/M). Caching is automatic; cached usage is visible in the API response 'usage' object.

Server-Side Tools

Web Search and X Search at $5/1K calls, Code Execution at $5/1K, File Attachments at $10/1K, Collections Search at $2.50/1K. Image understanding and X-video understanding are billed in tokens only. Remote MCP tools have no per-call surcharge.

Regional Endpoints

Access API through us-east-1 (US) or eu-west-1 (Europe) endpoints for data residency requirements. Both regions offer the same models and pricing.

OpenAI-Compatible API

Grok API is compatible with OpenAI's API format, making migration easy. Simply update your base URL and API key to switch providers.

Grok API Tools Pricing

Tool

Web Search

Cost per 1,000 Calls

$5.00

Description

Internet search and page browsing

Tool

X Search

Cost per 1,000 Calls

$5.00

Description

X posts, users, and threads

Tool

Code Execution

Cost per 1,000 Calls

$5.00

Description

Python code execution environment

Tool

File Attachments

Cost per 1,000 Calls

$10.00

Description

Search uploaded files (attachment_search)

Tool

Collections Search

Cost per 1,000 Calls

$2.50

Description

RAG / knowledge base search

Tool

Image Understanding

Cost per 1,000 Calls

Token-based

Description

view_image: images returned by search tools (token cost only)

Tool

X Video Understanding

Cost per 1,000 Calls

Token-based

Description

view_x_video: videos found via X search (token cost only)

Tool

Remote MCP Tools

Cost per 1,000 Calls

Token-based

Description

Custom MCP tools (token cost only)

Note: File storage is billed at $0.025/GiB/day, collection storage at $0.10/GiB/day, and downloads at $0.20/GiB. Usage guideline violations carry a $0.05/request fee. Requests above 200K context may incur a per-token surcharge per xAI docs.

Grok API Monthly Cost Estimates

Light Use

$10-50/mo

Personal projects

<1K requests/day

Grok 4.3 with caching

Medium Use

$50-250/mo

Small apps

1-5K requests/day

Grok 4.3 + Build 0.1 mix

Heavy Use

$250-1.5K/mo

Production apps

5-20K requests/day

Cache-heavy Grok 4.3

Enterprise

$1.5K+/mo

Large scale

20K+ requests/day

Monthly invoiced billing

6 Grok API Cost Optimization Tips

1

Use Grok 4.3 by Default

Grok 4.3 is the current flagship at quality 88 and $1.25/$2.50 per M tokens — the best Grok quality-to-cost ratio. All legacy aliases (Grok 4, Grok 4 Fast, Grok 4.1 Fast, Grok 3, Grok 3 Mini) now route to Grok 4.3 anyway, so just call it directly.

2

Lean on Cached Input ($0.20/M)

Cached input is billed at $0.20/M across the current lineup — roughly 85% off the $1.25/M cache-miss rate. Design prompts with consistent system messages and context to maximize cache hits; check the 'usage' object in the API response to verify cache performance.

3

Tune Reasoning Effort

Grok 4.3 supports configurable reasoning effort (none, low, medium, high). Lower effort means fewer hidden reasoning tokens billed at the output rate — a big lever for cost on workloads that don't need deep multi-step thinking.

4

Pick Grok Build 0.1 for Coding

Grok Build 0.1 is priced at $1.00/$2.00 per M tokens (20% cheaper input, 20% cheaper output than Grok 4.3) with a 256K context window optimized for software engineering tasks. Use it for IDE agents, refactors, and codegen pipelines.

5

Set Invoiced Spending Limits

Configure your invoiced spending limit at console.x.ai to prevent unexpected charges. Default is $0 which stops API access when credits run out, but setting a limit enables continuous service with end-of-month billing.

6

Monitor Token Usage

Track your consumption via the xAI Console Usage Explorer. Monitor cached vs. non-cached tokens to understand your caching efficiency and optimize prompt design accordingly.

Grok Model Selection Guide

Use Case

General Chat & Reasoning

Recommended Model

Grok 4.3

88 Quality

Monthly Cost (Est.)

~$30-200

Why This Model?

Latest flagship with configurable reasoning effort

Use Case

Code Generation

Recommended Model

Grok Build 0.1

Coding Specialist

Monthly Cost (Est.)

~$30-200

Why This Model?

Cheaper than Grok 4.3 and tuned for software engineering tasks

Use Case

Multi-Step Agents

Recommended Model

Grok 4.20 Multi-Agent Beta

2M Context

Monthly Cost (Est.)

~$50-400

Why This Model?

Built for multi-agent orchestration with 2M context

Use Case

Real-time Search

Recommended Model

Grok 4.3 + Tools

Web + X Search

Monthly Cost (Est.)

~$40-250

Why This Model?

Web Search, X Search, Code Execution at $5/1K calls

Use Case

High-Throughput Extraction

Recommended Model

Grok 4.20 (Non-Reasoning)

49 Quality

Monthly Cost (Est.)

~$20-150

Why This Model?

Same price as Grok 4.3 but skips reasoning for higher throughput

Use Case

Long Document Processing

Recommended Model

Grok 4.20 Multi-Agent Beta

2M Context

Monthly Cost (Est.)

~$30-300

Why This Model?

Largest Grok context window for long-document workloads

Start Tracking Your Grok API Spending

Monitor your xAI credit balance and Grok usage from your menubar. Alerts before you run out.

Try Free for 7 DaysLearn more →

Privacy-first desktop app. 7-day free trial, no credit card required.

CostGoat desktop app showing AI agent quotas, usage costs, credit balances, and subscriptions

Grok API Pricing FAQ

Common questions about Grok API costs, billing, and optimization

AI Pricing

Gemini API PricingClaude API PricingGoogle Veo PricingAI Cost CalculatorsReplicate API PricingOpenRouter API PricingOpenRouter Free Models
DownloadsPricingDashboardContactIssuesAffiliatesTermsPrivacy

© 2026 CostGoat. All rights reserved.

Made by Functioncraft: Redis GUI Client · SSH GUI Client

Affiliate disclosure: Some links earn CostGoat a commission or credit when you sign up — no extra cost to you.