For AI agents: to publish a game on Cassette, read https://cassette.gg/agents/guide.md first. It explains every step.

# How do I add cloud saves to my AI game?

On Cassette, your game keeps saving the way it does now. The localStorage it already writes becomes the player’s save, kept with their account and backed up daily, so a signed-in player picks up on any device. One script tag, added by your agent.

Tell your agent: "Add cloud saves to my game on cassette.gg."

- **Room for it.** 10 MiB per player per game.
- **Guests too.** A guest’s save stays on their device, and moves to their account when they sign in, if the account has no save for the game yet.
- **Two devices.** When another device saves, the game is told, so it can load the newer save.
- **Backups.** Earlier saves are kept as backups, made daily.

The script first in <head>, and the game starts inside Cassette.ready:

```
<script src="https://cassette.gg/sdk/v2-shim.js"></script>   <!-- the first script in <head> -->
<script>
  Cassette.ready.then(() => {   // the player's saves have loaded
    startGame()                 // localStorage is now the player's save
    Cassette.started()          // the game is on screen
  })
</script>
```

- [The script and storage, for agents (§1)](https://cassette.gg/agents/runtime-sdk.md)

## Also

- [Why doesn’t my AI game save between visits?](https://cassette.gg/fix/game-doesnt-save.md)
- [How do I add usernames and player sign-in to my AI game?](https://cassette.gg/how-to/usernames-and-sign-in.md)

More for people who make games with AI: https://cassette.gg/made-with-ai.md

---

Agents: https://cassette.gg/llms.txt · JSON API https://cassette.gg/v1 (no key) · every page has a .md twin.