Bearer tokens to specialized headers like x-api-key, or even dynamic OAuth2 flows.
Open Next Router (ONR) abstracts this entirely. Your clients (the users of your gateway) only need to authenticate with ONR using one standard format (Authorization: Bearer <your-client-key>), and ONR deals with the translation to the upstream providers.
Standard Token Injection
The most common approach for providers like OpenAI, Anthropic, or DeepSeek is a simple static API key. When you configurekeys.yaml, you map a client token to an upstream profile. In the DSL loaded from config/onr.conf and its included provider files, you define how ONR injects the upstream key (accessible dynamically as $channel.key).
Bearer Token
Custom Headers
For providers like Anthropic that ask forx-api-key:
OAuth 2.0 Dynamic Tokens
Some providers (like Google Gemini on Vertex AI, or private Enterprise Clouds) forbid long-lived static API keys. They require exchanging a Service Account Key or a Refresh Token for a short-lived Access Token before the API call can be made. ONR’s DSL natively handles the OAuth exchange lifecycle invisibly on the fly.Built-in OAuth Profiles
For known providers, you can use the built-in preset modes:Vertex AI Service Account Files
For Vertex AI, configure the provider DSL to use Google service account OAuth and configure the actual file path inkeys.yaml.
$credential.project_id and $channel.location when constructing Vertex paths.