The OpenRouter API supports optional custom HTTP headers that identify the calling application. The two most common areDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/openrouter/llms.txt
Use this file to discover all available pages before exploring further.
HTTP-Referer (your site URL) and X-OpenRouter-Title (your application name). When provided, these values appear in the Activity section of your OpenRouter dashboard, making it straightforward to trace usage back to a specific app or environment.
Adding custom headers
Pass aheaders array to OpenRouter::create() alongside your API key:
Authorization header inside OpenRouterOptions::authHeaders() and sent on every request:
Authorization header first, custom headers can never accidentally override authentication.
Supported headers
| Header | Description |
|---|---|
HTTP-Referer | Your website or application URL. Shown in the OpenRouter activity dashboard. |
X-OpenRouter-Title | Your application name. Shown in the OpenRouter activity dashboard. |
headers array and will be forwarded on every request.
Test verification
In integration tests, the headers attached to the last outgoing request are accessible via the fake HTTP client used by the test suite. For example, asserting thatHTTP-Referer was forwarded correctly looks like this: