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.
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.
Steps, then copy
- 1.Create a key and keep it on your server. Go ($2/mo) or a donated key gets you paid-model access.
- 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.
Next playbooks
- A real free LLM API for side projectsOne key, 271+ models, and a documented free tier — not a mystery coupon that disappears.
- One AI SDK provider for the whole catalogInstall @anyr/ai-sdk-provider. generateText and streamText take a catalog id — including anyrouter/free.
- Go: paid models from $2 a monthThe Go plan is $2/mo and adds paid-model access with a monthly credit. Free models have no daily limit on any plan. Cancel any time. Donating a provider key can unlock Go without paying.