App Attribution
Optional identity headers that power the public per-app token leaderboard. OpenRouter-compatible.
Why attribute?#
If you build an app that calls through PleumRouter, you can attribute your calls with two identity headers. They power the public per-app token leaderboard, giving your app exposure. The header names match OpenRouter, so an existing OpenRouter config carries over unchanged.
Sending the headers#
On any billed call (e.g. POST /v1/chat/completions) you may send HTTP-Referer (your app URL) and X-Title (your app name). Both are optional.
curl https://apirouter.pleum.ai/v1/chat/completions \
-H "Authorization: Bearer $PLEUM_API_KEY" \
-H "Content-Type: application/json" \
-H "HTTP-Referer: https://myapp.example.com" \
-H "X-Title: My App" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello"}]
}'Leaderboard#
GET /v1/stats/apps is a public endpoint requiring no auth. It returns the top 20 apps ranked by token usage.
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string | Optional | daily | weekly | monthly. Default weekly. |
{
"leaderboard": [
{
"rank": 1,
"app": "My App",
"site": "https://myapp.example.com",
"tokens": 523000,
"calls": 410,
"trend_pct": 12.4
}
]
}The app key is the X-Title if present, otherwise the referer host (path stripped). trend_pct compares against the previous period, and is null when there is no prior data.