xAI's multi-agent capable model with 2M token context window. Available in reasoning, non-reasoning, and multi-agent variants for diverse enterprise workloads.
2.0M tokens
1
available
Cheapest
xAI
$3.75/1M tokens
xAI
Sorted by total cost (input + output per 1M tokens). Click a row to view provider details.
| Provider | Pricing (per 1M) | Rate Limits | Regions | Health | Latency |
|---|---|---|---|---|---|
In: $1.25Out: $2.50 | 300 RPM / 500K TPM | us-east-1global | Healthy | 0ms |
Use this model via xAI with an OpenAI-compatible SDK.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.xai.com/v1",
apiKey: process.env.XAI_API_KEY,
});
const response = await client.chat.completions.create({
model: "grok-4.20-0309-reasoning",
messages: [
{ role: "user", content: "Hello!" }
],
});
console.log(response.choices[0].message.content);Using xAI API • OpenAI-compatible SDK