Authentication

Supported API key headers and key handling rules.

Authentication

Send your OneRouter API key with every request. OpenAI-compatible clients should use Authorization: Bearer YOUR_API_KEY. Gemini-native clients may also use x-goog-api-key. Keys are issued from the console and use the OneRouter key format.

Authorization: Bearer YOUR_API_KEY

Accepted headers

ParameterTypeRequiredDescription
AuthorizationheaderrequiredRecommended for OpenAI-compatible and most SDK requests. Use `Bearer YOUR_API_KEY`.
x-api-keyheaderoptionalSupported for clients that send API keys directly in an API-key header.
x-goog-api-keyheaderoptionalSupported for Gemini-native clients and Google-compatible tooling.
api-keyheaderoptionalCompatibility header for selected clients.

Key safety

Keep API keys on the server side whenever possible. Do not embed production keys in public websites, mobile apps, screenshots, or client-side logs. Rotate a key immediately if it is exposed.