Skip to content

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.

chat completion with attribution headers
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"}]
  }'
Both headers are self-reported and untrusted, and each is truncated to 200 characters. The values are stored on the usage log.

Leaderboard#

GET/v1/stats/apps

GET /v1/stats/apps is a public endpoint requiring no auth. It returns the top 20 apps ranked by token usage.

ParameterTypeRequiredDescription
periodstringOptionaldaily | weekly | monthly. Default weekly.
200 OK
{
  "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.

Values are self-reported and unverified. Calls with neither header, or with a status code of 400 or above, are excluded from the leaderboard.