How to rotate your OpenRouter API key
Updated October 2026
Make a new OpenRouter key, put it everywhere the old one is used, then delete the old key. OpenRouter keeps both keys working until you delete one, so you can switch with no gap.
The manual steps
- Make a new key in your OpenRouter settings. Give it the same credit limit as the old one.
- Copy it right away. OpenRouter shows the full key once.
- Update every place the old key lives. Your host's environment variables, CI secrets, and any script that calls OpenRouter.
- Delete the old key. OpenRouter's own rotation guide says both keys stay valid during the switch, so delete the old one only after everything runs on the new one.
What breaks if you miss a place
Anything still holding the old key starts failing the moment you delete it. A forgotten copy is worse in the other direction: if you never delete the old key, a leaked copy keeps spending your credits.
How to check the old key is actually dead, for free
Call GET https://openrouter.ai/api/v1/key with the old key. It reads the key's own details and runs no model, so it costs nothing. A deleted key is refused. In our test, OpenRouter kept a deleted key working for about 20 seconds, so ask more than once.
You can do it by API
A management key can make keys with POST /api/v1/keys and delete them with DELETE /api/v1/keys/{hash}. It cannot call a model. It does control every key on the account, so treat it like a password.
Or let Key Robot do it
Key Robot does this for you today, with a management key you make once. It makes the new key with the same credit limit as the old one, puts it in your app on Netlify, Vercel, Render, Railway or Cloudflare Workers, checks your app still works, and then deletes the old key. If the check fails, it puts the old key back.
In our live test on October 26, 2026, one change took 32 seconds. Most of that was the robot waiting until OpenRouter refused the old key 3 times in a row. No model was ever called.
See how to rotate your OpenAI key for the provider behind many OpenRouter apps, or the rotate hub for every service.
Questions
Do both OpenRouter keys work while I switch?
Yes. Making a new key does not end the old one. OpenRouter's own rotation guide says both keys stay valid during the switch, until you delete the old key.
Can I make OpenRouter keys by API?
Yes, with a management key. It can make, change and delete keys, but it cannot call a model. Keep it safe, because it controls every key on the account.
Does Key Robot rotate OpenRouter keys today?
Yes. Key Robot makes the new key with the same credit limit, checks your app, and deletes the old key. Free for one app.