DEV Community

Cover image for How I Routed One Billion AI Tokens for $0 With OmniRoute
curi0us_dev
curi0us_dev

Posted on

How I Routed One Billion AI Tokens for $0 With OmniRoute

I wanted to keep Claude Code, Hermes Agent, OpenClaw, and OpenCode running without turning every long session into an API bill. The answer was not another subscription. It was to make dozens of free inference allowances behave like one pool.

Free inference was already scattered across the ecosystem. Individual providers offered useful allowances, but each came with its own endpoint, credentials, models, quotas, and reset schedule. Any one allowance was easy to exhaust. Together, they represented substantial capacity that I could not use efficiently by hand.

I installed OmniRoute to put those providers behind one local endpoint. I then routed my coding agents through combinations ordered around availability and speed. My tracked usage eventually passed one billion tokens, and I spent $0 on inference.

That result needs context. I did not find one provider willing to serve unlimited tokens for free. I combined many small and large allowances, accepted that the active model could change, and treated free inference as a routing problem rather than a permanent entitlement.

Why I tried OmniRoute

Before OmniRoute, every free provider created another integration to maintain. I had to remember which client supported which API format, which key still worked, which model was currently available, and whether a failed request meant a temporary rate limit or an exhausted quota.

That is manageable with two providers. It becomes tedious with dozens.

OmniRoute runs a local server and exposes an OpenAI-compatible endpoint at http://localhost:20128/v1. Its current quick start uses npm install -g omniroute followed by omniroute. Clients that understand the OpenAI API format can point to the local endpoint instead of connecting to every upstream provider separately.

I hosted it on my own Mac mini M4. The hardware was not the interesting part. The useful change was architectural. My agents now talked to one gateway, while the gateway handled the changing provider pool behind it.

The project currently advertises 290 providers and more than 90 free options. That marketing count is not the same as independently documented quota pools. The project's more conservative free-tier ledger lists 50 provider free-tier pools and estimates roughly 1.94 billion free tokens per month under its assumptions. The ledger labels those figures as upper-bound estimates, not promised capacity, and tells readers to verify limits before relying on them.

I did not design my setup around either headline number. I connected the free sources available to me and let routing absorb the uneven limits.

How I built the provider pool

I started with the free providers that OmniRoute could expose immediately, then added the accounts and credentials required for the rest of the pool. OpenRouter and the free options associated with OpenCode were part of it, alongside many smaller sources.

These are not interchangeable buckets of identical tokens. The OmniRoute ledger shows a mixture of tokens per minute, requests per day, daily token limits, monthly credits, trial balances, and GPU-time allowances. Some reset quickly. Some last longer but disappear after a trial. Others remain free while offering less predictable availability.

That mix is why pooling works. A daily allowance that looks too small for primary use can still carry requests after another provider reaches its cap. A slower model can keep a background task moving. A limited trial can absorb a temporary burst. The combined system is useful because the limits do not all fail at the same moment.

It is also why I would not describe the result as unlimited inference. Near-continuous is more accurate. The pool stayed useful for my workload because another route was usually available, not because quotas stopped existing.

How the routing worked in practice

I created combinations that prioritized targets according to availability and speed. When the preferred route was unavailable or exhausted, OmniRoute moved through the remaining targets rather than forcing me to edit each agent's configuration.

This behavior is more deliberate than random key rotation. OmniRoute's documented quota logic filters out exhausted connections before selection, while a combo is an ordered fallback chain that skips failed targets and tries the next available route. Its usage guide says each request record includes the provider, model, token counts, computed cost, latency, and status. It also retains quota snapshots and reset information.

That telemetry gave me a feedback loop. I could see which providers were actually carrying traffic, which routes were failing, and whether a supposedly free path had generated a cost. OmniRoute also exposes usage, quota, and cost summaries, so I did not have to rely only on the dashboard.

I still had to decide what I valued. For interactive coding, I favored responsive routes that could preserve momentum. For autonomous or background work, I could tolerate slower providers if they kept the task running. A single global ranking would have been less useful because latency matters differently when I am waiting at the terminal and when an agent is working unattended.

What one billion tracked tokens at zero cost means

My OmniRoute usage report eventually crossed one billion tokens, and its cost report showed zero for the traffic in this experiment. OmniRoute records provider-reported token counts when available and estimates usage when an upstream response does not include it. The total is therefore a local telemetry figure, not an audited provider invoice or a promise that another user will reproduce my result.

