Free.ai API

One API key. Every AI tool. Simple token billing.

Ibikorwa

1
Urufunguzo

Hanyuma Urufunguzo

2
Akadomo

Chat, images, TTS, STT, music, translation - all one API

3
in

Impuzandengo..

Gutangira

# Chat with AI
curl -X POST https://api.free.ai/v1/chat/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [{"role": "user", "content": "Hello!"}],
    "model": "qwen7b"
  }'

# Generate an image — self-hosted (free within daily allowance)
curl -X POST https://api.free.ai/v1/image/generate/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A sunset over mountains", "model": "sdxl"}'

# Generate with a premium model (paid tokens only — FLUX Kontext, Seedream,
# Ideogram, Nano Banana, Gemini 3 Pro, etc.). Full list at /v1/providers.
curl -X POST https://api.free.ai/v1/image/generate/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A sunset over mountains", "model": "premium/flux-pro/kontext"}'

# Generate a video (premium)
curl -X POST https://api.free.ai/v1/video/generate/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A cat running in slow motion", "duration": 5, "model": "premium/kling-video/v2.6/pro/text-to-video"}'

# Text to speech
curl -X POST https://api.free.ai/v1/tts/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world", "voice": "default", "model": "kokoro"}'

# Translate text
curl -X POST https://api.free.ai/v1/translate/ \
  -H "Authorization: Bearer sk-free-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world", "target": "es"}'
import requests

API_KEY = "sk-free-YOUR_KEY"
BASE = "https://api.free.ai"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

# Chat
r = requests.post(f"{BASE}/v1/chat/", headers=HEADERS, json={
    "messages": [{"role": "user", "content": "Hello!"}],
    "model": "qwen7b"  # or "openai/gpt-4o", "anthropic/claude-sonnet-4", etc.
})
print(r.json()["choices"][0]["message"]["content"])

# Generate image — self-hosted (free within daily allowance)
r = requests.post(f"{BASE}/v1/image/generate/", headers=HEADERS, json={
    "prompt": "A sunset over mountains",
    "model": "sdxl",  # or "premium/flux-pro/kontext" for paid tier
    "aspect_ratio": "16:9"
})
print(r.json()["image_url"])

# Generate video (premium — see /v1/providers for the full list)
r = requests.post(f"{BASE}/v1/video/generate/", headers=HEADERS, json={
    "prompt": "A cat running in slow motion",
    "duration": 5,
    "model": "premium/kling-video/v2.6/pro/text-to-video"
})
print(r.json()["video_url"])

# Text to speech
r = requests.post(f"{BASE}/v1/tts/", headers=HEADERS, json={
    "text": "Hello world",
    "model": "kokoro",
    "voice": "af_heart"
})
print(r.json()["audio_url"])

# Transcribe audio
r = requests.post(f"{BASE}/v1/stt/transcribe/", headers=HEADERS, json={
    "url": "https://example.com/audio.mp3",
    "model": "whisper"
})
print(r.json()["text"])
const API_KEY = "sk-free-YOUR_KEY";
const BASE = "https://api.free.ai";

// Chat
const chat = await fetch(`${BASE}/v1/chat/`, {
  method: "POST",
  headers: { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [{ role: "user", content: "Hello!" }],
    model: "qwen7b"
  })
});
const data = await chat.json();
console.log(data.choices[0].message.content);

// Generate image — self-hosted (free within daily allowance)
const img = await fetch(`${BASE}/v1/image/generate/`, {
  method: "POST",
  headers: { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ prompt: "A sunset over mountains", model: "sdxl" })
});

// Premium image model (paid tokens) — full list at /v1/providers
const imgPro = await fetch(`${BASE}/v1/image/generate/`, {
  method: "POST",
  headers: { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ prompt: "A sunset over mountains", model: "premium/flux-pro/kontext" })
});
console.log((await img.json()).image_url);

Igaragazambere ry'ibara

Everything costs tokens. One balance for all tools. Same pricing whether you use the API or the website.

