NEW: 50+ real-time integrations - track Claude, OpenAI, AWS, OpenRouter & more. Try it free →

CostGoat Logo

CostGoat

LAST UPDATED: AUGUST 2, 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.5, 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.5 (flagship): $2.00/$0.30 cached/$6.00 per M tokens • Grok 4.3 & 4.20 family: $1.25/$0.20 cached/$2.50 • Grok Build 0.1 (coding): $1.00/$2.00
  • Cached input ~85% off • up to 1M context • 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.5 (grok-4.5)

Context

500K

Quality

89

Per 1M Tokens

In: $2.00

Out: $6.00

Monthly Cost

$5.00

Grok Build 0.1 (grok-build-0.1)

Context

256K

Quality

66

Per 1M Tokens

In: $1.00

Out: $2.00

Monthly Cost

$2.00

Grok 4.3 (grok-4.3)

Context

1M

Quality

62

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

60

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

-

Per 1M Tokens

In: $1.25

Out: $2.50

Monthly Cost

$2.50

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

Context

1M

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.

7-day free trial, no credit card 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.5, the top-quality model in the lineup, with a 500K context window and configurable reasoning effort. Grok 4.3 and the Grok 4.20 family (reasoning, non-reasoning, and multi-agent variants) sit a tier below at a lower per-token price, and Grok Build 0.1 is a cheaper coding specialist that scores above Grok 4.3 on quality. The API includes built-in web search, X search, code execution, and file attachments.

  • Frontier Reasoning: Grok 4.5 is the top-quality Grok model, with configurable reasoning effort (none, low, medium, high). Grok 4.3 and the Grok 4.20 reasoning variants sit a tier below, and Grok Build 0.1 edges out Grok 4.3 on quality. Every current model supports cached-input pricing, billed well below the standard input rate.
  • Large Context Windows: Grok 4.3 and the Grok 4.20 variants (reasoning, non-reasoning, multi-agent) support a 1M-token context window. Grok 4.5 supports 500K and Grok Build 0.1 (coding) supports 256K. Requests at or above 200K tokens bill at higher long-context rates (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.5 for most use cases, the top-quality Grok model with configurable reasoning effort at $2.00/$6.00 per M tokens. Drop to Grok 4.3 or the Grok 4.20 family to cut cost at $1.25/$2.50. Use Grok Build 0.1 for dedicated coding workloads at $1.00/$2.00, where it beats Grok 4.3 on quality for less. Choose Grok 4.20 Multi-Agent Beta for multi-agent orchestration workloads.

Ideal for

  • Real-time information retrieval with built-in web and X search
  • Complex reasoning at frontier quality with Grok 4.5
  • Long document analysis with up to 1M 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

Repeated context is billed at a steep discount to the standard input rate: $0.20/M on Grok 4.3, the Grok 4.20 family, and Grok Build 0.1, and $0.30/M on Grok 4.5, roughly 85% off the cache-miss rate. 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

Default to Grok 4.3 for Cost

Grok 4.3 gives you solid quality at $1.25/$2.50 per M tokens, well below the Grok 4.5 flagship ($2.00/$6.00). Reach for Grok 4.5 only when you need the top-quality model. Legacy aliases (Grok 4, Grok 4 Fast, Grok 4.1 Fast, Grok 3, Grok 3 Mini) route to Grok 4.3, so you can call it directly.

2

Lean on Cached Input

Cached input runs roughly 85% below the cache-miss rate on every current model: $0.20/M on Grok 4.3, the Grok 4.20 family, and Grok Build 0.1, and $0.30/M on Grok 4.5. 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.5 and Grok 4.3 support 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 than Grok 4.3 on both input and output) with a 256K context window optimized for software engineering, and it now scores above Grok 4.3 on quality. 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.5

Top Quality

Monthly Cost (Est.)

~$50-350

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, higher quality, and tuned for software engineering

Use Case

Multi-Step Agents

Recommended Model

Grok 4.20 Multi-Agent Beta

1M Context

Monthly Cost (Est.)

~$50-400

Why This Model?

Built for multi-agent orchestration across a 1M context window

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)

Non-Reasoning

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

1M Context

Monthly Cost (Est.)

~$30-300

Why This Model?

Full 1M 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.

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.