Developer API

Build with Free.ai — one Bearer token, 400+ AI tools.

Chat, image, video, music, voice, OCR, translate — all on a single OpenAI-compatible endpoint. Generous free pool, transparent markup, partner pricing at scale.

30,000 free tokens/day. Cards never required to start.

Single endpoint per modality

One URL handles every chat model. One URL for every image model. Pick the model with a single string. No per-provider SDK shuffle.

Honest, markup-friendly billing

Self-hosted models bill at raw cost. Premium models add a transparent markup that drops as you scale. Every response reports the exact token cost.

99 languages out of the box

Chat, translate, TTS, STT — every major modality covers 99 languages with no extra config. Pass a language code and it works.

60-second quickstart

Same API, five languages. Drop your sk-free-... key in and run.

curl https://api.free.ai/v1/chat/ \
  -H "Authorization: Bearer sk-free-YOUR-KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen2.5-7b",
    "messages": [{"role":"user","content":"Hello!"}]
  }'
import requests

r = requests.post(
    "https://api.free.ai/v1/chat/",
    headers={"Authorization": "Bearer sk-free-YOUR-KEY"},
    json={
        "model": "qwen2.5-7b",
        "messages": [{"role": "user", "content": "Hello!"}],
    },
)
print(r.json()["choices"][0]["message"]["content"])
const r = await fetch("https://api.free.ai/v1/chat/", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk-free-YOUR-KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "qwen2.5-7b",
    messages: [{role: "user", content: "Hello!"}],
  }),
});
const data = await r.json();
console.log(data.choices[0].message.content);
package main

import (
  "bytes"; "fmt"; "io"; "net/http"
)

func main() {
  body := []byte(`{"model":"qwen2.5-7b","messages":[{"role":"user","content":"Hello!"}]}`)
  req, _ := http.NewRequest("POST", "https://api.free.ai/v1/chat/", bytes.NewBuffer(body))
  req.Header.Set("Authorization", "Bearer sk-free-YOUR-KEY")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  defer resp.Body.Close()
  out, _ := io.ReadAll(resp.Body)
  fmt.Println(string(out))
}
require "net/http"
require "json"

uri = URI("https://api.free.ai/v1/chat/")
req = Net::HTTP::Post.new(uri, {
  "Authorization" => "Bearer sk-free-YOUR-KEY",
  "Content-Type"  => "application/json",
})
req.body = {
  model: "qwen2.5-7b",
  messages: [{role: "user", content: "Hello!"}],
}.to_json

res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)["choices"][0]["message"]["content"]

Pricing — discounts kick in automatically

$1 = 750,000 tokens. Self-hosted models bill at raw cost. Premium model markup drops with 30-day spend.

Free pool
30,000 / day
Web only — covers self-hosted models
Pay-as-you-go
1.50×
< $500 / 30 days
Bulk
1.30×
≥ $500 / 30 days
Partner
1.15×
≥ $2,000 / month

Full pricing breakdown →

What you can build

Embed your @handle as a chat agent

Train an AI persona on your knowledge, drop a one-line script tag on any page. Visitors chat your AI; your account picks up the cost.

Set up @yourhandle

Webhooks

Configure a signed callback for long-running jobs (video gen, batch transcription, share-link creation, low-credit alerts). HMAC-SHA256 signature in X-Free-Signature.

Set up webhooks →

FAQ

Sign up free at /signup/ — you get 10,000 tokens on confirm. Open /account/?tab=api and click Generate. Keys are Bearer tokens of the form sk-free-... and start working immediately. No application, no waitlist.

$1 buys 750,000 tokens. Self-hosted models bill the raw token count; external models add a 50% retail markup at deduction. Once you spend $500 in a 30-day window the markup drops to 30%; at $2,000+ you become a partner and the markup falls to 15%. Daily free pool: 5,000 tokens for confirmed accounts (web, not API).

API requests are governed by your purchased balance and a per-key monthly cap (defaults to 1,000 calls; raise it under /account/?tab=api). There's no per-second throttle on top — if your key has tokens and you're under the monthly cap, the request runs.

Yes. Pass stream:true on /v1/chat/ to receive Server-Sent Events. The wire format mirrors the OpenAI streaming convention so existing client SDKs work without modification.

Yes — the chat endpoint accepts a tools array per the OpenAI tool-calling schema. Models that support native tool use (Qwen 2.5 family + most premium models) will return tool_calls; models without native support fall back to a JSON-mode prompt.

Standard JSON: {error:{message, type, code}}. HTTP 402 means out of credits (response includes shortfall + an upgrade URL). HTTP 429 means daily pool exhausted on a non-API call. HTTP 400 covers validation errors with a human-readable message.

We publish freeai-code on npm + PyPI for the Coder IDE wrapper. For the raw API, the OpenAI SDKs work — point base_url at https://api.free.ai/v1 and pass your sk-free-... key. Same for Vercel AI SDK, LangChain, llamaindex, etc.

Configure your endpoint URL under /account/?tab=developer. We sign every payload with HMAC-SHA256 — the signature is in the X-Free-Signature header. Webhook events fire for: long-running job completion, share-link generation, low-credit alerts, and team invite acceptance.

We multiply the upstream cost in tokens by your tier's multiplier (1.50× retail, 1.30× bulk, 1.15× partner). Self-hosted models have no markup — you pay the raw token count. The deduction line on every response shows the exact token cost so there's no guesswork.

Free models run on our self-hosted GPU fleet (Qwen 2.5, FLUX, Whisper, Kokoro, etc.) and are covered by your daily pool. Paid models route to leading external providers — those require purchased credits and can't be paid for from the daily pool. Both share the same /v1/chat/ endpoint; pass model:premium/ to opt into a paid model.

Yes — every self-hosted model on Free.ai is open-source under permissive licenses (Apache 2.0, MIT). The model IDs we use match the upstream HuggingFace IDs, and our gpu_api repo is public. If you want our orchestration on your hardware, talk to us about a private cloud install.

Coming soon. BYOK lets you supply your own external-provider API key so calls bill against your account upstream — you skip our markup entirely on those models. Until then, the bulk + partner tiers shave the markup down for high-volume customers.

Love Free.ai? Tell your friends!

Rate this page