Tokscale
Badges for Tokscale — AI token usage, cost, rank, and active days from the global leaderboard.
Display live stats from Tokscale, the AI token usage leaderboard for developers using Claude Code, OpenCode, Codex, Cursor, Pi, and more.
Available badges
| Badge | Endpoint | Description |
|---|---|---|
| Tokens | /tokscale/tokens/{username} | Total token consumption |
| Cost | /tokscale/cost/{username} | Estimated total cost |
| Rank | /tokscale/rank/{username} | Global leaderboard rank |
| Active Days | /tokscale/active-days/{username} | Days with AI activity |
| Stats | /tokscale/stats | Global user count |
The default endpoint /tokscale/{username} returns the token count.
Quick examples
Finding your username
Your Tokscale username is your GitHub username. To appear on the leaderboard:
- Install the CLI:
bunx tokscale - Login:
bunx tokscale login - Submit your usage:
bunx tokscale submit
Visit your profile at https://tokscale.ai/u/{username} to verify.
Data source
Uses the Tokscale API. Returns data from the user's profile including all-time stats. No API key required. Cached 10 minutes.
Endpoint details
Use these sections when you need the exact URL shape or a focused example for a specific badge type.
Tokscale Active Days
This section covers the tokscale/active-days badge endpoint.
Show how many days the user had at least one AI interaction.
Path Parameters


URL format
/tokscale/active-days/{username}.svgExamples
Copy-paste examples
Default — total days with AI activity
Branded — Tokscale blue background
Tokscale Cost
This section covers the tokscale/cost badge endpoint.
Show the estimated total cost of AI token usage based on LiteLLM pricing data.
Path Parameters


URL format
/tokscale/cost/{username}.svgExamples
Copy-paste examples
Default — estimated total cost
Branded — Tokscale blue background
Tokscale Rank
This section covers the tokscale/rank badge endpoint.
Show the user's position on the Tokscale global leaderboard.
Path Parameters


URL format
/tokscale/rank/{username}.svgExamples
Copy-paste examples
Default — global leaderboard position
Branded — Tokscale blue background
Tokscale Tokens
This section covers the tokscale/tokens badge endpoint.
Show the total number of tokens consumed across all AI coding agents.
Path Parameters


URL format
/tokscale/tokens/{username}.svg/tokscale/{username}.svgBoth formats return the same badge. The default endpoint shows token count.
Examples
Copy-paste examples
Default — total token consumption
Branded — Tokscale blue background
