Skip to main content
POST
Exchange a workload identity token

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Body

application/x-www-form-urlencoded

RFC 8693 token exchange request body (application/x-www-form-urlencoded).

federation_policy_id
string<uuid>
required

The federation policy to evaluate, from Settings → Workload identity. Binds the exchange to one organization.

Example:

"4b2f7d1e-8c3a-4e5f-9a6b-1c2d3e4f5a6b"

grant_type
enum<string>
required

Must be urn:ietf:params:oauth:grant-type:token-exchange.

Available options:
urn:ietf:params:oauth:grant-type:token-exchange
Example:

"urn:ietf:params:oauth:grant-type:token-exchange"

subject_token
string
required

The JWT issued by your identity provider.

Required string length: 1 - 16384
Example:

"<jwt from your identity provider>"

subject_token_type
enum<string>
required

Must be urn:ietf:params:oauth:token-type:jwt.

Available options:
urn:ietf:params:oauth:token-type:jwt
Example:

"urn:ietf:params:oauth:token-type:jwt"

requested_token_type
enum<string>

Optional; when present must be urn:ietf:params:oauth:token-type:access_token.

Available options:
urn:ietf:params:oauth:token-type:access_token
Example:

"urn:ietf:params:oauth:token-type:access_token"

scope
enum<string>

Optional; only inference is available.

Available options:
inference
Example:

"inference"

Response

Access token issued

RFC 8693 token exchange response.

access_token
string
required

A short-lived JWT to send as Authorization: Bearer to the inference API.

Example:

"<short-lived openrouter access token jwt>"

expires_in
integer
required

Seconds until the access token expires: at most 15 minutes, and never later than the subject token expires.

Example:

900

issued_token_type
enum<string>
required
Available options:
urn:ietf:params:oauth:token-type:access_token
Example:

"urn:ietf:params:oauth:token-type:access_token"

scope
string
required
Example:

"inference"

token_type
enum<string>
required
Available options:
Bearer
Example:

"Bearer"