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_KEYAccepted headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | header | required | Recommended for OpenAI-compatible and most SDK requests. Use `Bearer YOUR_API_KEY`. |
| x-api-key | header | optional | Supported for clients that send API keys directly in an API-key header. |
| x-goog-api-key | header | optional | Supported for Gemini-native clients and Google-compatible tooling. |
| api-key | header | optional | Compatibility 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.