Free.ai API
Una chiave API. Ogni strumentu AI. Fatturazione token simplice.
Comu funziona
Otteni una chiave API
Acquista i token, poi genera a to chiave sk-free-
Chiama ogni puntu finali
Chat, immagini, TTS, STT, musica, traduzione: tutti una API
Pagà in tokens
Un equilibriu. Ogni strumentu costa tokens. Semplice.
Avviamentu rapidu
# 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);
Prezzi di token
Tuttu costa tokens. Un equilibriu per tutti i strumenti. Stessu prezzu se si usa l'API o u situ web.
| Modellu | Tipu | Costu di token | Licenza |
|---|---|---|---|
| Qwen 3.6 35B | Chat/Write/Code | Tokens effettivi usati (input+output) | Apache 2.0 |
| FLUX.2 Picculu | Generazzioni di l'imaggini | 5,000 tokens/image | Apache 2.0 |
| Kokoro | Testu à vuci | 1 token per 4 caratteri | Apache 2.0 |
| faster-whisper | Di vuci a testu | 4 tokens/second of audio | MIT |
| AudioLDM 2 | Generazzioni di musica | 2,000 tokens/track | Apache 2.0 |
| MadLAD-400 | Traduzzioni (450+ lang) | Tokens attuali usati | Apache 2.0 |
| Real-ESRGAN | Aumentu di scala di l'imàgini | 500 tokens/image | BSD |
| BRIA RMBG | Rimuzzioni di sfondo | 500 tokens/image | Apache 2.0 |
| CogVideoX | Generazzioni video | 30,000 tokens/video | Apache 2.0 |
| Stem Separator (Mel-Band RoFormer + SCNet) | Siparazzioni vocali | 500 tokens/track | MIT + Apache-2.0 |
Accede GPT-6, Claude, Gemini, Llama, DeepSeek è u restu di i mudelli 575. U costu di u token hè basatu nantu à i prezzi di u fornitore cunvertiti in i nostri token.
| Modellu | Furnituri | ~ Tokens per message (500 in, 300 out) |
|---|---|---|
| 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.
Modelli auto-ospitati: Paghi li token usati esatti. Nisun marcatu.
Modelli esterni: our_tokens = provider_usd_cost × 750,000 × 1.5
Esempiu: GPT-4o costa $0.0025 per 1,000 tokens prompt, cusì 1,000 prompt tokens costa $0.0025 x 750,000 x 1.5 = 2,812 tokens da u vostru saldu.
U markup 1.5 hè u tassu standard. I cunti cù una spesa mensili alta paganu unu più bassu.
Tutti li punti finali
POST /v1/chat/ | Chat cù qualsiasi mudellu (auto-ospitatu o esternu). Streaming supportatu. |
POST /v1/image/generate/ | Testu a l'imàgini (FLUX, SDXL) |
POST /v1/image/edit/ | Inpiinta, outpiinta, trasferimentu di stili |
POST /v1/image/enhance/ | Aumentu di scala 2x/4x (Real-ESRGAN) |
POST /v1/image/remove-bg/ | Rimuvi u sfondo (BRIA RMBG) |
POST /v1/video/generate/ | Testu/imaggini a video (CogVideoX) |
POST /v1/tts/ | Generazione di parlatu (Kokoro, Piper, MeloTTS, Chatterbox) |
POST /v1/tts/stream/ | Streaming TTS (pezzi audio in tempu reale) |
POST /v1/stt/transcribe/ | Trascrivi audio/video (faster-whisper, 99 lingue) |
POST /v1/music/generate/ | Genera musica di a discrizzioni di testu |
POST /v1/music/separate/ | Separate e vocali/i stemmi (Mel-Band RoFormer + SCNet) |
POST /v1/write/ | Generà u cuntenutu (saggiu, email, storia, ecc.) |
POST /v1/code/generate/ | Generate u codice in ogni lingua |
POST /v1/summarize/ | Riassumi lu testu |
POST /v1/humanize/ | Faci ca lu testu di l'IA pari umanu |
POST /v1/detect/ | Rileva u cuntenutu generatu da l'IA |
POST /v1/embeddings/ | Text embeddings: BGE-M3 by default, or "model": "embeddinggemma-2" for EmbeddingGemma 2 (768 dims, dimensions 128 to 768, input_type query or document) |
POST /v1/translate/ | Traduci testu (MadLAD-400, 450 + lingue) |
POST /v1/ocr/ | Estràggiu testu di l'imaggini |
GET /v1/models | List all available models (self-hosted + external) |
GET /v1/status/{job_id}/ | Verifica lu statu di l'assincrunazzioni |
GET /health | Verifica di salute API |
Autenticazione
Includite a vostra chiave API in l'intestazione Authorization:
Authorization: Bearer sk-free-YOUR_API_KEY
Ogni risposta include un bloccu free_ai_usage chì mostra i tokens usati:
{
"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"
}
}
Limiti di tassi e piani
Stessu token prezzi nantu à u situ web è API. No API prezzi separati.
| Pianu | Tokens | Richieste API/mese | Richieste API / min | Prezzu |
|---|---|---|---|---|
| Liberu | 30,000 un ghjornu (piscina libara) | 1,000 | 60 | $0 |
| Basa | 250,000 | 10,000 | 120 | $5 a mese |
| Pro | 1,250,000 | 100,000 | 300 | $19 a mese |
| Attività | 6,250,000 | 1,000,000 | 600 | $49 a mese |
| Imprisi | Personalizzatu | 1,000,000 pi default, risoltu a richiesta | 600 pi default, risoltu a richiesta | Cuntattu |
Pacchetti di token dispunibili: 200K/$5, 1M/$15, 5M/$40. I token ùn scadenu mai.
Python SDK e CLI
Python SDK
Accedi a tutti l'uttilitati di l'IA di u vostru codice 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
Assistente di codifica CLI
Alternativa libbira e open-source a Claude Code, Cursor, e GitHub Copilot.
# 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 gratuiti/giornali. BYOK supported. 575 models. Session sync with Web IDE.
PyPI Guida à l'installazione è à a cunfigurazione. IDE webBYOK (porta a to chiavi)
Usate i vostri chiavi API di ogni fornituri. Zero markup, zero tariffi. Free.ai sulu manda lu proxy a la richiesta.
| Furnituri | Formatu di chiavi | Modelli | Marcatura |
|---|---|---|---|
| OpenAI | sk-proj-xxx | GPT-4o, GPT-4o Mini, o1, o3, ecc. | $0 |
| Antrupicu | sk-ant-xxx | Claude Sonnet 4, Opus 4, Haiku, ecc. | $0 |
AIzaSyxxx | Gemini 2.5 Pro, Flash, ecc. | $0 | |
| Altri fornituri | sk-or-xxx etc. | 575 mudelli di tutti i fornituri | $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
A vostra chiave, u vostru usu, a vostra fattura. Nisun log. Nisun token deduzioni da u vostru Free.ai saldu.
Domande Frequenti
"model": "openai/gpt-4o" o "model": "anthropic/claude-sonnet-4". A lista cumpleta si trova in /models/ o GET /v1/models."stream": true ntâ to richiesta di chat. Li risposti sunnu furniti via Server-Sent Events (SSE).free_ai_usage.tokens_charged in ogni risposta 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