Skip to content

Migrate from OpenRouter

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.

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.

Install from the source tarball (see Installation for details):

Terminal window
# 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.gz
tar -xzf routeplane-v0.1.0-source.tar.gz
cd johnmwhitman-routeplane-*/
cargo install --path apps/routeplane
routeplane init # writes ./routeplane.yaml
routeplane start # listens on http://127.0.0.1:4356

Set your existing provider keys in the environment — Routeplane auto-detects any key that’s present:

Terminal window
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 provider

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
)
```javascript // Before (OpenRouter) const client = new OpenAI({ baseURL: 'https://openrouter.ai/api/v1', apiKey: OPENROUTER_API_KEY, });

// 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"}]}'

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