A local AI gateway for coding tools. Bansur Router runs on your machine and turns 40+ providers and 800+ models into a single OpenAI-compatible endpoint — one API key, one config, no juggling.
Every tool wants its own setup. It doesn't have to be that way.
Coding tools multiply, each with its own keys, formats, and limits. Bansur Router collapses all of it into one local gateway.
The problem
A different key and format for every tool
Claude Code, Codex, Cursor, Cline — each provider speaks its own dialect and wants its own credentials configured separately.
→
With Bansur Router
One OpenAI-compatible endpoint
Every tool points at http://localhost:667/v1 with a single API key copied from the dashboard. Format translation between OpenAI, Claude, and Gemini happens inside the gateway.
The problem
Rate limits stop sessions cold
You hit a quota ceiling mid-task and the session dies — even though you have other subscriptions, cheaper APIs, and free tiers sitting idle.
→
With Bansur Router
3-tier smart fallback
Requests flow Subscription → Cheap → Free. When one tier hits its limit, the next takes over automatically and the session keeps going.
The problem
Subscription quota expires unused
Your plan resets whether you spent the quota or not. Without visibility, the most valuable tokens you own quietly evaporate.
→
With Bansur Router
Real-time quota tracking
Usage is tracked per account in real time, so subscription quota gets used before it resets — not after you've already paid for API calls.
The problem
Tool output eats your context
A single git diff or grep result can flood the prompt with thousands of tokens that add cost and noise, request after request.
→
With Bansur Router
RTK Token Saver
Tool outputs such as git diff, grep, and ls are compressed before they reach the model — saving 20–40% of tokens on every request.
The problem
One account is a single point of failure
One login, one quota pool, one expired token — and every connected tool goes down with it.
→
With Bansur Router
Multi-account round-robin
Add several accounts per provider and requests rotate across them, with OAuth tokens refreshed automatically in the background.
How it works
Your tools keep speaking plain OpenAI API. Bansur Router handles routing, translation, and fallback on your machine.
Your CLI tools
All configured the same way
Claude Code
OpenAI Codex
Cursor · Cline
OpenCode · Antigravity
GitHub Copilot · OpenClaw
→
Bansur Router
localhost:667/v1
Format translation — OpenAI ↔ Claude ↔ Gemini
RTK Token Saver — compresses tool output
Quota tracking & multi-account rotation
Request logging & usage analytics
→
TIER 1SubscriptionYour OAuth plans first — Claude Code, Codex, Copilot, Antigravity…
TIER 2CheapLow-cost API providers — GLM, MiniMax, Kimi and 40+ more.
Bansur Router is a local AI gateway. It runs on your machine and gives every coding tool one OpenAI-compatible endpoint for 40+ providers and 800+ models.
The idea
Instead of configuring each CLI tool with each provider's key and format, you run Bansur Router once. It listens on http://localhost:667/v1, and every tool — Claude Code, Codex, Cursor, Cline, OpenCode, Antigravity, GitHub Copilot, OpenClaw — points at that single address with a single API key from the dashboard.
Behind the endpoint, Bansur Router translates request formats (OpenAI ↔ Claude ↔ Gemini), rotates accounts, tracks quota, compresses tool output, and falls back across three tiers — Subscription → Cheap → Free — so a rate limit never has to end your session.
Your first run
Install — npm install -g bansur-router (or use Docker; see Installation).
Start it — run bansur-router. The dashboard opens at http://localhost:667/dashboard.
Connect a provider — sign in with an OAuth subscription or paste an API key (see Connecting Providers).
Copy your API key from the dashboard and paste it into your CLI tool, together with the endpoint and a model id (see CLI Tools Setup).
Model ids carry the provider with them. For example, kr/claude-sonnet-4.5 routes to Claude Sonnet 4.5 through Kiro. List everything available with GET /v1/models.
Three ways to run Bansur Router: the npm package, Docker, or from source. All of them serve the same endpoint on port 667.
npm (recommended)
Install the package globally, then run it:
npm install -g bansur-router
bansur-router
The dashboard is now at http://localhost:667/dashboard and the API at http://localhost:667/v1. To update later, stop the running instance first, then repeat the install command.
Windows note: if npm fails with an EBUSY error during an update, Bansur Router is still running and Windows has locked its folder. Stop the process first (Ctrl+C in its terminal, or taskkill /F /IM node.exe), then install again.
Docker
Images are published to Docker Hub as bansur/router and to GHCR as ghcr.io/mas-ajam/bansur-router.
docker run -d --name bansur-router -p 667:667 bansur/router
The repository also ships a docker-compose.yml, so a compose-based deployment works out of the box:
Providers are connected once, in the dashboard. After that, every tool using your Bansur Router key can reach all of them.
OAuth subscriptions
For subscription providers — Claude Code, Codex, GitHub Copilot, Antigravity, Gemini, iFlow, Windsurf, and Kiro — the flow is:
Open the dashboard at http://localhost:667/dashboard and go to Providers.
Pick the provider and choose Connect.
Complete the provider's sign-in in the browser window that opens.
The account appears in the dashboard, and its models become available through your endpoint.
Tokens are refreshed automatically, and you can connect more than one account per provider — requests round-robin across them, and quota is tracked per account so subscription quota is spent before it resets.
API-key providers
For the 40+ API-key providers, open the provider in the dashboard and paste its API key. Low-cost providers such as GLM (from $0.6/1M tokens), MiniMax (from $0.20/1M), and Kimi make a good "cheap" tier behind your subscriptions.
Free tiers worth connecting
Kiro AI — about 50 credits per month free, including Claude 4.5, GLM-5, and MiniMax models.
OpenCode Free — works with no authentication at all.
Vertex AI — new GCP accounts receive $300 in free credits.
Self-hosted endpoints
You can also register your own endpoints and mix them into the same routing, combos, and fallback tiers as the hosted providers.
Order matters. Bansur Router's fallback chain is Subscription → Cheap → Free. Connect at least one provider in each tier you care about, and a rate limit in one tier simply rolls the request into the next.
Every supported tool — Claude Code, OpenAI Codex, Cursor, Cline, OpenCode, Antigravity, GitHub Copilot, and OpenClaw — is configured with the same three values.
The three values
Endpoint
http://localhost:667/v1
API Key
Your Bansur Router API key, copied from the dashboard
Model
A model id from GET /v1/models — e.g. kr/claude-sonnet-4.5
Endpoint http://localhost:667/v1
API Key <copy from the dashboard>
Model kr/claude-sonnet-4.5
Where exactly those values go depends on the tool — a custom OpenAI endpoint field, an environment variable, or a settings file — but the values themselves never change. That is the point of the gateway: reconfigure the router once, and every tool follows.
Switching models
There is nothing to reinstall when you want a different model. Change the model id in the tool to any id returned by GET /v1/models — 800+ models across 40+ providers are already behind the same key. Custom combos you define in the dashboard can also be used as model ids, chaining providers into a single named route.
Verifying the connection
Before opening your tool, confirm the gateway answers and lists models:
POST /v1/chat/completions is OpenAI-compatible. The model id selects the provider route — Bansur Router translates the request into the provider's native format (OpenAI, Claude, or Gemini) and back.
curl http://localhost:667/v1/chat/completions \
-H "Authorization: Bearer <your-dashboard-api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "kr/claude-sonnet-4.5",
"messages": [
{ "role": "user", "content": "Explain what a router does, in one sentence." }
]
}'
What happens to a request
The model id resolves to a provider route (or one of your custom combos).
Tool outputs in the conversation are compressed by the RTK Token Saver.
The request is translated into the provider's format and sent with the next account in the round-robin.
If the tier is rate-limited, the request falls back: Subscription → Cheap → Free.
The response is translated back into OpenAI format and logged to the dashboard.
Short answers to the questions everyone asks first.
Is Bansur Router free?
The software is open source under the MIT license — free to use, modify, and self-host. What you pay for are the providers themselves: subscriptions you already own, pay-per-token APIs, or nothing at all if you stick to the free tiers.
Does it run locally?
Yes. Bansur Router runs on your own machine and serves its endpoint on localhost:667. You can also deploy it with Docker or on a VPS if you want it reachable beyond one machine.
Which tools does it work with?
Any tool that accepts an OpenAI-compatible endpoint — including Claude Code, OpenAI Codex, Cursor, Cline, OpenCode, Antigravity, GitHub Copilot, and OpenClaw. They all share the same endpoint, key, and model ids.
How many providers and models are there?
40+ providers and 800+ models, spanning OAuth subscriptions, free tiers, and API-key providers. Call GET /v1/models to see the exact list for your connected accounts.
What is the RTK Token Saver?
Tool outputs — git diffs, grep results, directory listings — are compressed before they are sent to the model. That saves roughly 20–40% of tokens per request, which means lower cost and more room in the context window.
What happens when I hit a rate limit?
The request falls back through three tiers: Subscription → Cheap → Free. As long as one tier has capacity, the session continues instead of stopping.
Can I use more than one account per provider?
Yes. Connect multiple accounts and Bansur Router rotates requests across them round-robin, tracks quota per account, and refreshes OAuth tokens automatically.
The failure modes people actually run into, and the fix for each.
The dashboard doesn't open
Make sure Bansur Router is actually running — start it with bansur-router and watch for startup errors. Then open http://localhost:667/dashboard. If the page still won't load, something else may already be using port 667; stop that process or the older Bansur Router instance first.
Windows update fails with EBUSY
npm install -g bansur-router@latest cannot replace files while the app is running — Windows locks the folder and npm reports EBUSY: resource busy or locked. Stop the running instance (Ctrl+C in its terminal, or taskkill /F /IM node.exe to be sure), then run the install again.
Provider connect fails: "client_secret is missing"
Your browser login succeeded but the dashboard reports Token exchange failed … "client_secret is missing" — you are on an old version. This was fixed in release 1.0.3; update to the latest version (npm install -g bansur-router@latest, stopping the app first on Windows) and connect again. Current releases connect Antigravity, Gemini, iFlow, and Windsurf out of the box.
Requests return 401
The API key in your tool doesn't match the one in the dashboard. Re-copy it from the dashboard exactly, and make sure the header is Authorization: Bearer <key> with no extra whitespace.
"Model not found"
Model ids are provider-prefixed and must match exactly. List the valid ids for your accounts with GET /v1/models — for example kr/claude-sonnet-4.5 — and check that the provider behind the prefix is connected.
Everything stops at a rate limit
Fallback only works if the next tier exists. Connect at least one cheap API provider and one free tier (Kiro AI or OpenCode Free) alongside your subscriptions, and add a second account to busy providers so round-robin has somewhere to rotate to. Quota in the dashboard shows which account is exhausted.