LLM API
Model provider4 modelsPrivacy policy

xAI

xAI serves 4 text models on LLM API, all from xAI.

Models and prices

Prices when xAI serves the request.

Text 4

Prices per 1M tokens

Text models on xAI and their prices on LLM API
xAIGrok 4.7xai/grok-4.7$6$18$1.5500K
xAIGrok 4.6xai/grok-4.6$2$6$0.5500K
xAIGrok 4.5xai/grok-4.5$2$6$0.3500K
xAIGrok 4.3xai/grok-4.3$1.25$2.5$0.21M

Send requests to xAI

Put xai/ before a model ID and the request goes to xAI. If xAI’s uptime over the last 5 minutes is below 90%, it goes to another provider of the model, unless it sends X-No-Fallback: true. Routing docs

Example: Grok 4.7

POST /v1/chat/completionsSet LLMAPI_KEY to your LLM API key.Chat Completions docs

import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

response = client.chat.completions.create(
    model="xai/grok-4.7",
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)

Prices synced November 13, 2026.

You've been invited to LLM API

Top up $50 or more and the friend who invited you gets $20 in credits. We pay the $20; your credits stay yours. Referral terms

Sign up