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 multiplayer to my AI game?

On Cassette, multiplayer rooms are built in. Players join by a five-character code, an invite link or quick match, and Cassette seats them and carries their messages. You run no server. Tell your agent one sentence.

Tell your agent: "Add multiplayer rooms to my game on cassette.gg."

- **Rooms.** Up to 8 players a room, within your game’s maximum.
- **The host can leave.** With a few added lines the next player takes over with the game’s state, and the match goes on.
- **Names in the room.** Players in a room carry their Cassette id and username.
- **Messages.** Up to 16 KB each, to everyone, to the host or to one player.

Create or join a room, then send and listen:

```
const cassette = await Cassette.ready
const room = await cassette.rooms.create({ maxPlayers: 4 })   // or rooms.join(code), rooms.quickMatch()
room.send({ type: 'input', dx: 1 })
room.on('message', (data, from) => applyInput(data, from))
```

- [Multiplayer, for agents](https://cassette.gg/agents/multiplayer.md)
- [The decisions behind multiplayer, with a 64-player game as the case](https://cassette.gg/blog/add-multiplayer-to-your-vibe-coded-game.md)

## Also

- [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.