Recipes

Free-tier AI gateway routing Claude Code and Codex across 380 providers with token compression

From README links · today

Software & DevOpsWork & Operations

One endpoint fronting 380 providers with auto-fallback and stacked compression.

What they did

They stood up OmniRoute as a single local gateway endpoint and pointed their existing coding agents (Claude Code, Codex, Cursor, Cline, Copilot) at it instead of at vendor APIs directly. They connected their own provider accounts — including free tiers — and let the router pick among 20 routing strategies with automatic fallback when a provider rate-limits or errors. They enabled the stacked compression path (RTK plus Caveman) to cut prompt tokens, and used the /dashboard/free-tiers page to watch used-versus-remaining budget across the cataloged free pools so they could see how much headroom was actually left before hitting limits. The point was to keep coding sessions running without paying per-token and without hand-managing dozens of SDKs and rate limits.

How it went

The setup gives one stable endpoint for multiple agents, so a rate limit on one provider becomes a reroute rather than a dead session. The free-tier dashboard makes the budget math legible instead of guessed, and compression meaningfully reduces token spend per request. Polish is high for a community project — versioned releases, screenshots, methodology docs — but the headline token figure is an aggregate estimate, not a grant, so real usable capacity depends on which providers you can actually sign up for.

Worth knowing

The ~1.62B tokens/month number is an estimate across separately eligible third-party free tiers, not something OmniRoute provides; each provider controls its own limits and terms, and the figure is re-audited and moves both ways. Some quotas require regional identity verification and are excluded from the headline. The catalog flags providers as terms-risk, so account bans are a real possibility if you lean on free tiers against provider ToS. You must bring and configure your own credentials, and compression can degrade output quality on some tasks.

Wiring

Order of operations: install OmniRoute and start the gateway on a local port; create a gitignored .env holding provider credentials; define a routing config with an ordered fallback chain and a strategy (free-tier-first, then cheapest paid); enable compression in the gateway config so requests are compressed before dispatch; then repoint each client — Claude Code and Codex via base-URL environment variables, Cursor/Cline via their custom OpenAI-compatible endpoint setting — at the local gateway. The gateway sits between client and providers, so all clients share one credential store and one rate-limit view. Verify with a single test request per client, then check /dashboard/free-tiers for used/remaining per pool. Keep the dashboard bound to localhost.

Try it yourself

Set up OmniRoute in this repo as my single AI gateway. Read the README and docs/reference/FREE_TIERS.md first. Then: (1) install and run OmniRoute locally, (2) add a config file listing the providers I already have credentials for, with a fallback chain and a routing strategy that prefers free tiers before paid, (3) enable the stacked compression option and note where it is toggled, (4) show me how to point Claude Code and Codex at the local endpoint (env vars or config), and (5) open /dashboard/free-tiers and summarize my remaining budget per pool. Do not commit any API keys; use a .env that is gitignored, and list every file you create or modify.

Source

Tools in this stack

Run this stack

Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.

npx runchr install runchr/stack-aionui-and-caveman-and-codex-and-headroom-and-i-ha
No CLI?curl -s https://api.runchr.com/api/recipes/runchr/stack-aionui-and-caveman-and-codex-and-headroom-and-i-ha/manifest
System prompt
You are the operator of a single local OmniRoute gateway that fronts many AI providers for one-person coding work. Route every client through the local endpoint rather than vendor APIs, prefer free tiers before paid, and keep credentials in a gitignored .env.

This system prompt was generated from this stack's copy and tools. A person has not reviewed it.

The manifest is also at api.runchr.com/api/recipes/runchr/stack-aionui-and-caveman-and-codex-and-headroom-and-i-ha/manifest.