Models / xAI
Model vendor
xAI
xAI ships the Grok family — frontier reasoning models with real-time knowledge.
12Models routed
−0%Average vs list price
0Channels serving xAI
xAI models on MirAPI
ModelTypeContextInputOutputCache r / wOff listChannels
Migration
A drop-in replacement for the OpenAI API
We speak the OpenAI wire format: official SDKs, LangChain, agent frameworks and your own wrapper all work as-is. Change the base URL and write model IDs the catalogue way: grok-4.20 becomes x-ai/grok-4.20.
Endpoints
/v1/chat/completionsChat & tool callsimport os from openai import OpenAI client = OpenAI( base_url="https://api.mirapi.ai/v1", # changed api_key=os.environ["MIRAPI_API_KEY"], # changed ) resp = client.chat.completions.create( model="x-ai/grok-4.20", messages=[{"role": "user", "content": "Hello"}], )
import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://api.mirapi.ai/v1", // changed apiKey: process.env.MIRAPI_API_KEY, // changed }); const res = await client.chat.completions.create({ model: "x-ai/grok-4.20", messages: [{ role: "user", content: "Hello" }], });
curl https://api.mirapi.ai/v1/chat/completions \ -H "Authorization: Bearer $MIRAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "x-ai/grok-4.20", "messages": [{"role": "user", "content": "Hello"}] }'
One key covers xAI and 10 more vendors.
1M free tokens to start. No card required.