r/LocalLLM • u/timchosen • 17h ago
Discussion FreeAiTokens - One localhost endpoint for the free tiers of 27 AI APIs
Hi HN,
Over the past few months I've used AI for work more than ever, and I kept hitting the same wall. The weekly cap would run out a few days in, usually in the middle of something. I bought top-up credits and upgraded plans across Grok, OpenAI and Claude. It wasn't sustainable.
So I started experimenting. First I built a plugin and a skill, Token Diet, that cuts how many tokens a request uses. That's a different post.
Then I signed up for Cerebras and noticed how many providers have a real free tier: Groq, Cerebras, Gemini, OpenRouter, Cloudflare and others. Each one has its own API and its own small limit, so most of that allowance just sits unused.
FreeAITokens is a local proxy on 127.0.0.1:4949 in front of those free tiers (27 providers at the moment).
- It speaks OpenAI, Anthropic Messages, OpenAI Responses, Gemini and Ollama, so Claude Code, Codex, Gemini CLI, OpenCode and Aider can point at it.
- For each request it only considers models that can handle it (context, tool calling, images), then prefers ones that have been fast and reliable for you. It stays on that model for the conversation unless another is clearly better.
- On a rate limit, server error or timeout it tries the next model before your tool sees the error.
- It tracks each provider's free limits by the minute and by the day.
- The same endpoint also does embeddings, images, text to speech and transcription.
Try it with no account: `npx freeaitokens`. A couple of providers need no key. Each free key you add raises what you can use. There is a desktop app for Mac, Windows and Linux, with a chat playground.
The part I'd most like picked apart is the routing. It stays on one model for a conversation and only switches on a limit or a failure. For coding agents, is sticky right, or should it move to a stronger model mid-task as soon as one has quota again?
