Skip to main content

Overview

OAuth authentication endpoints

Available Operations

exchangeAuthCodeForAPIKey

Exchange an authorization code from the PKCE flow for a user-controlled API key

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.ExchangeAuthCodeForAPIKeyResponse>

Errors

createAuthCode

Create an authorization code for the PKCE flow to generate a user-controlled API key

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<operations.CreateAuthKeysCodeResponse>

Errors

listOauthJwks

RFC 7517 JWK Set containing the public keys OpenRouter signs access tokens with.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.OAuthJwks>

Errors

createOauthToken

RFC 8693 token exchange. Presents a JWT from an issuer your organization trusts (Settings → Workload identity) and receives a short-lived OpenRouter access token that acts as the API key the matching federation policy targets.

Example Usage

Standalone function

The standalone function version of this method:

Parameters

Response

Promise<models.TokenExchangeResponse>

Errors