How I Cut My AI Agent Development Costs by 90% with OpenRouter and Cursor
The Problem: AI Credits Disappear Fast
If you build AI agents for a living, your IDE is burning through model tokens all day. Cursor ships with generous credits, but once you’re running Auto mode on multi-file refactors, those credits evaporate. I needed a system that let me code with AI assistance all day without watching a usage meter.
The solution: route every request through OpenRouter, match each task to the cheapest model that can handle it, and review the roster weekly.
The result after 3 months
The Model Routing Table
Not every coding task needs GPT-4 or Claude Opus. Most tasks — explaining code, generating boilerplate, writing tests — run perfectly on smaller models. The trick is matching task complexity to model capability.
Here’s my current routing table (August 2026):
| Task type | Model | Cost | Why this one |
|---|---|---|---|
| Everyday / explain | cohere/north-mini-code:free |
Free | Fast, accurate for single-file edits and explanations |
| Large context | nvidia/nemotron-3-ultra-550b-a55b:free |
Free | 550B parameter model, free tier, handles massive context windows |
| Harder multi-file | moonshotai/kimi-k2.6 |
~$0.002/req | Strong reasoning across multiple files at minimal cost |
| Code specialist | qwen/qwen3-coder |
~$0.003/req | Purpose-built for code generation and refactoring |
| Architecture / ADR | Cursor Composer / Auto | Included credits | Complex architectural decisions deserve frontier models |
The key insight: 80% of my daily coding falls into the first two lanes — both free. The remaining 20% costs fractions of a cent per request. Frontier credits stay untouched for the work that actually needs them.
How It Works: The Three-Layer Setup
The system has three layers that work together. Here’s how they connect:
┌─────────────────────────────────────────────────────┐
│ CURSOR IDE │
│ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ User Rules │───▶│ "Use north-mini for │ │
│ │ (always on) │ │ everyday coding" │ │
│ └──────────────┘ └──────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Skill File │───▶│ Model routing table + │ │
│ │ (per-task) │ │ setup instructions │ │
│ └──────────────┘ └──────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ OpenRouter │───▶│ API key: cursor-coding │ │
│ │ (provider) │ │ Base: openrouter.ai/... │ │
│ └──────────────┘ └──────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────┘
Layer 1: The OpenRouter API Key
Create a dedicated API key on openrouter.ai labelled cursor-coding. Don’t reuse keys from other projects — you want clean usage tracking.
In Cursor, add it as an OpenAI-compatible provider:
- API Key: your
cursor-codingkey - Base URL:
https://openrouter.ai/api/v1/cursor
That’s it. Every model on OpenRouter is now available in your Cursor sessions.
Layer 2: The Cursor Skill File
A skill file is a markdown document that lives in ~/.cursor/skills/. When an agent starts a task, it reads relevant skills and follows the instructions inside. Mine looks like this:
# OpenRouter coding lanes
| Task | Model |
|---|---|
| Everyday / explain | cohere/north-mini-code:free |
| Large context | nvidia/nemotron-3-ultra-550b-a55b:free |
| Harder multi-file | moonshotai/kimi-k2.6 |
| Code specialist | qwen/qwen3-coder |
| ADR / architecture | Composer / Auto |
Avoid google/gemma-4-31b-it:free (rate-limit issues).
If this chat is Auto/Composer and the task is everyday coding,
tell Emil to switch to North Mini or Kimi, then continue.
The last line is the guard rail. If I accidentally open a frontier-model session for a trivial task, the agent tells me to switch down before continuing. It’s a one-line nudge that has saved me hundreds of wasted credits.
Layer 3: User Rules
User rules in Cursor are always-on instructions that apply to every chat. My rule mirrors the skill file but adds project-specific constraints:
- Don’t commit API keys
- Don’t reuse the Vercel
OPENROUTER_API_KEY - Use a separate key labelled
cursor-coding
This redundancy is intentional. The skill file teaches the agent which model to pick. The user rule ensures the agent never leaks credentials while doing it.
The Weekly Email: Keeping the Roster Current
AI models change fast. New free tiers appear, rate limits shift, models get deprecated. A static routing table goes stale within weeks.
My solution: a weekly automated email that reviews my model choices.
What the weekly review checks:
- Availability — Is each model still live on OpenRouter?
- Rate limits — Have free-tier limits changed?
- New contenders — Are there new free or cheap models worth testing?
- Performance — Did any model degrade in quality based on my usage?
- Cost drift — Have pricing tiers shifted?
When the email arrives, I spend 5 minutes updating the skill file and user rules. The update propagates instantly to every Cursor session — no restarts, no config files to rebuild.
This is the part most people skip. They set up the routing once and forget it. Two months later they’re using a deprecated model or missing a better free option that launched quietly. The weekly review is what makes the system sustainable.
Models I’ve Tried and Dropped
Not every free model is worth using. Here are the ones I tested and removed:
google/gemma-4-31b-it:free Aggressive rate limiting made it unusable for any real coding session. Constant 429 errors mid-task.
openai/gpt-oss-20b:free Name clashes with other OpenAI models caused routing confusion in Cursor. Not worth the debugging.
The lesson: free doesn’t mean good enough. Always test a model for a full day of real work before adding it to your routing table.
Cost Breakdown: Before and After
Before: All Frontier
- Every task → Claude/GPT-4
- Monthly cost: ~$40–80 in credits
- Credits exhausted mid-month
- Forced to ration AI assistance
After: Routed
- 80% tasks → free models
- 15% tasks → $0.002–0.003/req
- 5% tasks → included Cursor credits
- Monthly cost: < $2
- Unlimited AI assistance all month
How to Set This Up Yourself
Step 1. Go to openrouter.ai/keys and create a key. Name it something obvious like cursor-coding.
Step 2. In Cursor, open Settings → Models → OpenAI-compatible. Add:
- Base URL:
https://openrouter.ai/api/v1/cursor - API Key: paste your key
Step 3. Create ~/.cursor/skills/openrouter-coding/SKILL.md with the routing table above.
Step 4. Add user rules in Cursor settings that reference the routing table and include credential safety guards.
Step 5. Set a weekly calendar reminder (or automate an email) to review model availability on OpenRouter and update the skill file.
The whole setup takes 15 minutes. The weekly maintenance takes 5. The savings compound every single day.
I write about building AI-powered data systems and keeping development costs sane. If you’re an engineering leader wondering how to scale AI tooling without scaling the budget, let’s talk.