🛒 CYBER WEEK SALE: Get lifetime for $199 (33% OFF) with code BFCM25 — ends Dec 7! Claim your deal

CostGoat Logo

CostGoat

LAST UPDATED: DECEMBER 2, 2025

Grok API Pricing Calculator & Complete Cost Guide

Calculate Grok API costs for all models per token and per month. Compare 9 active models with automatic caching and 2M context support.

CalculatorPricing GuideExamplesSave MoneyFAQ

Pricing TLDR

  • • Prepaid credits or monthly invoiced billing (no subscription)
  • • Pay-per-token: Grok 4.1 Fast ($0.20/$0.50) • Grok 4 ($3/$15) • Grok 3 ($3/$15) per million tokens
  • • Automatic prompt caching • 2M context window • Built-in web & X search tools

Official pricing:

xAI

Grok API Cost Calculator - Monthly Pricing

Calculate by

Input Tokens

Output Tokens

API Calls / Month

Quick Examples:

Reasoning Options:

Grok 4 (grok-4-0709)

Context

256K

Intelligence

65

Per 1M Tokens

In: $3.00

Out: $15.00

Monthly Cost

$10.50

Grok 4.1 Fast (grok-4-1-fast-reasoning)

Context

2M

Intelligence

64

Per 1M Tokens

In: $0.20

Out: $0.50

Monthly Cost

$0.45

Grok 4 Fast (grok-4-fast-reasoning)

Context

2M

Intelligence

60

Per 1M Tokens

In: $0.20

Out: $0.50

Monthly Cost

$0.45

Grok 3 Mini (grok-3-mini)

Context

131K

Intelligence

57

Per 1M Tokens

In: $0.30

Out: $0.50

Monthly Cost

$0.55

Grok Code Fast (grok-code-fast-1)

Context

256K

Intelligence

49

Per 1M Tokens

In: $0.20

Out: $1.50

Monthly Cost

$0.95

Grok 3 (grok-3)

Context

131K

Intelligence

45

Per 1M Tokens

In: $3.00

Out: $15.00

Monthly Cost

$10.50

Grok 4 Fast (Non-Reasoning) (grok-4-fast-non-reasoning)

Context

2M

Intelligence

39

Per 1M Tokens

In: $0.20

Out: $0.50

Monthly Cost

$0.45

Grok 4.1 Fast (Non-Reasoning) (grok-4-1-fast-non-reasoning)

Context

2M

Intelligence

38

Per 1M Tokens

In: $0.20

Out: $0.50

Monthly Cost

$0.45

Grok 2 Vision (grok-2-vision-1212)

Context

32K

Intelligence

25

Per 1M Tokens

In: $2.00

Out: $10.00

Monthly Cost

$7.00

About Grok API

What is Grok API?

The Grok API provides programmatic access to Grok, a family of AI models created by xAI. Grok 4 achieves frontier-tier performance (65 intelligence, matching o3), while Grok 4.1 Fast delivers near-frontier capability (64 intelligence) at just $0.20/$0.50 per million tokens - exceptional value. The API includes built-in web search, X (Twitter) search, and massive 2M token context windows.

  • Frontier Performance at Low Cost: Grok 4.1 Fast (Reasoning) scores 64 on intelligence benchmarks - nearly matching Grok 4 (65) and o3 - at 1/15th the price. Non-reasoning variants are significantly less capable (38-39) but faster for simple tasks.
  • Massive Context Windows: Grok 4.1 Fast and Grok 4 Fast models support 2M token context windows - among the largest available. Grok 4 supports 256K tokens, while older models support 32K-131K tokens.
  • Built-in Tools & Search: Access web search, X (Twitter) search, code execution, and document search directly through the API. Tools are priced at $2.50-$5 per 1,000 calls.

When to Use Grok API

Start with Grok 4.1 Fast (Reasoning) for most use cases - it scores 64 on benchmarks at just $0.20/$0.50 per M tokens. Reserve Grok 4 (65) for tasks requiring absolute maximum capability. Avoid non-reasoning variants unless you need high throughput on simple tasks.

Ideal for

  • Real-time information retrieval with built-in web and X search
  • Complex reasoning tasks at low cost with Grok 4.1 Fast (64 intelligence)
  • Long document analysis with 2M token context window
  • Agentic workflows with tool calling capabilities
  • Cost-sensitive production applications requiring frontier capability

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

Automatic Prompt Caching

