Exchange authorization code for API key
Exchange an authorization code from the PKCE flow for a user-controlled API key
Authentication
AuthorizationBearer
API key as bearer token in Authorization header
Request
This endpoint expects an object.
code
The authorization code received from the OAuth redirect
code_verifier
The code verifier if code_challenge was used in the authorization request
code_challenge_method
The method used to generate the code challenge
Allowed values:
Response
Successfully exchanged code for an API key
key
The API key to use for OpenRouter requests
user_id
User ID associated with the API key