Free.ai API
Una chiave API. Ogni strumento AI. Semplice fatturazione 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
Paga in token
Ogni strumento costa gettoni. Semplice.
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": "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);
Tariffe del token
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.1 Schnell | Generazione immagine | 1.000 gettoni/immagine | Apache 2.0 |
| KokoroCity name (optional, probably does not need a translation) | Testo al discorso | 1 gettone per 4 char | Apache 2.0 |
| più veloce sussurro | 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 effettivi utilizzati | Apache 2.0 |
| Real-ESRGAN | Riscaldamento dell'immagine | 500 gettoni/immagine | BSD |
| BRIA RMBG | Rimozione dei precedenti | 500 gettoni/immagine | Apache 2.0 |
| CogVideoX | Generazione video | 5.000 gettoni/video | Apache 2.0 |
| Demuci | Separazione vocale | 500 gettoni/traccia | MIT |
Accesso GPT-4, Claude, Gemini, Llama, DeepSeek, e 340+ più modelli. Costo token si basa sul prezzo del provider convertito ai nostri gettoni.
| Modello | Fornitore | ~Token per messaggio | Osservazioni |
|---|---|---|---|
| Mini GPT-4o | OpenAICity name (optional, probably does not need a translation) | ~20 | A buon mercato, veloce. |
| Gemini 2.0 Flash | GoogleCity name (optional, probably does not need a translation) | ~15 | Molto veloce. |
| Mistral NemoCity name (optional, probably does not need a translation) | Maestrale | ~10 | Grande valore |
| Cerca in profondità V3 | Cerca in profondità | ~30 | Forte ragionamento |
| Llama 3.3 70B | Meta | ~25 | Pesi aperti |
| Claude Sonnet 4 | Antropico | ~400 | Qualità premium |
| GPT-4o | OpenAICity name (optional, probably does not need a translation) | ~325 | Qualità premium |
| Qwen 2.5 72B | AlibabaCity name (optional, probably does not need a translation) | ~40 | Grande, capace |
Elenco completo dei modelli 346+ a
Modelli auto-ospitali: Tu paghi i gettoni usati. Modelli esterni: Esempio: GPT-4o costa $0.0025 per gettoni prompt 1K. Per 1.000 gettoni: $0.0025 × 100.000 × 1,30 = 325 gettoni dal tuo equilibrio.our_tokens = provider_usd_cost × 100,000 × 1.30
Tutti i punti finali
POST /v1/chat/ | Chiacchierare 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 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 (sussurro più veloce, 99 lingue) |
POST /v1/music/generate/ | Genera musica dalla descrizione del testo |
POST /v1/music/separate/ | Voce/stem separati (Demucs) |
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 suono umano |
POST /v1/detect/ | Rileva il contenuto generato dall'AI |
POST /v1/translate/ | Tradurre testo (MadLAD-400, 450+ lingue) |
POST /v1/ocr/ | Estrae 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 Autorizzazione:
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 token pricing sul sito web e API. Nessun prezzo API separato.
| Piano | Tokens/Mese | Richieste API/Min | Prezzo |
|---|---|---|---|
| Libero | 5K/giorno (piscina) | 10 | $0 |
| Basic | 250K | 30 | $5/mo |
| Pro | 1.25M | 60 | $19/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
Accedi ad ogni strumento AI dal tuo 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"
GitHub
PyPI
Assistente di codifica CLI
Free, open-source alternativa a Claude Code, Cursor, e 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"
5K token gratuiti al giorno. Supportato BYOK. modelli 346+. Sincronizzazione sessione con GitHub PyPI Web IDE
BYOK (Porta la tua chiave)
Utilizzare le proprie chiavi API da qualsiasi fornitore. Zero markup, zero tasse. Free.ai solo proxy la richiesta.
| Fornitore | Formato chiave | Modelli | Contrassegna |
|---|---|---|---|
| OpenAICity name (optional, probably does not need a translation) | sk-proj-xxx | GPT-4o, GPT-4o Mini, o1, o3, ecc. | $0 |
| Antropico | sk-ant-xxx | Claude Sonnet 4, Opus 4, Haiku, ecc. | $0 |
| GoogleCity name (optional, probably does not need a translation) | AIzaSyxxx | Gemini 2.5 Pro, Flash, ecc. | $0 |
| Altri fornitori | sk-or-xxx etc. | 346+ modelli di 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 saldo Free.ai.
FAQ API
"model": "openai/gpt-4o""o "model": "anthropic/claude-sonnet-4". Elenco completo in /apps/ o GET /v1/models."stream": true nella tua richiesta di chat. Le risposte vengono inviate tramite Server-Sent Events (SSE).free_ai_usage.tokens_charged in ogni risposta API.pip install free-dot-ai. Avvolge ogni endpoint con risposte digitate. Per l'assistenza di codifica, installa pip installa free-dot-ai-code. L'API segue anche OpenAI\Valuta questa pagina