Free.ai API
Una chiave API. Ogni strumento AI. Fatturazione semplice token.
Come funziona
Ottieni una chiave API
Acquistare gettoni, quindi generare la chiave sk-free-
Chiama qualsiasi punto finale
Chat, immagini, TTS, STT, musica, traduzione - tutte le API
Paga in token
Un solo equilibrio, ogni strumento costa dei gettoni.
Avvio rapido
# 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 taglio
Tutto costa gettoni. Un equilibrio per tutti gli strumenti. Stesso prezzo se si utilizza l'API o il sito web.
| Modello | Tipo | Costo del token | Licenza |
|---|---|---|---|
| Qwen 2.5 7B | Chat/Scrittura/Codice | Token effettivi utilizzati (input+output) | Apache 2.0 |
| FLUX.2 Klein | Generazione immagine | 5.000 gettoni/immagine | Apache 2.0 |
| Kokoro | Testo al discorso | 1 gettone per 4 char | Apache 2.0 |
| faster-whisper | Discorso al testo | 4 gettoni/secondo di audio | MIT |
| AudioLDM 2 | Generazione musicale | 2.000 gettoni/traccia | Apache 2.0 |
| MadLAD-400 | Traduzione (450+ langs) | Token utilizzati | Apache 2.0 |
| Real-ESRGAN | Rialzo immagine | 500 gettoni/immagine | BSD |
| BRIA RMBG | Rimozione di precedenti | 500 gettoni/immagine | Apache 2.0 |
| CogVideoX | Generazione video | 30,000 tokens/video | Apache 2.0 |
| Stem Separator (Mel-Band RoFormer + SCNet) | Separazione vocale | 500 gettoni/traccia | MIT + Apache-2.0 |
Accesso GPT-6, Claude, Gemini, Llama, DeepSeek e il resto dei modelli 579. Il costo del token è basato sul prezzo del provider convertito ai nostri gettoni.
| Modello | Fornitore | ~Token per messaggio | Osservazioni |
|---|---|---|---|
| GPT-4o Mini | OpenAI | ~20 | Economico, veloce |
| Gemini 2.0 Flash | ~15 | Molto veloce | |
| Mistral NemoCity name (optional, probably does not need a translation) | Mistral | ~10 | Grande valore |
| DeepSeek V3 | DeepSeek | ~30 | Forte ragionamento |
| Llama 3.3 70B | Meta | ~25 | Pesi aperti |
| Claude Sonnet 4 | Antropico | ~400 | Qualità premium |
| GPT-4o | OpenAI | ~325 | Qualità premium |
| Qwen 2.5 72B | Alibaba | ~40 | Grande, capace |
Elenco completo dei modelli 579 a /models/. Tutti usano lo stesso parametro /v1/chat/ - basta cambiare il parametro model.
Modelli auto-ospitali: Tu paghi i gettoni usati.
Modelli esterni: our_tokens = provider_usd_cost × 100,000 × 1.30
Esempio: GPT-4o costa $0.0025 per token prompt 1K. Per 1.000 token: $0.0025 × 100.000 × 1,30 = 325 gettoni dal tuo equilibrio.
Tutti i punti finali
POST /v1/chat/ | Chat con qualsiasi modello (auto-ospitato o esterno). Streaming supportato. |
POST /v1/image/generate/ | Testo all'immagine (FLUX, SDXL) |
POST /v1/image/edit/ | Inverniciatura, outpaint, trasferimento di stile |
POST /v1/image/enhance/ | Superamento 2x/4x (Real-ESRGAN) |
POST /v1/image/remove-bg/ | Rimuovi sfondo (BRIA RMBG) |
POST /v1/video/generate/ | Testo/immagine al video (CogVideoX) |
POST /v1/tts/ | Genera discorso (Kokoro, Piper, MeloTTS, Chatterbox) |
POST /v1/tts/stream/ | Streaming TTS (frammenti audio in tempo reale) |
POST /v1/stt/transcribe/ | Trascrizione audio/video (faster-whisper, 99 lingue) |
POST /v1/music/generate/ | Genera musica dalla descrizione del testo |
POST /v1/music/separate/ | Voce/stem separati (Mel-Band RoFormer + SCNet) |
POST /v1/write/ | Generare contenuti (saggi, e-mail, storia, ecc.) |
POST /v1/code/generate/ | Genera codice in qualsiasi lingua |
POST /v1/summarize/ | Riepilogo del testo |
POST /v1/humanize/ | Rendere il testo AI umano suono |
POST /v1/detect/ | Rilevare il contenuto generato dall'AI |
POST /v1/translate/ | Tradurre testo (MadLAD-400, 450+ lingue) |
POST /v1/ocr/ | Estrarre testo dalle immagini |
GET /v1/models | List all available models (self-hosted + external) |
GET /v1/status/{job_id}/ | Controlla lo stato del lavoro asincrono |
GET /health | Controllo dello stato di salute delle API |
Autenticazione
Includi la tua chiave API nell'intestazione Authorization:
Authorization: Bearer sk-free-YOUR_API_KEY
Ogni risposta include un blocco free_ai_usage che mostra i token 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 tariffa e piani
Stesso prezzo token sul sito web e API. Nessun prezzo API separato.
| Piano | Token/Mese | Richieste API/Min | Prezzo |
|---|---|---|---|
| Gratis | 30K/giorno (piscina) | 10 | $0 |
| Basic | 250K | 30 | $5/mo |
| Pro | 1.25M | 60 | 19 dollari/mo |
| Affari | 6.25M | 120 | 49$/mo |
| Impresa | Personalizzato | Personalizzato | Contatto |
Pacchetti token disponibili: 200K/$5, 1M/$15, 5M/$40. I token non scadono mai.
Python SDK & CLI
Python SDK
Accedere ad ogni strumento AI dal 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 libera e open-source a Claude Code, Cursor e Copilot GitHub.
pip install freeai-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"
Token 30K/giorno. Supportato BYOK. modelli 579. Sincronizzazione sessione con Web IDE.
PyPI PyPI IDE webBYOK (Porta la tua chiave)
Utilizzare le proprie chiavi API da qualsiasi fornitore. Zero markup, zero tasse. Free.ai presenta semplicemente la richiesta.
| Fornitore | Formato chiave | Modelli | Marcatore |
|---|---|---|---|
| OpenAI | sk-proj-xxx | GPT-4o, GPT-4o Mini, o1, o3, ecc. | $0 |
| Antropico | sk-ant-xxx | Claude Sonnet 4, Opus 4, Haiku, ecc. | $0 |
AIzaSyxxx | Gemini 2.5 Pro, Flash, ecc. | $0 | |
| Altri fornitori | sk-or-xxx etc. | modelli 579 da tutti i fornitori | $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
La tua chiave, il tuo utilizzo, la tua fattura. Nessuna registrazione. Nessuna deduzione token dal tuo Free.ai saldo.
FAQ API
"model": "openai/gpt-4o" o "model": "anthropic/claude-sonnet-4". Elenco completo in /models/ o GET /v1/models."stream": true nella richiesta di chat. Le risposte vengono fornite tramite server-inviato eventi (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