All use cases
Side-project chatbot
Build a free chatbot for a side project
Stream replies from anyrouter/free with the AI SDK. No credit deduction, and one model id that fails over between free models.
01
The problem
What this is for
A demo chatbot dies the day its one free model gets rate-limited, and a paid key on a public page is a bill waiting to happen.
02
What to do
Three steps, then copy
- 1.Create a key and keep it on your server. Go ($2/mo) or a donated key raises the free cap to 1,000 requests/day.
- 2.npm install @anyr/ai-sdk-provider ai, then stream with anyrouter/free.
- 3.Read the model field in the response or Dashboard → Logs to see which free model answered.
streamText
ts
import { createAnyRouter } from "@anyr/ai-sdk-provider"
import { streamText } from "ai"
const anyrouter = createAnyRouter()
const result = streamText({
model: anyrouter("anyrouter/free"),
system: "You are a friendly help bot for my project.",
prompt: "How do I reset my password?",
})
for await (const textPart of result.textStream) {
process.stdout.write(textPart)
}curl · anyrouter/free
bash
curl https://anyrouter.dev/api/v1/chat/completions \
-H "Authorization: Bearer $ANYROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anyrouter/free",
"messages": [{ "role": "user", "content": "Say hello in one sentence." }]
}'Ready to try it
The guide has the full walkthrough. Sign up if you still need a key.
Related
Next playbooks
FREE
A real free LLM API for side projects
One key, 219+ models, and a documented free tier — not a mystery coupon that disappears.
OpenOne AI SDK provider for the whole catalog
Install @anyr/ai-sdk-provider. generateText and streamText take a catalog id — including anyrouter/free.
Open$2
Unlock the free pool for $2 a month
The Go plan is $2/mo and raises free-tier access to 1,000 requests a day. Cancel any time. Donating a provider key can unlock Go without paying.
Open