Free.ai API

Setsi sa API se le seng. Li-tools tsohle tsa AI. Li-token tse bonolo tsa ho lefa.

Ho sebetsa joang

1
Fumana konopo ea API

Reka li-token, ebe u theha konopo ea hau ea sk-free-

2
Ntlafatsa sebaka sa ho qetela

Chat, litšoantšo, TTS, STT,'mino, ho fetolela - tsohle API e le' ngoe

3
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.

Li-Model tse sebelitsoeng ka bomong Bonyane
Mofuta_Tšebeliso:TokenLaesense
Qwen 2.5 7BHo bua/Ho ngola/KodiTokens e sebetsang e sebelisoang (input+output)Apache
FLUX.1 e potlakilengBoqapi ba setšoantšo1,000 tokens/imageApache
_TselaText to Speech1 token ka li-chars tse 4Apache
faster-whisperHo bua ho ea ho mongolo4 tokens/second ea audioMIT
AudioLDM 2Ho theha lipina2,000 tokens/trackApache
MadLAD-400Litlhaku (450+)Token e sebetsangApache
Real-ESRGANHo phahamisa setšoantšo500 tokens/imageBSD
BRIA RMBGHo tlosa sebaka sa morao500 tokens/imageApache
CogVideoXHo theha video5,000 tokens/videoApache
DemucsHo tlohela li-vowel500 tokens/trackMIT
Li-Models tsa Kantle 346+ li-models

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.

MofutaMofani_Tlosa molaetsaLitlhaku
GPT-4o MiniOpenAI~20Bonyane, bo potlakileng
Gemini 2.0 FlashGoogle~15Ka potlako haholo
Mistral NemoMistral~10Boleng bo botle
DeepSeek V3DeepSeek~30Ho nahana ka matla
Llama 3.3 70BMeta~25Mefuta e bulehileng
Claude Sonnet 4Anthropic~400Boleng bo phahameng
GPT-4oOpenAI~325Boleng bo phahameng
Qwen 2.5 72BAlibaba~40Boholo, bo ka khonehang

Lintlha tse ling ka /apps/. Li sebelisa /v1/chat/ e le 'ngoe ea ho qetela — fetola feela model parameter.

Foromo ea Token

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

Litaba / LLM
POST /v1/chat/Ikopanye le moqapi ofe kapa ofe (o nang le mohoebi kapa oa kantle). Ho arolelana ho fanoa.
Setšoantšo
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
Video
POST /v1/video/generate/Tebe/mohlala ho video (CogVideoX)
Text to Speech
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)
Ho bua ho ea ho mongolo
POST /v1/stt/transcribe/Ngola audio/video (ho khutlela morao, lipuo tse 99)
Litšoantšo le Litšoantšo
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)
Li-tools tsa _tekano
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
Ho fetolela le ho OCR
POST /v1/translate/Tlosa mongolo (MadLAD-400, 450+ li-languages)
POST /v1/ocr/Kopa mongolo ho tloha lifotong
Litšebeletso
GET /v1/modelsList all available models (self-hosted + external)
GET /v1/status/{job_id}/Check async job status
GET /healthTlhahlobo 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.

LikaroloTokens/monthLipotso tsa API/MinTheko
_Tsela30K/day (pool)10$0
Sehlooho250K30$5/month
Pro1.25M60$19/month
Bo_kamoso6.25M120$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 IDE

BYOK (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.

MofaniBophara ba konopoLi-modelsHo beha letšoao
OpenAIsk-proj-xxxGPT-4o, GPT-4o Mini, o1, o3, jj.$0
Anthropicsk-ant-xxxClaude Sonnet 4, Opus 4, Haiku, jj.$0
GoogleAIzaSyxxxGemini 2.5 Pro, Flash, jj.$0
Bafani ba Litšebeletsosk-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

Yes! Free accounts get 30K tokens/day plus a 10K signup bonus. Paid plans offer more tokens and higher rate limits.

Ha ho joalo! Tokens e tšoanang, theko e tšoanang. The token balance ea hau e arolelanoa lipakeng tsa sebaka sa marang-rang le API. E sebelisa kapa, lefa joalo ka.

E le sebaka sa ho qetela, fetola feela parameter ea mofuta. Mohlala: "model": "openai/gpt-4o" kapa "model": "anthropic/claude-sonnet-4". Lintlha tsohle li ka fumanoa ho /apps/ kapa GET /v1/models.

E! The / v1 / chat / endpoint e latela OpenAI chat completions format. U ka sebelisa SDK efe kapa efe e lumellanang le OpenAI - fetola feela URL ea mantlha ho https://api.free.ai'me u sebelise konopo ea hau ea API ea Free.ai.

Ee! Sebelisa "stream": true ho kopo ea hau ea puisano. Likarabo li romelloa ka liketsahalo tse romelloang ke mosebeletsi (SSE).

U tla fumana karabo ea 402 le lengolo-tsoibila la bothata. Reka li-token tse ling ho /pricing/ kapa o tla tlameha ho emela hore o khutlisetse li-pool tsa hau tsa mahala tsa letsatsi le letsatsi. Li-models tse nang le tsona li ka fumaneha kamehla ka har'a li-limits tsa letsatsi le letsatsi.

E! Li-models tsohle tse sebete li na le laesense ea MIT / Apache 2.0. Lihlooho tse hlahisitsoeng ke tsa hau bakeng sa ho sebelisoa khoebong.

Self-hosted: e sebetsa ka GPU ea rona. E theko e tlaase, e potlakileng, e sa tsejoeng haholo. Kantle: e romelloa ho mofani oa mofuta. Ho fihlella GPT-4, Claude, Gemini, le ho feta. Litheko tse ngata tsa tokens ka lebaka la litefiso tsa API ea mofani.

E-ea ho leqephe la ak'haonte ea hau ho /account/ kapa sheba free_ai_usage.tokens_charged sebakeng sa karabo ea API e ngoe le e ngoe.

E! kenya Python SDK ea rona: 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\

Re batla ho 99.9% uptime. Li-plans tsa Enterprise li kenyelletsa ligaranti tsa SLA. Check /health bakeng sa boemo ba nako ea 'nete.

Email hello@free.ai kapa etela /contact/. Li-pro+ li fumana tšehetso ea bohlokoa. Likarabo tsa liphoso li kenyelletsa error_id bakeng sa ho tlosa liphoso.

U rata Free.ai? Reka le metsoalle ea hau!

Ratela leqepheng lena