Migrate from OpenRouter
Migrating from OpenRouter to Routeplane
Section titled “Migrating from OpenRouter to Routeplane”This guide walks you through migrating your existing OpenRouter integration to a self-hosted Routeplane proxy — pointing your client at your own local daemon instead of OpenRouter’s hosted endpoint.
Why Migrate?
Section titled “Why Migrate?”Routeplane offers several advantages over OpenRouter for agent workloads:
| Feature | OpenRouter | Routeplane (self-hosted) |
|---|---|---|
| Deployment | Cloud-only (closed-source) | Local binary on your machine (Apache 2.0) |
| Markup | 5.5% via Stripe | None — use your own provider keys at cost |
| Subscription routing | No | Yes — flat-rate Copilot / Grok / etc. before pay-per-use |
| Access | Account registration required | No registration required |
Routeplane Cloud (hosted overlay with markup, teams, audit) is on the Phase D roadmap. For now, self-host.
Migration Path
Section titled “Migration Path”Step 1: Install the Routeplane proxy
Section titled “Step 1: Install the Routeplane proxy”Install from the source tarball (see Installation for details):
# Install from the v0.1.0 source tarball (see Installation docs)curl -L -O https://routeplaneapp.vercel.app/downloads/routeplane-v0.1.0-source.tar.gztar -xzf routeplane-v0.1.0-source.tar.gzcd johnmwhitman-routeplane-*/cargo install --path apps/routeplanerouteplane init # writes ./routeplane.yamlrouteplane start # listens on http://127.0.0.1:4356Set your existing provider keys in the environment — Routeplane auto-detects any key that’s present:
export OPENAI_API_KEY=sk-... # already have it from OpenRouter# export ANTHROPIC_API_KEY=...# export GOOGLE_API_KEY=...# export OPENROUTER_API_KEY=... # can be re-used as a fallback providerStep 2: Update base URL and API key
Section titled “Step 2: Update base URL and API key”Point your client at the local proxy instead of OpenRouter’s host. The endpoint shape is identical (OpenAI-compatible), so the rest of your code stays the same:
<Tabs items={[‘Python’, ‘JavaScript’, ‘curl’]}>
# Before (OpenRouter)client = openai.OpenAI( base_url="https://openrouter.ai/api/v1", api_key=OPENROUTER_API_KEY,)
# After (Routeplane, self-hosted)client = openai.OpenAI( base_url="http://127.0.0.1:4356/v1", api_key=OPENAI_API_KEY, # any value works on loopback; real key is on the daemon)// After (Routeplane, self-hosted) const client = new OpenAI({ baseURL: ‘http://127.0.0.1:4356/v1’, apiKey: OPENAI_API_KEY, // any value works on loopback; real key is on the daemon });
</Tab><Tab value="curl">```bash# Before (OpenRouter)curl https://openrouter.ai/api/v1/chat/completions \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'
# After (Routeplane, self-hosted)curl http://127.0.0.1:4356/v1/chat/completions \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "openai/gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'Headers to Remove
Section titled “Headers to Remove”If your OpenRouter integration sets any of these headers, you can safely drop them:
| OpenRouter header | Status in Routeplane |
|---|---|
HTTP-Referer |
Not used |
X-Title |
Not used |
transforms |
Not used — guardrails are configured in routeplane.yaml |
route |
Not used — provider routing is configured in routeplane.yaml |
Next Steps
Section titled “Next Steps”Need Help?
Section titled “Need Help?”- Discord: Join our community for migration support
- GitHub: Report issues or contribute
- Email: contact@routeplane.app for enterprise migration assistance