Posted in development on August 16, 2026 by Adrian Wyssmann ‐ 2 min read
When selecting an infrastructure provider for heavy AI agent workflows, developers usually face a choice between pay-as-you-go token APIs (OpenAI, Anthropic) or hosting local models on dedicated hardware. I actually started out with [openrouter] and then switched to ollama cloud
[OpenRouter][openrouter] acts as an excellent unified API gateway. Instead of locking you into a single provider, it gives you access to hundreds of proprietary and open models under one roof.
OpenRouter maintains a rotating selection of free models. Key category leaders include:
nvidia/nemotron-3-ultra-550b-a55b:freepoolside/laguna-s-2.1:free or cohere/north-mini-code:freeinclusionai/ling-3.0-flash:free or openai/gpt-oss-20b:freegoogle/gemma-4-31b-it:freeYou have to pay up-front i.e. charge the account with some money. 5$ is enough to start and you can - if you want - enable auto top-up. Its a good and cheap start to try it out but if you really want to start using for real development tasks, then you should switch to more expensive models.
Use openrouter/free as your endpoint model slug. This fallback router automatically directs requests to an available free model that supports the required capabilities (such as vision or tool calling) without failing if a single model gets rate-limited.
omp (Oh-My-Pi) with OpenRouterI use [omp] as my
primary harness, which features first-class support for OpenRouter, allowing you to route subagents or main developer roles through OpenRouter models effortlessly.
Export your key (starting with sk-or-) in your terminal profile (~/.zshrc or ~/.bashrc):
export OPENROUTER_API_KEY="sk-or-v1-your-actual-key-here"Launch omp with an OpenRouter Model by using the model slug directly with the --model flag:
# Launch using Claude 3.5 Sonnet via OpenRouter
omp --model openrouter/anthropic/claude-3.5-sonnet
# Launch using DeepSeek V4 via OpenRouter
omp --model openrouter/deepseek/deepseek-v4Changing Models Inside the TUI
/model and press Enter.gpt-5.6-luna or claude-fable), select it, and press Enter to bind it.models.yml)To configure persistent roles, edit ~/.oh-omp/agent/models.yml:
providers:
openrouter:
baseUrl: https://openrouter.ai/api/v1
apiKey: OPENROUTER_API_KEY
api: openai-completions
headers:
X-Title: "My OMP Agent"
openRouterRouting:
order: ["primary-provider-slug"]Some hints if you ever run in the same troubles as me:
omp release (bun install -g @oh-my-pi/pi-coding-agent) to prevent 400 errors related to reasoning_content parameter mapping.I later also looks into ollama-cloud, which offers some interesting open models, especially Chinese ones, which offers very good results for development
Traditional API providers charge on a strict linear per-token basis (input + output). Agentic workflows that perform frequent LSP diagnostic passes, read large workspace trees, or hold long conversation threads quickly accumulate millions of input tokens, leading to unpredictable monthly bills.
Ollama Cloud flips this paradigm: billing and usage quotas are based on GPU Time (Resource Utilization) rather than raw token throughput.
Because usage tracks active GPU compute cycles rather than raw text length, models hosted on Ollama Cloud are categorized into distinct Weight Tiers:
gpt-oss:20b. Low resource footprint; consumes minimal quota.deepseek-v4-pro). These strain remote GPUs heavily and will burn through weekly allowances quickly if unmanaged.Whether using Ollama Cloud or OpenRouter, keep your compute and token footprints small:
"stream": true): Abort bad generations early to stop GPU cycles or unnecessary token billing./compact regularly in omp to trim stale conversation context.ollama run for simple offline edits, Ollama Cloud for high-context agent tasks, and OpenRouter for specialized reasoning models.