{T}
TokenMath.net
Verified against xAI Official API Pricing
xAIflagshipGenerally Available

Grok 2 Token Counter & Cost Calculator

xAI flagship model with real-time reasoning and computer vision capabilities

Standard Input / 1M
$2.00
Prompt tokens
Cached Input / 1M
N/A
Not supported
Output / 1M
$10.00
Generation completion
Context Window
128k
Max out: 8.2k
API & Developer Integration Details
generally available
API Model Stringgrok-2
Provider & FamilyxAI (cl100k_base)
Prompt Caching RulesNone
Long-Context TiersStandard flat rate throughout full window
First-party audit timestamp: 2026-09-15 14:30 UTCOfficial Documentation

Interactive Cost & Token Simulator for Grok 2

Live Calculation
Input Tokens2,500
Output Tokens800
Requests / Day5,000
Cost / Request$0.0130
Daily Spend (5,000 reqs)$65.00
Monthly Run-Rate (30d)$1,950.00

Standard Workload Cost Scenarios

ScenarioInput TokensOutput TokensUncached CostWith Prompt Caching
Short Chat Query1,000500$0.00700N/A
Document Summarization10,0002,000$0.0400N/A
Codebase & Context Analysis100,00020,000$0.4000N/A
Batch Corpus Processing1,000,000100,000$3.00N/A
Technical Architecture & Pricing VerificationVerified: 2026-09-15 14:30 UTC
Model ArchitectureGrok 2
Provider OrganizationxAI
Tokenizer EncodingxAI Byte-level BPE (~131k vocabulary)
API ConnectivityxAI Chat Completions API (/v1/chat/completions) with vision and tool calling support.
Batch API 50% DiscountNot Available
Tier 1 Rate Quota60 RPM · 100k TPM
Blended 3:1 Cost / 1M Tokens$4.00
Standard billing rates per million tokens. Vision inputs billed per standard image tokenization matrix.xAI Official API Pricing

Verified Pricing History

September 2026: $2/M input · $10/M output
Recorded verified xAI API rates.

When to Choose Grok 2

Ideal for production workloads demanding flagship capabilities, deep context depth (128k tokens), and reliability from xAI. Excellent when predictable tokenomics and prompt caching support are paramount.

When Another Model May Be Better

If your use-case requires sub-second streaming latency or ultra-high frequency classification at micro-cent pricing, consider lighter budget options such as Gemini Flash-Lite or Claude Haiku. For deep formal logic, consider dedicated reasoning models like o3.

Frequently Asked Questions About Grok 2

How much does 1 million tokens cost with Grok 2?

For Grok 2, 1 million input tokens costs $2.00, while 1 million output tokens costs $10.00. If using prompt caching, repetitive input prefixes are discounted to $2.00 per million.

What is the context window for Grok 2?

Grok 2 features a maximum context window of 131,072 tokens (~98,304 words), with a maximum output limit of 8,192 tokens per completion.

Which tokenizer does Grok 2 use?

Grok 2 utilizes the xAI Byte-level BPE (~131k vocabulary). Token counting on TokenMath runs client-side to ensure maximum privacy.

Does Grok 2 support prompt caching discounts?

No, Grok 2 does not currently advertise prompt caching discounts on its standard API tier.