Skip to main content

Automatic API Key Configuration

You can save your API key for OpenRouter to your device with a few simple steps.

Procedure

Click the Get API Key button on the Settings screen to be redirected to the OpenRouter authorization page (you will be prompted to sign in if you are not already logged into OpenRouter). After clicking the Authorize button, you will be redirected back to this app's settings screen, and the API key will be loaded onto your device. A toast notification will appear on the screen upon success.

Notes

This process utilizes a technology called PKCE.

🔑 What is PKCE (Proof Key for Code Exchange)?

PKCE (pronounced "pixie") is a mechanism for securely obtaining API keys (access tokens) in environments where "credentials cannot be kept secret," such as game clients. In standard authentication (OAuth 2.0), a Client Secret is used to obtain an API key; however, embedding this secret within a game's program poses a risk of it being stolen via reverse engineering. PKCE allows for secure API authentication even in game apps because it performs authentication by generating a "disposable secret password" on the fly, without the need for a Client Secret.