Free.ai API
O cheie API, fiecare instrument de IA. Facturare simple de token.
Cum funcţionează
Obține o cheie API
Cumpără tokenuri, apoi generează cheia sk-free-
Cheamă orice punct final
Chat, imagini, TTS, STT, muzica, traducere: toate o API
Plăteşte în token
Fiecare instrument costă jetonuri.
Pornire rapidă
# 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);
Prețurile de token
Totul costă jetonuri. Un echilibru pentru toate instrumentele. Aceeași prețuri fie că utilizați API sau site-ul.
| Model | Tip | Costul de token | Licență |
|---|---|---|---|
| Qwen 3.6 35B | Chat/Write/Cod | Tokenurile reale utilizate (put+output) | Apache 2.0 |
| FLUX.2 Klein | Generare imagini | 5000 tokens/imagini | Apache 2.0 |
| Kokoro | Text la discurs | 1 token la 4 caractere | Apache 2.0 |
| faster-whisper | Discursul textului | 4 tokens/secunde de audio | MIT |
| AudioLDM 2 | Generație muzica | 2000 de tokens/traiec | Apache 2.0 |
| MadLAD-400 | Traducerea (450 + limbi) | Tokenurile reale utilizate | Apache 2.0 |
| Real-ESRGAN | Calcularea imaginii | 500 de token/imagini | BSD |
| BRIA RMBG | Înlăturarea fundalului | 500 de token/imagini | Apache 2.0 |
| CogVideoX | Generație video | 30.000 de tokens/video | Apache 2.0 |
| Stem Separator (Mel-Band RoFormer + SCNet) | Separarea vocală | 500 de tokens/trai | MIT + Apache-2.0 |
Acces GPT-6, Claude, Gemini, Llama, DeepSeek și restul modelelor 575. Costul Token se bazează pe prețurile furnizorilor convertite la tokenurile noastre.
| Model | Furnizor | ~Tokens per mesaj (500 in, 300 ieșire) |
|---|---|---|
| GPT-4o-mini | OpenAI | ~286 |
| Mistral Nemo | Mistral | ~100 |
| Llama 3.3 70B Instruct | Meta | ~639 |
| Qwen2.5 72B Instruct | Qwen | ~337 |
| DeepSeek V3 | DeepSeek | ~493 |
| GPT-4o | OpenAI | ~4,781 |
Full list of 575 models at /models/. All use the same /v1/chat/ endpoint: just change the model parameter.
Modele auto-gazdă: Tu plăteşti figurile exacte folosite.
Modele externe: our_tokens = provider_usd_cost × 750,000 × 1.5
Exemplu: GPT-4o costuri $0.0025 per 1,000 prompt jetonuri, deci 1,000 prompt jetonuri cost $0.0025 x 750,000 x 1.5 = 2,812 jetonuri de la balanța ta.
Markup 1.5 este rata standard. Conturi cu o cheltuială lunară ridicată plătesc unul mai mic.
Toate punctele finale
POST /v1/chat/ | Chat cu orice model (sau extern). |
POST /v1/image/generate/ | Text la imagine (FLUX, SDXL) |
POST /v1/image/edit/ | Retragere, dezbracărețare, transfer de stil |
POST /v1/image/enhance/ | Scalina 2x/4x (Real-ESRGAN) |
POST /v1/image/remove-bg/ | Elimină fundal (BRIA RMBG) |
POST /v1/video/generate/ | Text/imagini către video (CogVideoX) |
POST /v1/tts/ | Generează discurs (Kokoro, Piper, MeloTTS, Chatterbox) |
POST /v1/tts/stream/ | TTS de streaming (foli audio în timp real) |
POST /v1/stt/transcribe/ | Transcrie audio/video (faster-whisper, 99 de limbi) |
POST /v1/music/generate/ | Generați muzică din descrierea textului |
POST /v1/music/separate/ | Voci/stemuri separate (Mel-Band RoFormer + SCNet) |
POST /v1/write/ | Generați conținut (say, email, poveste, etc.) |
POST /v1/code/generate/ | Generați codul în orice limbă |
POST /v1/summarize/ | Reține textul |
POST /v1/humanize/ | Face textul AI sunet uman |
POST /v1/detect/ | Detectă conținut generat de IA |
POST /v1/embeddings/ | Încorporarea textului: BGE-M3 prin defect sau modelul : "includerea gemmei-2" pentru EnglobareGemma 2 (768 dim, dimensions 128 până la 768, input_type curiositate sau document) |
POST /v1/translate/ | Traduce textul (MadLAD-400, 450+ limbi) |
POST /v1/ocr/ | Extrage text din imagini |
GET /v1/models | List all available models (self-hosted + external) |
GET /v1/status/{job_id}/ | Verificați starea async job |
GET /health | Verificarea sănătății API |
Autentificare
Include cheia API în antet Authorization:
Authorization: Bearer sk-free-YOUR_API_KEY
Fiecare răspuns include un bloc free_ai_usage care prezintă tokenuri utilizate:
{
"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"
}
}
Limitele de rată și planurile
Aceeaşi preţ de token pe site-ul şi API. Nu există preţuri API separate.
| Plan | Tokens | Cereri/luna API | Cereri/Min API | Preț |
|---|---|---|---|---|
| Gratuit | 30,000 pe zi (piscină gratuită) | 1,000 | 60 | $0 |
| De bază | 250,000 | 10,000 | 120 | $5 pe lună |
| Pro | 1,250,000 | 100,000 | 300 | $19 pe lună |
| Afaceri | 6,250,000 | 1,000,000 | 600 | $49 pe lună |
| Întreprindere | Personalizat | 1,000,000 prin implicitate, ridicat la cerere | 600 prin implicitate, ridicat la cerere | Contact |
Pachete de token disponibile: 200K/$5, 1M/$15, 5M/$40. Tokens nu expiră niciodată.
Python SDK & CLI
Python SDK
Accesează fiecare instrument de IA din codul 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"
PyPI
PyPI
Asistent pentru codificare CLI
Alternativă gratuită, de sursă deschisă la codul, cursorul și Copilotul Claude GitHub.
# macOS / Linux
curl -fsSL https://free.ai/install.sh | sh
# Windows (PowerShell)
irm https://free.ai/install.ps1 | iex
# 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/zi. BYOK suportat. modele 575. Sincronizare de sesiune cu Web IDE.
PyPI Ghid de instalare și de configurare IDE webBYOK (Aduceți cheia ta)
Folosește cheile API proprii de la orice furnizor. Zero markup, zero taxe. Free.ai doar proxie cererea.
| Furnizor | Format cheie | Modele | Markup |
|---|---|---|---|
| OpenAI | sk-proj-xxx | GPT-4o, GPT-4o Mini, o1, o3, etc. | $0 |
| Antropică | sk-ant-xxx | Claude Sonnet 4, Opus 4, Haiku, etc. | $0 |
AIzaSyxxx | Gemini 2.5 Pro, Flash, etc. | $0 | |
| Alte furnizori | sk-or-xxx etc. | Modele 575 de la toate furnizorii | $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
Cheia ta, utilizarea ta, factura ta, fara log, fara deduceri de la soldul tău Free.ai.
FAQ API
"model": "openai/gpt-4o" sau "model": "antropic/claude-sonnet-4". Lista completa la /models/ sau GET /v1/models."stream": true în cererea de chat. Răspunsurile sunt livrate prin Evenimente de Sent Server (SSE).free_ai_usage.tokens_charged în fiecare răspuns API.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