Imiterere y' Inyandiko Bito
IshushoUbwoko bw'agakandishoIgihe cyarenze:Inyandiko y'Iyemererakoresha
Qwen 2.5Chat/Write/CodeIyinjiza Ibisohoka0
FLUX.2 KleinIshusho5,000 tokens/image0
0Kuri1. 4 Inyuguti0
0Kuri UmwandikoISEGONDA ByaMIT
0Itangira...2.0000
0IhinduramikorereByakoreshejwe0
0IshushoIshushoBSD
Ibara:Gukuraho...Ishusho0
0Videwo...30,000 tokens/video0
Stem Separator (Mel-Band RoFormer + SCNet)GutandukanyaIbyinjijweMIT + Apache-2.0
Ishusho y'imbere 579 models

Access GPT-6, Claude, Gemini, Llama, DeepSeek and the rest of the 579 models. Token cost is based on provider pricing converted to our tokens.

IshushoItangaUbutumwaIbisobanuro
0Gufungura~20Byihuta
0Google~15Byihuta
00~10Agaciro
00~30Igaragazambere ry'inyandiko
0Meta~25Gufungura
0Ibara:~400Ubwiza
0Gufungura~325Ubwiza
QwenAlibaba~40,

Full list of 579 models at /models/. All use the same /v1/chat/ endpoint - just change the model parameter.

Inzira

Urugero: You pay the exact tokens used. No markup.

Imisusire y'imbere our_tokens = provider_usd_cost × 100,000 × 1.30

Example: GPT-4o costs $0.0025 per 1K prompt tokens. For 1,000 tokens: $0.0025 × 100,000 × 1.30 = Amatoke Kuva:

Amadosiye yose

Chat / LLM
POST /v1/chat/Chat Na: Icyo ari cyo cyose Urugero Cyangwa external
Ishusho
POST /v1/image/generate/Text to image (FLUX, SDXL)
POST /v1/image/edit/Imisusire
POST /v1/image/enhance/Upscale 2x/4x (Real-ESRGAN)
POST /v1/image/remove-bg/Mbuganyuma
Video
POST /v1/video/generate/Text/image to video (CogVideoX)
Kuri
POST /v1/tts/Generate speech (Kokoro, Piper, MeloTTS, Chatterbox)
POST /v1/tts/stream/Streaming TTS (real-time audio chunks)
Kuri Umwandiko
POST /v1/stt/transcribe/Transcribe audio/video (faster-whisper, 99 languages)
& Audio
POST /v1/music/generate/Bivuye Umwandiko Ibisobanuro
POST /v1/music/separate/Separate vocals/stems (Mel-Band RoFormer + SCNet)
Umwandiko
POST /v1/write/Ibigize (Imeli,,)
POST /v1/code/generate/Inyandikoporogaramu in Icyo ari cyo cyose Ururimi
POST /v1/summarize/Umwandiko
POST /v1/humanize/Umwandiko Ijwi
POST /v1/detect/Ibigize
Guhindura Inyandiko
POST /v1/translate/Translate text (MadLAD-400, 450+ languages)
POST /v1/ocr/Umwandiko Bivuye Ishusho
Ibintu
GET /v1/modelsList all available models (self-hosted + external)
GET /v1/status/{job_id}/Imimerere Bya Ibikorwa
GET /healthAPI health check

Igaragazambere ry'Inyandiko

Urufunguzo in i Inyandikoporogaramu Inyandikoporogaramu Umutwempangano

Authorization: Bearer sk-free-YOUR_API_KEY

A Inyandikoporogaramu Inyandikoporogaramu Funga Byakoreshejwe

{
  "choices": [...],
  "free_ai_usage": {
    "tokens_used": 142,      // actual tokens processed
    "tokens_charged": 142,   // tokens deducted from your balance
    "source": "self_hosted", // or "external"
    "model": "qwen7b"
  }
}

Imiterere y' Ipaji

Same token pricing on the website and API. No separate API pricing.

