App Attribution
Identify your app with standard request headers
App attribution is optional, but it unlocks richer visibility in TheRouter.ai analytics and helps distinguish traffic across products and environments.
Headers to send
Include `HTTP-Referer` and `X-Title` headers. Use your canonical app URL and product name so dashboards remain consistent.
headers.sh
curl https://api.therouter.ai/v1/chat/completions -H "Authorization: Bearer $THEROUTER_API_KEY" -H "HTTP-Referer: https://myapp.example" -H "X-Title: My App" -H "Content-Type: application/json" -d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"hello"}]}'SDK configuration
TypeScript
const client = new OpenAI({
baseURL: "https://api.therouter.ai/v1",
apiKey: process.env.THEROUTER_API_KEY,
defaultHeaders: {
"HTTP-Referer": "https://myapp.example",
"X-Title": "My App",
},
});Operational guidance
Naming stability
Avoid changing titles frequently. Stable attribution names make long-term usage and ranking trends meaningful.
For staging or local traffic, use distinct titles like `My App (staging)` to prevent data mixing with production metrics.