Example Usage
import { CreateOauthTokenRequest } from "@openrouter/sdk/models/operations";
let value: CreateOauthTokenRequest = {
tokenExchangeRequest: {
federationPolicyId: "4b2f7d1e-8c3a-4e5f-9a6b-1c2d3e4f5a6b",
grantType: "urn:ietf:params:oauth:grant-type:token-exchange",
subjectToken: "<jwt from your identity provider>",
subjectTokenType: "urn:ietf:params:oauth:token-type:jwt",
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
httpReferer | string | :heavy_minus_sign: | The app identifier should be your app’s URL and is used as the primary identifier for rankings. This is used to track API usage per application. | |
appTitle | string | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter’s dashboard. | |
appCategories | string | :heavy_minus_sign: | Comma-separated list of app categories (e.g. “cli-agent,cloud-agent”). Used for marketplace rankings. | |
tokenExchangeRequest | models.TokenExchangeRequest | :heavy_check_mark: | N/A | { “federation_policy_id”: “4b2f7d1e-8c3a-4e5f-9a6b-1c2d3e4f5a6b”, “grant_type”: “urn:ietf:params:oauth:grant-type:token-exchange”, “subject_token”: “\u003cjwt from your identity provider\u003e”, “subject_token_type”: “urn:ietf:params:oauth:token-type:jwt” } |