DEV Community

Ahmed Nafies
Ahmed Nafies

Posted on

I'm using GPT Sol and Claude Opus for free — pi-coding-agent + OmniRoute

I'm using GPT Sol and Claude Opus for free. No credit card, no per-token bill, no "you've hit your monthly limit" email.

Two pieces of software make it happen:

  • Pi — the coding agent that reads, writes, and runs commands in my terminal.
  • OmniRoute — a local gateway that sits in front of hundreds of AI providers, dozens of them free, and routes every request to the cheapest one that works.

Here's the exact setup, from install to first prompt.


What "free" means here

OmniRoute ships with free-tier providers pre-wired into the auto model. You don't paste an API key — a fresh install just answers. But auto also reaches frontier-class models through the free routes, so I can pick them by name:

aug/gpt5.6-sol       # GPT Sol
aug/opus4.8          # Claude Opus
auto/best-coding     # best free coding model
auto/best-reasoning  # best free reasoning model
auto                 # let OmniRoute pick
Enter fullscreen mode Exit fullscreen mode

Pi talks to one endpoint (http://localhost:20128/v1). OmniRoute handles which provider actually serves the request, and falls back automatically if one goes down or hits a rate limit.


1. Install both

npm install -g omniroute
omniroute
Enter fullscreen mode Exit fullscreen mode

The gateway boots on port 20128; the dashboard is at http://localhost:20128.

npm install -g @earendil-works/pi-coding-agent
Enter fullscreen mode Exit fullscreen mode

Quick note so you install the right thing: this is the npm pi (@earendil-works/pi-coding-agent), a coding agent with read / bash / edit / write tools. It's unrelated to the Rust project also called pi-coding-agent.


2. Add OmniRoute as a Pi provider

Pi reads its providers from ~/.pi/agent/models.json. Add an omniroute entry:

{
  "providers": {
    "omniroute": {
      "api": "openai-completions",
      "apiKey": "",
      "baseUrl": "http://localhost:20128/v1",
      "models": [
        { "_launch": true, "id": "auto", "input": ["text"], "reasoning": true },
        { "id": "auto/best-coding", "input": ["text"], "reasoning": true },
        { "id": "auto/best-reasoning", "input": ["text"], "reasoning": true },
        { "id": "auto/best-fast", "input": ["text"], "reasoning": true },
        { "id": "aug/gpt5.6-sol", "input": ["text"], "reasoning": true },
        { "id": "aug/opus4.8", "input": ["text"], "reasoning": true }
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode
  • api: "openai-completions" — OmniRoute speaks the OpenAI protocol.
  • baseUrl — the local gateway. Keep the /v1.
  • apiKey — empty is fine: OmniRoute runs keyless locally. If you've created a key on the dashboard's Endpoints page, put it here instead.

If you already have providers in that file, just add the omniroute key next to them — don't overwrite the rest.


3. Make it the default

Edit ~/.pi/agent/settings.json:

{
  "defaultProvider": "omniroute",
  "defaultModel": "auto"
}
Enter fullscreen mode Exit fullscreen mode

Now pi uses OmniRoute out of the box, no flags needed.


4. Run it

pi "fix the failing test in src"      # interactive, routes through OmniRoute
pi -p "summarize this file"           # non-interactive, print and exit
pi --model aug/gpt5.6-sol             # GPT Sol specifically
pi --model aug/opus4.8                # Claude Opus specifically
pi --model auto/best-reasoning        # best free reasoning model
pi -c                                 # continue the last session
pi --list-models                      # see every available model
Enter fullscreen mode Exit fullscreen mode

Switching models is one flag — no reconfiguring keys, no new accounts. If you ever want your local Ollama model back, pi --provider ollama does it.


Two gotchas that cost me time

1. The dashboard writes the wrong file for this Pi. OmniRoute's built-in "Pi" integration (dashboard → CLI tools → Pi) writes ~/.pi/config.json. This Pi reads ~/.pi/agent/models.json. Edit the file by hand as above and you're done — the dashboard button won't do it for this version.

2. Bare OpenAI model names fail. Requesting gpt-5.6-luna (no prefix) returns No active credentials for provider: openai. The free routes are namespaced — use auto, auto/*, or aug/* IDs like aug/gpt5.6-sol.


Why this beats juggling provider keys

  • $0 — no card, no bill, no key management.
  • One endpoint — every tool and model behind http://localhost:20128/v1.
  • Auto-fallback — a rate-limited or dead provider swaps out without you noticing.
  • One config — switching models in Pi is --model, not a support ticket.

Install OmniRoute, point Pi at it, and go. Ten minutes, and GPT Sol and Claude Opus are just models you can pick.

Top comments (0)