Free.ai API
Setsi sa API se le seng. Li-tools tsohle tsa AI. Li-token tse bonolo tsa ho lefa.
Ho sebetsa joang
Fumana konopo ea API
Reka li-token, ebe u theha konopo ea hau ea sk-free-
Ntlafatsa sebaka sa ho qetela
Chat, litšoantšo, TTS, STT,'mino, ho fetolela - tsohle API e le' ngoe
Tokela ka Tokens
Lichelete tse le 'ngoe. Likopo tsohle li theko e boima. Se bonolo.
Qetellong
# 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": "flux-schnell"}'
# 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": "flux-schnell", # 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: "flux-schnell" })
});
// 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 ngata ea tokens. Lichelete tse le 'ngoe bakeng sa lisebelisoa tsohle. Litheko tse tšoanang haeba u sebelisa API kapa sebaka sa marang-rang.
| Mofuta | _Tšebeliso: | Token | Laesense |
|---|---|---|---|
| Qwen 2.5 7B | Ho bua/Ho ngola/Kodi | Tokens e sebetsang e sebelisoang (input+output) | Apache |
| FLUX.1 e potlakileng | Boqapi ba setšoantšo | 1,000 tokens/image | Apache |
| _Tsela | Text to Speech | 1 token ka li-chars tse 4 | Apache |
| faster-whisper | Ho bua ho ea ho mongolo | 4 tokens/second ea audio | MIT |
| AudioLDM 2 | Ho theha lipina | 2,000 tokens/track | Apache |
| MadLAD-400 | Litlhaku (450+) | Token e sebetsang | Apache |
| Real-ESRGAN | Ho phahamisa setšoantšo | 500 tokens/image | BSD |
| BRIA RMBG | Ho tlosa sebaka sa morao | 500 tokens/image | Apache |
| CogVideoX | Ho theha video | 5,000 tokens/video | Apache |
| Demucs | Ho tlohela li-vowel | 500 tokens/track | MIT |
Fumana GPT-4, Claude, Gemini, Llama, DeepSeek, le 340+ li-models tse ling. Theko ea token e thehiloe ho theko ea mofani e fetotsoeng ho li-token tsa rona.
| Mofuta | Mofani | _Tlosa molaetsa | Litlhaku |
|---|---|---|---|
| GPT-4o Mini | OpenAI | ~20 | Bonyane, bo potlakileng |
| Gemini 2.0 Flash | ~15 | Ka potlako haholo | |
| Mistral Nemo | Mistral | ~10 | Boleng bo botle |
| DeepSeek V3 | DeepSeek | ~30 | Ho nahana ka matla |
| Llama 3.3 70B | Meta | ~25 | Mefuta e bulehileng |
| 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 /apps/. Li sebelisa /v1/chat/ e le 'ngoe ea ho qetela — 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/ | Ikopanye le moqapi ofe kapa ofe (o nang le mohoebi kapa oa kantle). Ho arolelana ho fanoa. |
POST /v1/image/generate/ | Tebeho ho setšoantšo (FLUX, SDXL) |
POST /v1/image/edit/ | Ho etsa kahare, ho etsa kantle, ho fetisetsa setaele |
POST /v1/image/enhance/ | Ho phahamisa 2x/4x (Real-ESRGAN) |
POST /v1/image/remove-bg/ | _Tlosa sehlooho |
POST /v1/video/generate/ | Tebe/mohlala ho video (CogVideoX) |
POST /v1/tts/ | E-ba le puo (Kokoro, Piper, MeloTTS, Chatterbox) |
POST /v1/tts/stream/ | TTS e tsamaeang (li-chunks tsa molumo ka nako e nnete) |
POST /v1/stt/transcribe/ | Ngola audio/video (ho khutlela morao, lipuo tse 99) |
POST /v1/music/generate/ | E-na le li-music ho tloha ho bopaki ba mongolo |
POST /v1/music/separate/ | Sebetsa li-voices/stems tse fapaneng (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 teko ea AI e be le molumo oa motho |
POST /v1/detect/ | Ho bona litaba tse hlahisoang ke AI |
POST /v1/translate/ | Tlosa mongolo (MadLAD-400, 450+ li-languages) |
POST /v1/ocr/ | Kopa mongolo ho tloha lifotong |
GET /v1/models | List all available models (self-hosted + external) |
GET /v1/status/{job_id}/ | Check async job status |
GET /health | Tlhahlobo ea bophelo bo botle ba API |
Bopaki
Kenye konopo ea hau ea API ka ho le letona la Authorization:
Authorization: Bearer sk-free-YOUR_API_KEY
Likarabo tsohle li kenyelletsa free_ai_usage block e bonts'ang li-token tse 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 lebelo le li-plans
Token e tšoanang ea theko ho websaeteng le API. Ha ho na API e fapaneng ea theko.
| Likarolo | Tokens/month | Lipotso tsa API/Min | Theko |
|---|---|---|---|
| _Tsela | 30K/day (pool) | 10 | $0 |
| Sehlooho | 250K | 30 | $5/month |
| Pro | 1.25M | 60 | $19/month |
| Bo_kamoso | 6.25M | 120 | $49/month |
| Enterprise | _Sebapisa | _Sebapisa | _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 kotloloho 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 ngola 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 free tokens/day. BYOK supported. 346+ models. Session sync with Web IDE.
GitHub PyPI Web IDEBYOK (Kenye konopo 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 | Gemini 2.5 Pro, Flash, jj. | $0 | |
| Bafani ba Litšebeletso | 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
Setsi sa hau, tšebeliso ea hau, lichelete tsa hau. Ha ho logging. Ha ho token deductions ho tloha ho Free.ai balance 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\