{T}
TokenMath.net
Official Provider HubSan Francisco, CA, USA

xAI API Pricing & Token Economics

xAI develops the Grok model family (Grok 2 and Grok 2 mini). Built for extreme mathematical reasoning, real-time web awareness, and coding workflows, xAI APIs feature 131k token context windows, standard 50% batch discounts, and compatibility with OpenAI SDK specifications.

Prompt Caching Policy

Batch / Asynchronous Rules

Standard API execution rules. Refer to individual endpoint rate limits for asynchronous processing.

Special Billing Conditions

Zero write fees on standard prefix evaluation; automatic cache invalidation.

Active xAI Models(2 models verified)

All 30 Models →
ModelContextInput / 1MCached / 1MOutput / 1MBatch DiscountActions
Grok 2
grok-2
128k$2.00$10.00N/ASpecs →
Grok 2 mini
grok-2-mini
128k$0.20$1.00N/ASpecs →

Calculate your monthly xAI bill

Simulate prompt caching hit rates, batch discounts, and output token costs with zero server logging.

Open Cost Calculator →