All requests automatically benefit from prompt caching without any configuration. Repeated prompts cost less, and cached token usage is visible in the API response 'usage' object.

Server-Side Tools

Access Web Search, X Search, Code Execution, and Document Search tools at $2.50-$5 per 1,000 calls. View Image and Remote MCP tools are token-based only.

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

Document Search

Cost per 1,000 Calls

$5.00

Description

Search through uploaded files

Tool

Collections Search

Cost per 1,000 Calls

$2.50

Description

Knowledge base search

Tool

View Image / Video

Cost per 1,000 Calls

Token-based

Description

Image/video analysis (image token cost only)

Tool

Remote MCP Tools

Cost per 1,000 Calls

Token-based

Description

Custom MCP tools (token cost only)

Note: Live Search ($25/1K sources) is being deprecated December 15, 2025. Use the new agentic tool calling API instead.

Grok API Monthly Cost Estimates

Light Use

$5-30/mo

• Personal projects

• <1K requests/day

• Grok 4.1 Fast recommended

Medium Use

$30-150/mo

• Small apps

• 1-5K requests/day

• Grok 4.1 Fast or Grok 3 Mini

Heavy Use

$150-800/mo

• Production apps

• 5-20K requests/day

• Mixed models

Enterprise

$800+/mo

• Large scale

• 20K+ requests/day

• Monthly invoiced billing

6 Grok API Cost Optimization Tips

1

Use Grok 4.1 Fast (Reasoning) by Default

Grok 4.1 Fast with reasoning scores 64 on intelligence benchmarks - nearly matching Grok 4 (65) at 1/15th the price ($0.20/$0.50 vs $3/$15). It's one of the best value frontier models available.

2

Avoid Non-Reasoning for Complex Tasks

Non-reasoning variants have significantly lower capability: Grok 4.1 Fast drops from 64 to 38 intelligence. Only use non-reasoning for simple classification, extraction, or high-throughput tasks where quality matters less.

3

Use Grok 3 Mini Over Grok 3

Surprisingly, Grok 3 Mini (57 intelligence) outperforms Grok 3 (45 intelligence) in benchmarks while costing 90% less ($0.30/$0.50 vs $3/$15). Skip Grok 3 entirely unless you need its specific characteristics.

4

Batch Tool Calls Efficiently

Web Search, X Search, Code Execution, and Document Search cost $5 per 1,000 calls. Design workflows to minimize redundant tool invocations by caching results and batching related queries.

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

Customer Support Chat

Recommended Model

Grok 4.1 Fast

64 Intelligence

Monthly Cost (Est.)

~$5-30

Why This Model?

Near-frontier (64) at $0.20/$0.50 per M tokens

Use Case

Code Generation

Recommended Model

Grok 4.1 Fast

64 Intelligence

Monthly Cost (Est.)

~$10-60

Why This Model?

Higher intelligence (64) than Code Fast (49)

Use Case

Research & Analysis

Recommended Model

Grok 4

65 Intelligence

Monthly Cost (Est.)

~$100-400

Why This Model?

Frontier-tier (65), matches o3

Use Case

Real-time Search

Recommended Model

Grok 4.1 Fast + Tools

64 Intelligence

Monthly Cost (Est.)

~$15-80

Why This Model?

Built-in web & X search ($5/1K calls)

Use Case

High-Throughput Tasks

Recommended Model

Grok 4.1 Fast (Non-Reasoning)

38 Intelligence

Monthly Cost (Est.)

~$3-20

Why This Model?

Fastest for simple classification/extraction

Use Case

Long Document Processing

Recommended Model

Grok 4.1 Fast

2M Context

Monthly Cost (Est.)

~$10-50

Why This Model?

2M token context at lowest cost

Track Your LLM API Costs in Real-Time

Monitor your AI API spending across OpenAI, Anthropic, Google, and other LLM providers. CostGoat is a privacy-first desktop app that tracks usage in real-time. 7-day free trial, then $9/month.

Start Free Trial

Grok API Pricing FAQ

Common questions about Grok API costs, billing, and optimization

AWS Calculators

AWS Lambda PricingAWS Cost CalculatorsAmazon Route 53 PricingAWS NAT Gateway PricingAmazon API Gateway PricingAWS Secrets Manager Pricing
DownloadPricingDashboardContactAffiliate ProgramTermsPrivacy

© 2025 CostGoat. All rights reserved.