🧮 xAI Grok API Cost Calculator

Count tokens and estimate API cost across the top LLM providers — free, in your browser.

⚡ Instant estimates
🔒 Text never leaves your browser
✅ Prices verified 2026-07-11

Token counter

Paste text to count its tokens, then push the count into the calculator below.

0 tokens

Token counts for non-OpenAI providers are estimates. Newer Claude/Gemini models tokenize differently (often ~30% more).

xAI Grok cost calculator

Cost per call = input×price + output×price (cached input, where supported, is billed at the discounted cache-read rate). Monthly = cost per call × requests.

ModelCost / callCost / monthvs cheapest

xAI Grok API pricing (per 1M tokens, USD)

Model Input Cached input Output Context
Grok 4.5 $2.00 $6.00 500k
Grok 4.3 $1.25 $2.50 1,000k

Verified 2026-07-11 from xAI Grok. LLM API prices change often. These figures were verified against official pricing pages on the date above — always confirm with the provider before relying on them for budgeting.

❓ Frequently asked questions

How accurate are the token counts?

Token counts are exact for OpenAI models — we run OpenAI's o200k_base tokenizer (the same BPE used by GPT-4o/4.1/5) locally in your browser. Other providers don't publish browser-ready tokenizers, so their counts are close estimates; newer Claude and Gemini models in particular tokenize the same text into ~30% more tokens.

Is my text sent anywhere?

No. Tokenizing and cost math run entirely in your browser. Nothing you paste is uploaded or stored.

How current is the pricing?

Prices were verified on 2026-07-11 against each provider's official pricing page (linked under the table). LLM prices change often, so confirm with the provider before committing a budget.

What about cached input and batch discounts?

The calculator supports a cached-input field where the provider offers prompt-cache pricing (OpenAI, Anthropic, Gemini, DeepSeek). Batch APIs (typically ~50% off) aren't applied automatically — halve the result if you use batch.