OpenRouter
Connect an OpenRouter account to AI Wallet with OpenRouter's PKCE sign in, on the visitor's credits, with the whole OpenRouter catalog picked in the account's settings.
The OpenRouter account answers through a key OpenRouter issues on the visitor's credits. The wallet lists it as OpenRouter under "With your plan", with the id openrouter.
What the visitor needs
An OpenRouter account with credits. OpenRouter binds the key it issues to the account's credits, and every answer is billed to them.
Sign in
- In the wallet, the visitor picks OpenRouter under "With your plan".
- Chrome's sign in window opens
https://openrouter.ai/authwith a PKCE challenge, the wallet's callback address and the key label "AI Wallet". - The visitor signs in to OpenRouter and approves.
- OpenRouter sends the window back to the wallet's callback address,
https://<extension id>.chromiumapp.org/callback. Chrome closes the window and hands the address to the wallet. - The wallet trades the code and its PKCE verifier for a key at
https://openrouter.ai/api/v1/auth/keys, and the account is connected.
Closing the window ends the sign in with "The sign in window was closed". The key stays in the vault until the visitor removes the account.
Models
The wallet lists OpenRouter's whole catalog from https://openrouter.ai/api/v1/models, a public list asked without the key. OpenRouter's Auto Router, openrouter/auto, comes first, and the other models follow from newest to oldest. The wallet keeps the list for a day.
The catalog is too long to pick from on every site, so the visitor picks the model in the account's settings, under "Default model". The side panel shows no model buttons for sites on OpenRouter, and every site answers with that model. Without a choice, the account answers with openrouter/auto, the Auto Router, which picks the model for each prompt.
Usage and limits
The wallet reads no usage header specific to OpenRouter. It reads x-ratelimit-remaining-tokens and x-ratelimit-limit-tokens on any answer that carries them, as it does for every account. Without them, the card keeps saying "Usage shows after the first answer", and Auto ranks the account among the accounts with no reading.
Calls
Answers come from https://openrouter.ai/api/v1/chat/completions in the OpenAI chat completions protocol, with the key and the header X-Title: AI Wallet. All four request options reach OpenRouter.