Grok API (xAI) logo

Grok API (xAI): Pricing, Features & Alternatives

The Grok API by xAI gives developers access to Grok models with real-time web search integration and per-token pricing. It is OpenAI-API-compatible, so it can drop in as a replacement for apps that need up-to-date information.

Who it’s for: Apps that need live answers from the web or X, or very long context at low output prices, from a drop-in OpenAI-style API.

Category

LLM Provider

Pricing

Pay-as-you-go

Free tier

No

Best for

LLM Provider: live web and X search, long context, OpenAI drop-in

Grok API (xAI) at a Glance

What it is
Model lab: Grok models (xAI)
Open weights
Only older models (Grok 1, Grok 2.5); current models are closed
API format
OpenAI-compatible
Free access
Pay as you go; no free tier listed
Company & data location
US company

Checked October 2026 against xAI models and pricing (xAI docs).

Grok API (xAI) Pricing Plans (2026)

PlanPrice
Pay As You GoPopularUsage-based (per token)

Pricing summary: Usage-based. Always confirm current pricing on the official site.

Key Grok API (xAI) Features

  • grok-4.7 with a 500K-token context at $2 / $6 per 1M tokens
  • grok-4.3 and grok-4.20 models with a 1M-token context at $1.25 / $2.50
  • grok-build-0.1 coding model at $1 / $2 per 1M tokens
  • Server-side Web Search and X Search tools
  • Cached input from $0.20 per 1M tokens
  • Prompts of 200K tokens or more bill at roughly double the rate

Pros

  • +Real-time web search built in
  • +OpenAI-compatible: easy migration

Cons

  • −Smaller ecosystem than OpenAI
  • −Newer: fewer community resources
  • −No free tier; pay as you go from the first call

Best Grok API (xAI) Alternatives

Compare all

Grok API (xAI) Compared

Grok API (xAI) FAQ

What is Grok API (xAI) used for?⌄

Grok API (xAI) is a llm provider tool. xAI's Grok API: real-time internet access, large context window, and competitive pricing for AI-powered apps.

Is Grok API (xAI) free?⌄

Grok API (xAI) does not offer a permanent free tier.

How much does Grok API (xAI) cost?⌄

Grok API (xAI) uses usage-based (pay-as-you-go) pricing. See the official pricing page for current rates.

What are the best Grok API (xAI) alternatives?⌄

Popular Grok API (xAI) alternatives include Google Gemini API, Mistral AI API, Groq, OpenRouter, Together AI. Compare pricing and features on our Grok API (xAI) alternatives page.

Not sure if Grok API (xAI) fits your stack?

Get a free, AI-powered tech stack tailored to your budget, app type, and team size, including the best llm provider pick for you.

Build my stack free