xAI: grok-4
grok-4 is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
Call Grok models with the OpenAI SDK and share one balance across every model.
Live prices next to the official list price
grok-4 is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
grok-4-20-non-reasoning is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
grok-4-20-reasoning is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
grok-4.3 is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
Grok 4.5 is xAI's frontier model for coding, agents and knowledge work, trained with expanded science, engineering and maths data.
Grok 4.6 builds on Grok 4.5 with a focus on long-running agents and more ambitious interactive and visual work.
Grok 4.7 is xAI's latest frontier model for coding, agent tasks and knowledge work.
grok-build-0.1 is a text and chat model from xAI, available through one freeaiapi.ai API key and billed from your prepaid balance.
Change the base URL and key — nothing else
curl https://api.freeaiapi.ai/v1/chat/completions \
-H "Authorization: Bearer $FREEAIAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.freeaiapi.ai/v1",
api_key="YOUR_FREEAIAPI_KEY",
)
response = client.chat.completions.create(
model="grok-4",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.freeaiapi.ai/v1",
apiKey: process.env.FREEAIAPI_KEY,
});
const response = await client.chat.completions.create({
model: "grok-4",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);No. freeaiapi.ai is an independent API gateway. You get one OpenAI-compatible key that routes to xAI and other models, billed from a prepaid balance.
No. Sign up, connect Telegram and join our channel to unlock $1 trial credit. Create an API key and make your first request. Add funds when you want to keep going.
Yes. Point any OpenAI SDK or OpenAI-compatible tool at https://api.freeaiapi.ai/v1 and use your freeaiapi.ai key. No code changes beyond the base URL and key.
No card required. One key for every model, up to 30% below official pricing.
Not affiliated with xAI. Grok is a trademark of xAI.