Several conditions made it possible. I used free routes rather than quietly mixing in paid fallbacks. I connected a broad set of providers instead of expecting one account to carry the workload. I also ran multiple coding tools, so the total included far more than the visible text in final answers. Agent loops repeatedly send repository context, tool results, plans, corrections, and generated code. Long autonomous sessions can consume large token volumes even when the human-facing output looks modest.

The number should not be read as one billion equally valuable tokens. Models differ in coding ability, context handling, tool use, speed, and reliability. A billion tracked tokens routed through a changing pool is not equivalent to a billion provider-billed tokens from one stable premium model.

Zero inference cost also does not mean zero total cost. I spent time creating accounts, adding credentials, watching failures, and adjusting priorities. I ran the gateway on hardware and an internet connection I already paid for. The tracked inference spend was zero, but the system still required maintenance and infrastructure.

The hardest problem was model drift

The biggest weakness appeared when routing did exactly what I had asked it to do.

A request would move from one free model to another, and the agent's behavior could change abruptly. One model might follow repository instructions carefully but use tools cautiously. Another might act faster while making broader edits. A third might struggle with a long context or return a different style of plan.

OpenRouter's official free router illustrates the tradeoff clearly. It filters for compatible free models and then randomly selects one from that pool. Its documentation warns that free model availability can vary, rate limits may be lower, latency may rise during peak demand, and users cannot control the exact model selected by the router.

OpenCode creates a related source of change. OpenCode itself is the coding client, while OpenCode Zen is its optional model gateway. Zen lists several free models, but the documentation describes some of them as free for a limited period while feedback is collected. That makes them useful additions to a pool, not permanent foundations to assume will remain unchanged.

This variability matters more for agents than for simple chat. An agent carries a plan across many turns. If the model changes halfway through, the new model inherits the transcript but not the previous model's judgment. The task may continue, yet its editing style, caution, or interpretation can shift.

I learned to separate workloads by how much consistency they needed. Routine exploration, summarization, test iteration, and low-risk background work tolerated rotation well. Large refactors and tasks with subtle architectural constraints benefited from a pinned model or a narrower fallback chain. Free capacity was most valuable when I matched it to work that could survive variation.

How the four coding tools fit

Claude Code, Hermes Agent, OpenClaw, and OpenCode did not need separate provider strategies once they used the gateway. They could share the same underlying pool while keeping their own interfaces and agent behavior.

Claude Code remained useful for repository work where tool use and instruction following mattered. Hermes Agent and OpenClaw gave me other ways to run longer agentic tasks. OpenCode provided another coding interface and, separately, access to the optional Zen gateway.

The main benefit was not that OmniRoute made these tools identical. It removed provider configuration from the choice of client. I could choose the agent interface for the task and manage free inference centrally.

That separation also made failures easier to diagnose. If several clients began failing on the same route, I could inspect the gateway rather than debugging four unrelated configurations. If only one client behaved badly, the provider pool was less likely to be the cause.

What I would change before relying on it again

I would keep the broad free pool, but I would define clearer lanes.

One lane would favor speed and broad availability for exploration. Another would contain a smaller set of models that behave predictably during code changes. A third would handle background work where latency matters less. Critical tasks would use session affinity or a pinned route so one model could keep control from planning through verification.

I would also keep paid fallback disabled by default. A gateway that can access hundreds of providers makes it easy to hide where a request went. Cost telemetry helps, but an explicit boundary is safer than discovering later that a supposedly free workflow had crossed into a paid model.

Finally, I would recheck provider rules regularly. The documented free-tier totals are a snapshot, and some providers describe their free models as temporary. A working route today is not a contract for next month.

Near-free coding is a systems problem

The experiment changed how I think about inference cost. The usual comparison asks which provider has the cheapest model. My setup asked a different question. How much useful work can a coding system complete when it can move across many independently limited free routes?

For my workload, the answer was enough to keep several coding agents active, pass one billion locally counted tokens, and record zero inference cost. The compromise was consistency. Routing protected availability, but every model switch introduced a chance that the agent would behave differently.

I would use this setup again, especially for exploration and autonomous work that can tolerate model changes. I would not pretend it replaces a stable premium model for every task. OmniRoute made free inference practical by turning scattered allowances into one pool. The next step is not adding every possible provider. It is deciding which work deserves continuity and which work can ride the rotation.

Top comments (0)