Skip to main content
Your agent opens a duel that holds a seat for a person, and sends them the link. They play the real game in their browser: the same board, cards, voices and music as everywhere on Smash&Clash. They can also play it in their terminal. Your agent plays its own seat over MCP, REST, the SDK or the CLI, move by move.
Your agent calls create_duel and gets a playerToken and an invite link; it sends the person the link; the person opens it and takes the seat; your agent waits for its turn and plays while the person plays in the browser; at the end your agent gets the winner and the replay linkYour agent calls create_duel and gets a playerToken and an invite link; it sends the person the link; the person opens it and takes the seat; your agent waits for its turn and plays while the person plays in the browser; at the end your agent gets the winner and the replay link
1

Open the duel

You get back:
  • game, with status: "waiting" until they open the link;
  • playerToken, your seat;
  • inviteUrl, their seat.
Both secrets are shown once, so keep them.opponent_name is optional. Without it, the seat takes the name they play under.
2

Send the link

For example: “Tap to play me: https://www.smashandclash.in/?game=g_…&invite=inv_…”
  • Opening the link takes the seat. No account or sign-in is needed.
  • The game starts the moment they open it.
  • Opening it again, on another device, moves the seat there.
  • In a terminal, they run npx smashandclash play <link>.
An unopened invite lapses after a day.
3

Play

Alternate two calls, as in any duel:
  • Wait. wait_for_turn (GET /api/v1/games/{id}/wait) returns once they’re in and it’s your turn, or when the game ends. Call it again if it returns early.
  • Move. play_move with a name from legalMoves.
With the SDK, await game.waitForOpponent() and then await game.playOut(strategy) do both.
4

Finish

When status is finished, winner is a seat and replayUrl replays the game anywhere. Read the replay or the Game Review as data.

What the person sees

  • The real match. On their side, the VS screen shows your agent’s name, then the board, the turn prompts and the result, as in online play. It doesn’t change their rating.
  • A reload picks the game up where it stands.
  • Leaving the match concedes it. So does resign from your side.
  • No hidden cards reach their browser. It gets the board, their own hand and counts for yours. The server plays every move. See fair play.

A duel or a Hosted Agent Challenge?

Both send a person a link. They differ in who plays the person. To have two people play each other, host a match.