Igenzura ry'InyandikoUkweziIgihe cyarenze:Agaciro:
Bitari ngombwa30K/day (pool)10$0
Bisanzwe250K30ukwezi
Igaragazambere:1.25M60Ukwezi
Ibikorwa6.25M120Ukwezi
ItsindaKugenaKugenaUmuntu

Token packs available: 200K/$5, 1M/$15, 5M/$40. Tokens never expire.

& CLI

SDK

buri Ibikoresho Kuva: Inyandikoporogaramu.

pip install free-dot-ai
from freeai import FreeAI

ai = FreeAI(api_key="sk-free-xxx")

# Chat
response = ai.chat("What is Python?")
print(response.text)

# Image generation
image = ai.image("A sunset over mountains")
image.save("sunset.png")

# Text to speech
audio = ai.tts("Hello world", voice="af_heart")
audio.save("hello.mp3")

# Translation
result = ai.translate("Hello", to="es")
print(result.text)  # "Hola"
PyPI Ibara:
Inyandikonyakwirema

Free, open-source alternative to Claude Code, Cursor, and GitHub Copilot.

pip install freeai-code
# Start a coding session
cd your-project/
free-code

# Ask about your codebase
free-code ask "How does auth work?"

# Execute a task
free-code run "Add unit tests for User model"

30K free tokens/day. BYOK supported. 579 models. Session sync with Web IDE.

PyPI Ibara: Urubuga

(Urufunguzo)

Utubuto Kuva: Icyo ari cyo cyose. Zeru Free.ai just proxies the request.

ItangaImiterere y' UrufunguzoAmadosiyeIgaragazambere
Gufungurask-proj-xxxGPT-4o, GPT-4o Mini, o1, o3,$0
Ibara:sk-ant-xxxClaude Sonnet 4, Opus 4, Haiku, etc.$0
GoogleAIzaSyxxxGemini 2.5 Pro, Flash, etc.$0
Ikindisk-or-xxx etc.579 models from all providers$0
# Python SDK with BYOK
from freeai import FreeAI

ai = FreeAI(provider="openai", api_key="sk-proj-xxx")
response = ai.chat("Hello", model="gpt-4o")

# CLI with BYOK
# free-code config set provider openai
# free-code config set api_key sk-proj-xxx

Your key, your usage, your bill. No logging. No token deductions from your Free.ai balance.

API

Konti Kubona 30K / Umunsi Birenzeho na hejuru Umubare Imipaka.

!,. Impuzandengo ni hagati i Ipaji: na., i.

Same endpoint, just change the model parameter. For example: "model": "openai/gpt-4o" or "model": "anthropic/claude-sonnet-4". Full list at /models/ or GET /v1/models.

Yes! The /v1/chat/ endpoint follows the OpenAI chat completions format. You can use any OpenAI-compatible SDK - just change the base URL to https://api.free.ai and use your Free.ai API key.

Yes! Set "stream": true in your chat request. Responses are delivered via Server-Sent Events (SSE).

You'll get a 402 response with an error message. Buy more tokens at /pricing/ or wait for your daily free pool to reset. Self-hosted models are always available within daily limits.

Yes! All self-hosted models are MIT/Apache 2.0 licensed. Generated content is yours for commercial use.

Self-hosted: runs on our GPU. Cheapest, fastest, most private. External: proxied to the model provider. Access to GPT-4, Claude, Gemini, and more. Costs more tokens due to provider API fees.

Visit your account page at /account/ or check the free_ai_usage.tokens_charged field in each API response.

Yes! Install our Python SDK: pip install free-dot-ai. It wraps every endpoint with typed responses. For coding assistance, install pip install freeai-code. The API also follows OpenAI's format, so you can use the openai Python/Node SDK with our base URL. API docs

kugirango 99.9%. Ibishushanyo Gushyiramo. / ya: Igihe Imimerere.

Email hello@free.ai or visit /contact/. Pro+ plans get priority support. Error responses include an error_id for debugging.

Free.ai? Abayobozi!

iyi Ipaji