Free.ai API
Una chiave API. Ogni strumento AI. Fatturazione semplice token.
Come funziona
Ottieni una chiave API
Acquistare token, quindi generare la chiave sk-free-
Chiama qualsiasi punto finale
Chat, immagini, TTS, STT, musica, traduzione: tutto in un'unica API
Paga in token
Un solo equilibrio, ogni strumento costa dei token.
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 token. Un equilibrio per tutti gli strumenti. Stesso prezzo se si utilizza l'API o il sito web.
| Modello | Tipo | Costo del token | Licenza |
|---|---|---|---|
| Qwen 3.6 35B | Chat/Write/Code | Token effettivi utilizzati (input+output) | Apache 2.0 |
| FLUX.2 Klein | Generazione immagine | 5.000 token/immagine | Apache 2.0 |
| Kokoro | Testo al discorso | 1 token per 4 char | Apache 2.0 |
| faster-whisper | Discorso al testo | 4 token/secondo di audio | MIT |
| AudioLDM 2 | Generazione musicale | 2.000 token/traccia | Apache 2.0 |
| MadLAD-400 | Traduzione (450+ langs) | Token utilizzati | Apache 2.0 |
| Real-ESRGAN | Rialzo immagine | 500 token/immagine | BSD |
| BRIA RMBG | Rimozione di precedenti | 500 token/immagine | Apache 2.0 |
| CogVideoX | Generazione video | 30.000 token/video | Apache 2.0 |
| Stem Separator (Mel-Band RoFormer + SCNet) | Separazione vocale | 500 token/traccia | MIT + Apache-2.0 |
Accesso GPT-6, Claude, Gemini, Llama, DeepSeek e il resto dei modelli 575. Il costo del token è basato sul prezzo del provider convertito ai nostri token.
| Modello | Fornitore | ~token per messaggio (500 in, 300 in uscita) |
|---|---|---|
| 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 |
Elenco completo dei 575 modelli su /models/. Tutti usano lo stesso endpoint /v1/chat/: basta cambiare il parametro model.
Modelli auto-ospitali: Tu paghi i token usati.
Modelli esterni: our_tokens = provider_usd_cost × 750,000 × 1.5
Esempio: GPT-4o costa $0.0025 per 1,000 prompt token, quindi 1,000 prompt token costa $0.0025 x 750,000 x 1.5 = 2,812 token dal tuo saldo.
Il markup 1.5 è il tasso standard. I conti con un'alta spesa mensile pagano uno più basso.
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 del 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/embeddings/ | Inserimento testo: BGE-M3 per impostazione predefinita, o "model": "embeddinggemma-2" per l'EmbeddingGemma 2 (768 dims, dimensions 128 a 768, input_type query o documento) |
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 | Domande API/mese | Richieste API/Min | Prezzo |
|---|---|---|---|---|
| Gratis | 30,000 al giorno (pool gratuito) | 1,000 | 60 | $0 |
| Basic | 250,000 | 10,000 | 120 | $5 al mese |
| Pro | 1,250,000 | 100,000 | 300 | $19 al mese |
| Affari | 6,250,000 | 1,000,000 | 600 | $49 al mese |
| Impresa | Personalizzato | 1,000,000 per impostazione predefinita, sollevata su richiesta | 600 per impostazione predefinita, sollevata su richiesta | 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 gratuita open-source al codice Claude, al cursore e al copilota 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"
Token 30K/giorno. Supportato BYOK. modelli 575. Sincronizzazione sessione con Web IDE.
PyPI Guida all'installazione e all'installazione 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 575 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