Quickstart
Make your first request to the freeaiapi.ai API in under a minute.
freeaiapi.ai is an OpenAI-compatible API for GPT, Claude, Gemini, DeepSeek, Qwen and more. One key, one prepaid balance, every model.
1. Get an API key
Create a free account — no credit card required. In Profile, connect Telegram and join our channel to unlock $1 trial credit. Then open API Keys in the console and create a key.
2. Set the base URL
Use this base URL with any OpenAI SDK or OpenAI-compatible tool:
https://api.freeaiapi.ai/v13. Send a request
curl https://api.freeaiapi.ai/v1/chat/completions \
-H "Authorization: Bearer $FREEAIAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"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="gpt-4o-mini",
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: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Streaming works the same way: pass stream: true. We recommend it for long prompts and long answers: the first words arrive in a few seconds instead of after the whole reply is written, and long requests are less likely to hit client timeouts.
Next steps
- Pick a model from the model list and use its ID as
model. - See Billing for how requests are charged.
- Using a coding agent? See Claude Code, OpenCode, Cline and more.