Skip to content
CheapLLM

xAI API via CheapLLM

Access 3 xAI models (Grok 4.7, Grok 4.6, Grok Build 0.1) behind one unified API endpoint with transparent per-million-token pricing, full context windows, and instant OpenAI/Anthropic SDK compatibility.

Get API key

All xAI models & pricing comparison

Prices verified 2026-11-28
ModelContextOfficial (in / out)CheapLLM (in / out)Savings
Grok 4.7500K$2.00 / $6.00$1.40 / $4.20−30%
Grok 4.6500K$2.00 / $6.00$1.40 / $4.20−30%
Grok Build 0.1256K$1.00 / $2.00$0.70 / $1.40−30%

Quickstart with xAI

Python (OpenAI SDK)
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.cheapllm.com/v1",
    api_key=os.environ["CHEAPLLM_API_KEY"],
)

response = client.chat.completions.create(
    model="x-ai/grok-4.7",
    messages=[{"role": "user", "content": "Hello!"}],
)