/docs
API reference
OpenAI-compatible chat endpoint. Every call spends tokens from your balance. Earn 1,000 per ad, up to 50 ads per day.
Models
tokenfeed-fast
Quick answers, chat, extraction
◆ 2 / call
tokenfeed-lite
Cheapest, high-volume tasks
◆ 1 / call
tokenfeed-pro
Hard reasoning and code
◆ 10 / call
tokenfeed-gpt
OpenAI GPT-5.4 mini
◆ 8 / call
Chat completions
POST https://your-app.lovable.app/api/public/v1/chat/completions
curl https://your-app.lovable.app/api/public/v1/chat/completions \
-H "Authorization: Bearer tf_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"tokenfeed-fast","messages":[{"role":"user","content":"Hello!"}]}'// JavaScript (works with the OpenAI SDK too: set baseURL)
const r = await fetch("https://your-app.lovable.app/api/public/v1/chat/completions", {
method: "POST",
headers: { Authorization: "Bearer " + process.env.TOKENFEED_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ model: "tokenfeed-pro", messages: [{ role: "user", content: "Write a haiku" }] }),
});
const data = await r.json();
console.log(data.choices[0].message.content, data.tokenfeed.remaining_credits);Errors & limits
- 401 — missing, invalid or revoked key
- 402 — not enough tokens, go watch more ads
- 429 — rate limited, retry shortly
- List models: GET /api/public/v1/models