Free.ai API
E 'ngoe ea li-API key. Li-AI tool tsohle. Li-token tse bonolo tsa ho lefa.
Ho sebetsa joang
Fumana konopo ea API
Reka tokens, ebe u theha konopo ea hau ea sk-free-
Tsebisa sebaka sefe kapa sefe sa ho qetela
Chat, litšoantšo, TTS, STT, molumo, ho fetolela - tsohle API e le 'ngoe
Theola ka tokens
Lichelete tse le 'ngoe. Li-token li lekoa ka li-token. E bonolo.
Qala ka potlako
# 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);
Token Pricing
Ho na le chelete e le 'ngoe bakeng sa lisebelisoa tsohle. Ho na le theko e le' ngoe haeba u sebelisa API kapa sebaka sa marang-rang.
| Mofuta | _Tš'oara | Theko ea Token | Laesense |
|---|---|---|---|
| Qwen 2.5 7B | Chat/Write/Code | Tokens e sebetsang e sebelisoang (input+output) | Apache 2.0 |
| FLUX.2 e nyane | Ho theha setšoantšo | 5,000 tokens/image | Apache 2.0 |
| Kokoro | Text ho To Speech | 1 token ka 4 chars | Apache 2.0 |
| faster-whisper | Ho bua ho ea ho Tekanyo | 4 tokens/second ea audio | MIT |
| AudioLDM 2 | Ho theha lipina | 2,000 tokens/track | Apache 2.0 |
| MadLAD-400 | Litlhaku (450+ li-langs) | Token e sebetsang e sebelisoang | Apache 2.0 |
| Real-ESRGAN | Ho phahamisa setšoantšo | 500 tokens/image | BSD |
| BRIA RMBG | Ho tlosa sehlooho | 500 tokens/image | Apache 2.0 |
| CogVideoX | Ho theha video | 5,000 tokens/video | Apache 2.0 |
| Demucs | Ho tlohela li-vocal | 500 tokens/track | MIT |
Fumana GPT-4, Claude, Gemini, Llama, DeepSeek, le li-models tse ling tse 340+ tse ling. Theko ea token e thehiloe ho theko ea mofani e fetotsoeng ho tokens tsa rona.
| Mofuta | Mofani | _Tlhahlanya lengolo-tsoibila | Litlhaku |
|---|---|---|---|
| GPT-4o Mini | OpenAI | ~20 | E potlakileng |
| Gemini 2.0 Flash | ~15 | Ka potlako haholo | |
| Mistral Nemo | Mistral | ~10 | Boholo ba boleng |
| DeepSeek V3 | DeepSeek | ~30 | Ho nahana ka matla |
| Llama 3.3 70B | Meta | ~25 | Ho bula li-weights |
| Claude Sonnet 4 | Anthropic | ~400 | Boleng bo phahameng |
| GPT-4o | OpenAI | ~325 | Boleng bo phahameng |
| Qwen 2.5 72B | Alibaba | ~40 | Boholo, bo ka khonehang |
Lintlha tse ling ka /models/. Li sebelisa /v1/chat/ endpoint e ts'oanang - fetola feela model parameter.
Litšoantšo tse nang le li-hosted: U lefa tokens e sebelisoang ka ho nepahetseng. Ha ho na ho ngolisoa.
Litšoantšo tsa kantle: our_tokens = provider_usd_cost × 100,000 × 1.30
Mohlala: GPT-4o e theko e $0.0025 ka 1K tokens. Bakeng sa 1,000 tokens: $0.0025 × 100,000 × 1.30 = 325 tokens ho tloha ho tjhelete ea hao.
Liphetho tsohle
POST /v1/chat/ | Chat le mofuta ofe kapa ofe (o bolokiloe ka boeona kapa kantle). Ho tjhaja ho tšehetsoa. |
POST /v1/image/generate/ | Tebeho ho setšoantšo (FLUX, SDXL) |
POST /v1/image/edit/ | Ho beha ka hare, ho beha kantle, ho fetisa setaele |
POST /v1/image/enhance/ | Ho phahamisa 2x/4x (Real-ESRGAN) |
POST /v1/image/remove-bg/ | Tlosa sehlooho sa morao (BRIA RMBG) |
POST /v1/video/generate/ | Tebe/'me u bone video (CogVideoX) |
POST /v1/tts/ | E-na le puo (Kokoro, Piper, MeloTTS, Chatterbox) |
POST /v1/tts/stream/ | Stream TTS (li-chunks tsa molumo oa nako e setseng) |
POST /v1/stt/transcribe/ | Ho ngola audio/video (faster-whisper, lipuo tse 99) |
POST /v1/music/generate/ | E etsa molumo ho tloha ho bopaki ba mongolo |
POST /v1/music/separate/ | Sebetsa ka ho lekola (Demucs) |
POST /v1/write/ | E etsa litaba (essay, imeile, lipale, jj) |
POST /v1/code/generate/ | E-na le khoutu ka puo efe kapa efe |
POST /v1/summarize/ | Ho arolelana mongolo |
POST /v1/humanize/ | E etsa hore tlhaloso ea AI e be le molumo oa motho |
POST /v1/detect/ | Ho bona litaba tse hlahisoang ke AI |
POST /v1/translate/ | Tlosa lifaele (MadLAD-400, 450+ languages) |
POST /v1/ocr/ | Ho tlosa mongolo ho tloha lifotong |
GET /v1/models | List all available models (self-hosted + external) |
GET /v1/status/{job_id}/ | Check state of async job |
GET /health | Tlhahlobo ea bophelo ba API |
Bopaki
Ho kenyeletsa konopo ea hau API ka Authorization header:
Authorization: Bearer sk-free-YOUR_API_KEY
Likarabo tsohle li kenyelletsa free_ai_usage block e bonts'ang tokens e sebelisoang:
{
"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"
}
}
Lipheo tsa ho kenya
Token e tšoanang theko ka websaeteng le API. Ha ho API e fapaneng theko.
| Likarolo | Tokens/month | Lipotso tsa API/Min | Theko |
|---|---|---|---|
| E le mahala | 30K/letsatsi (pool) | 10 | $0 |
| Sehlooho | 250K | 30 | $5/month |
| Pro | 1.25M | 60 | Motšeanong |
| Bo_rakhoebo | 6.25M | 120 | Motšeanong |
| Enterprise | _Sebopeho sa sehlooho: | _Sebopeho sa sehlooho: | _Ho ikopanya |
Liphutheloana tsa Token tse fumanehang: 200K/$5, 1M/$15, 5M/$40. Tokens ha li felle nako.
Python SDK & CLI
Python SDK
Fumana lisebelisoa tsohle tsa AI ho tsoa ho khoutu ea hau ea Python.
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"
GitHub
PyPI
Motsamaisi oa ho Kopa CLI
Free, open-source e fapaneng le Claude Code, Cursor, le GitHub Copilot.
pip install free-dot-ai-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 tokens/letsatsi tse mahala. BYOK e tšehelitsoe. 346+ li-models. Setsi sa ho hokahanya le Web IDE.
GitHub PyPI Web IDEBYOK (Kenya konopo ea hau ea hau)
Senya li-key tsa hau tsa API ho tsoa ho mang kapa mang ea fanang ka tsona. Zero markup, zero lichelete. Free.ai feela proxies kopo.
| Mofani | Bophara ba konopo | Li-models | Ho beha letšoao |
|---|---|---|---|
| OpenAI | sk-proj-xxx | GPT-4o, GPT-4o Mini, o1, o3, jj. | $0 |
| Anthropic | sk-ant-xxx | Claude Sonnet 4, Opus 4, Haiku, jj. | $0 |
AIzaSyxxx | Pro, Flash, jj. | $0 | |
| Li-provider tse ling | sk-or-xxx etc. | 346+ li-models ho tloha ho bafani bohle | $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
Mofuta oa hau, ho sebelisa, le lichelete tsa hau. Ha ho na ho ngola. Ha ho na ho tlosoa ha token ho tloha ho Free.ai ea hau.
Lipotso tse tloaelehileng
"model": "openai/gpt-4o" kapa "model": "anthropic/claude-sonnet-4". Lintlha tsohle li ka fumanoa ho /apps/ kapa GET /v1/models."stream": true ho kopo ea hau ea puisano. Likarabo li romelloa ka liketsahalo tse romelloang ke mosebeletsi (SSE).free_ai_usage.tokens_charged sebakeng sa karabo ea API e ngoe le e ngoe.pip install free-dot-ai. E beha liphetho tsohle ka likarabo tse ngotsoeng. Bakeng sa thuso ea ho ngola, kenya pip install free-dot-ai-code. API e latela OpenAI\