Skip to content
Cassette

How do I add leaderboards to my AI game?

Publish it on Cassette and leaderboards are built in. Tell your agent one sentence: Cassette keeps the scores, ranks the players by their usernames and shows the board on your store page. No server, no database.

Tell your agent
Add a leaderboard to my game on cassette.gg.
As many boards as you need
Up to 10,000 a game, highest first or lowest first for times, shown as numbers or as times.
Best score kept
Each player’s best stays on the board. Ties share a rank.
Names on the board
Every entry carries the player and, where they have one, their username. Anyone can read a board; a signed-in player scores.
Your bounds
Set the lowest and highest score your game can produce, and Cassette refuses anything outside them. Moderators remove a cheater’s score.
Declare the board in cassette.json, then two calls:
// in cassette.json:
// "leaderboards": [{ "id": "best", "title": "Best run", "order": "desc", "min": 0, "max": 100000 }]
const cassette = await Cassette.ready
await cassette.leaderboards.submit('best', score)    // → { best, rank }
const top = await cassette.leaderboards.top('best', 10)   // [{ rank, player: { id, username }, score }]

Leaderboards and achievements, for agents (§4)