xAI · Flagship

Grok 4

xai/grok-4 xAI's flagship model, accessible through Leanroute's OpenAI-compatible AI Gateway. Pay provider list price with zero per-request markup; flat $15/mo BYOK subscription covers the platform fee.

Pricing snapshot: August 2026. Re-validated monthly against the upstream xAI pricing page.

Pricing

TypeUSD per 1M tokens
Input tokens$3.00
Cached input (25% off)$2.25
Output tokens$7.50

Leanroute's markup: $0. You pay the provider list price above, plus a flat $15/mo BYOK subscription (or 5% at top-up for prepaid credits). Compare pricing at /calculator.

Capabilities

Flagship tierGlobal (US-incorporated)StreamingTool calls

Example request

curl https://api.leanroute.dev/v1/chat/completions \
  -H "Authorization: Bearer $LEANROUTE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "xai/grok-4",
    "messages": [
      { "role": "user", "content": "Hello, Grok 4!" }
    ]
  }'

OpenAI-wire-compatible — point any OpenAI SDK at api.leanroute.dev/v1 and set model: "xai/grok-4". Full endpoint reference at /docs/api.

Other xAI models

Same-tier alternatives across providers

Leanroute's router picks the cheapest same-tier model automatically when cheaper-model routing is on. Config at /dashboard/settings.

See also: Full model catalog · API reference · Savings calculator · Leanroute pricing