Run Claude Code and the OpenAI SDK on free LLM tiers with FreeLLMAPI A developer released FreeLLMAPI, a self-hosted server that aggregates the free tiers of 34 LLM providers behind a single OpenAI-compatible /v1 API, with Anthropic wire-format support so Claude Code and the Anthropic SDKs can run against the pooled free quota. The router stores provider keys AES-256-GCM encrypted in SQLite, routes each request to the highest-priority healthy model, and fails over to the next provider on 429 or 5xx errors while tracking per-key usage against free-tier caps. The README claims the stacked total reaches roughly 7.4 billion tokens a month across 635 free model endpoints. Almost every AI lab now has a free tier: a few million tokens a month, a few thousand requests a day. One tier on its own is a toy. Stacked together behind one endpoint, they are enough to run side projects, experiments and even a coding agent without a bill. That is the idea behind FreeLLMAPI. tashfeenahmed/freellmapi https://github.com/tashfeenahmed/freellmapi is a self-hosted server that aggregates the free tiers of 34 LLM providers behind a single OpenAI-compatible /v1 API. Per the README it stores your provider keys encrypted, routes each request to the best available model, falls over to the next provider when one is rate-limited, and tracks per-key usage so you stay under every free-tier cap. The README puts the stacked total at roughly 7.4 billion tokens a month across 635 free model endpoints. This post covers the install, connecting Claude Code, and calling it from Python. You add keys for the providers you want Google, Groq, Cerebras, Mistral, OpenRouter, Cloudflare, Cohere, NVIDIA, Hugging Face and more and order them in a fallback chain. For each request the router picks the highest-priority model with a healthy key that is under all its rate limits, decrypts the key in memory and calls the provider. On a 429 or 5xx it cools that key down and retries the next model in your chain. A few details make it practical for agents: /v1/responses what Codex CLI needs , /v1/embeddings , image, speech and transcription endpoints, and /v1/models . /v1/messages speaks Anthropic's wire format, so Claude Code and the Anthropic SDKs can run against the free pool. freellmapi- bearer key. Provider keys are AES-256-GCM encrypted in SQLite. With Docker, the one-liner sets up ~/freellmapi , generates an encryption key, pulls the image and starts the container: curl -fsSL https://freellmapi.co/install.sh | bash Read the script first if you prefer; the README links it. Re-running it keeps your .env and encryption key and updates the container. On Windows or macOS there is also a desktop tray app on the Releases page, which runs the router and dashboard locally with no account to set up. From source: npm install && npm run dev That gives you the server on port 3001 and the dashboard on 5173. Open http://localhost:3001 http://localhost:3001 , add provider keys on the Keys page, reorder the Fallback Chain , and copy the unified API key from the Keys page header. The Playground shows which provider served each test message, with model ID and latency, which is a quick way to confirm your keys work. The README gives a setup command that reads your live catalog, backs up the existing config and merges into it: npx freellmapi setup-claude --url http://localhost:3001 --api-key