# stomped > stomped is a ranked arena for Super Smash Bros. Melee bots: host a bot as an HTTP server, register its URL, and it is auto-matched into 1v1 games run on a headless Slippi Dolphin. A match is one WebSocket to the bot: JSON steps (character, ready, game, over), the raw .slp event stream in and 12-byte controller pads out. API base: https://api.stomped.dev This file is the complete reference: the docs, the match socket spec, and every API endpoint and schema, generated from the contract the server implements. # Start Stomped is a ranked arena for your SSBM bots. Build an SSBM bot, sign it up, and stomped will automatically match you against other bots. Find out where you match up! These docs will walk you through how to connect your bot to stomped once you have set up an SSBM playing bot. If you have any questions, ask an LLM to check out [llms-full.txt](https://docs.stomped.dev/llms-full.txt) or join the [discord](https://discord.gg/s8yaQ97QSy). ## So How Do I Make A Bot 1. **Build your melee bot.** Create your bot that outputs controller inputs and accepts an stream of slp data. 2. **Deploy your bot on a server.** You must host your bot in a way that you can accept websocket connections from the outside web ([how](https://docs.stomped.dev/quickstart/#3-put-it-on-the-internet)). 3. **Sign up your bot.** Create an account, or sign into stomped.dev. Head to the [Bots](https://stomped.dev/bots) tab and enter the address of the publicly hosted server. Stomped will send a ping to your server and upon sending a response, your bot is signed up on for the ladder. 4. **Thats it!** You can sit back and watch your bots first games. The [Quickstart](https://docs.stomped.dev/quickstart/) has a connector examples for typescript and python once you have a bot running. ## The Game The game will be played on a standard tournament SSBM setup, without gameplay codes like UCF. 1v1, 4 stocks, 8 minutes, no items, the six legal stages, blind character pick, and no sudden death. ## After It Plays - Every match has a page: the result, the replay, and a live view while it runs. - Ratings start near 0 and climb as the bot proves itself. Expect a game every 7 to 10 minutes. - Pause the bot before taking its server down. A dead server misses games and bleeds rating. - The [API](https://docs.stomped.dev/reference/) lets a deploy script re-register the bot or a cron job pause it. You never need it to play. ## For AIs [/llms.txt](https://docs.stomped.dev/llms.txt) is this page plus a map; [/llms-full.txt](https://docs.stomped.dev/llms-full.txt) is the complete spec and API reference in one file; [/openapi.json](https://docs.stomped.dev/openapi.json) is the API. # Quickstart Your bot is a web server. When a match starts, stomped opens a WebSocket to it, sends the game frame by frame, and your bot sends controller inputs back. Here's how to get one on the ladder. ## 1. Make a Melee Bot Yeah, this is the hard part, and we can't do it for you. You need code that looks at the game and decides what to press, every frame. Some places to start: - [slippi-ai](https://github.com/vladfi1/slippi-ai) is Phillip, the neural net that learned Melee from Slippi replays. It's open source. - [SmashBot](https://github.com/altf4/SmashBot) is a hand-coded Fox, built on [libmelee](https://github.com/altf4/libmelee). - The [Slippi replay spec](https://github.com/project-slippi/slippi-wiki/blob/master/SPEC.md) explains every event your bot gets to read. The example below just walks at the opponent and presses A. Swap in your own brain. ## 2. Make a Server for It The server has two jobs: answer `GET /ping` with `pong`, and accept a WebSocket at the same URL. Over the socket, text messages are the match steps (`character`, `ready`, `game`, `over`) and binary messages are the game itself: one in per frame, one 12-byte pad back per frame. When you see frame F, send the pad for `F + 1 + inputDelayFrames`. ```ts // bot.ts: Marth walks at the opponent and taps A in reach const CHARACTER = 9; // Marth; the ids are in the character table on Match Socket const A = 0x0100; const REACH = 10; // close enough to hit const EVENT_PAYLOADS = 0x35; // opens the stream: the payload size of every other event const POST_FRAME = 0x38; // one per player per frame: position, percent, stocks, action const FRAME_BOOKEND = 0x3c; // closes a frame: time to send a pad // i32 frame · u16 buttons · u8 stickX · u8 stickY · u8 cstickX · u8 cstickY · u8 L · u8 R, little-endian function pad(frame: number, buttons = 0, stickX = 128): Uint8Array { const bytes = new Uint8Array(12); const view = new DataView(bytes.buffer); view.setInt32(0, frame, true); view.setUint16(4, buttons, true); bytes.set([stickX, 128, 128, 128, 0, 0], 6); return bytes; } class Match { port = 0; lead = 5; // having seen frame F, the pad for F + lead is the one that lands sizes = new Map(); x = [0, 0]; // where each player stands // a message is a run of events: a command byte, then that command's payload *events(msg: Uint8Array): Generator<[number, DataView]> { const view = new DataView(msg.buffer, msg.byteOffset); for (let i = 0; i < msg.length; ) { const cmd = msg[i]; if (cmd === EVENT_PAYLOADS) { const n = msg[i + 1]; for (let j = i + 2; j < i + 1 + n; j += 3) this.sizes.set(msg[j], view.getUint16(j + 1)); i += 1 + n; } else { const size = this.sizes.get(cmd) ?? 0; yield [cmd, new DataView(msg.buffer, msg.byteOffset + i + 1, size)]; i += 1 + size; } } } text(ws: Bun.ServerWebSocket, step: any) { this.port = step.port; this.lead = 1 + step.inputDelayFrames; if (step.step === "character") ws.send(JSON.stringify({ step: "character", character: CHARACTER, costume: 0 })); if (step.step === "ready") ws.send(JSON.stringify({ step: "ready" })); if (step.step === "game") { // the game frame names the last finished frame: cover the first `lead` frames now for (let f = step.frame + 1; f <= step.frame + this.lead; f++) ws.send(pad(f)); // reconnected mid-game: the stream resumes without its header, ask for it if (step.frame > -124) ws.send(JSON.stringify({ step: "replay" })); } } binary(ws: Bun.ServerWebSocket, msg: Uint8Array) { if (!this.sizes.size && msg[0] !== EVENT_PAYLOADS) return; // not readable until the header for (const [cmd, payload] of this.events(msg)) { if (cmd === POST_FRAME) this.x[payload.getUint8(4)] = payload.getFloat32(9); if (cmd === FRAME_BOOKEND) { const frame = payload.getInt32(0) + this.lead; const dx = this.x[1 - this.port] - this.x[this.port]; // this pad lands `lead` frames from now, and a walking pair closes about 3 units a frame if (Math.abs(dx) < REACH + 3 * this.lead) ws.send(pad(frame, frame % 2 ? A : 0)); else ws.send(pad(frame, 0, dx > 0 ? 188 : 68)); } } } } Bun.serve({ port: 3000, fetch(request, server) { if (new URL(request.url).pathname.endsWith("/ping")) return new Response("pong"); if (server.upgrade(request, { data: new Match() })) return; return new Response("websocket only", { status: 400 }); }, websocket: { maxPayloadLength: 64 * 1024 * 1024, // a `replay` answer is the whole game so far message(ws, raw) { if (typeof raw === "string") ws.data.text(ws, JSON.parse(raw)); else ws.data.binary(ws, new Uint8Array(raw)); }, }, }); ``` ```sh bun bot.ts ``` ```python # bot.py: Fox walks at the opponent and taps A in reach import asyncio import http import json import struct from websockets.asyncio.server import serve CHARACTER = 2 # Fox; the ids are in the character table on Match Socket A = 0x0100 REACH = 10 # close enough to hit EVENT_PAYLOADS = 0x35 # opens the stream: the payload size of every other event POST_FRAME = 0x38 # one per player per frame: position, percent, stocks, action FRAME_BOOKEND = 0x3C # closes a frame: time to send a pad def pad(frame, buttons=0, stick_x=128): # i32 frame · u16 buttons · u8 stickX · u8 stickY · u8 cstickX · u8 cstickY · u8 L · u8 R, little-endian return struct.pack("H", msg, j + 1)[0] for j in range(i + 2, i + 1 + n, 3)} i += 1 + n else: yield cmd, msg[i + 1 : i + 1 + self.sizes.get(cmd, 0)] i += 1 + self.sizes.get(cmd, 0) async def text(self, ws, step): self.port = step["port"] self.lead = 1 + step["inputDelayFrames"] if step["step"] == "character": await ws.send(json.dumps({"step": "character", "character": CHARACTER, "costume": 0})) if step["step"] == "ready": await ws.send(json.dumps({"step": "ready"})) if step["step"] == "game": # the game frame names the last finished frame: cover the first `lead` frames now for f in range(step["frame"] + 1, step["frame"] + 1 + self.lead): await ws.send(pad(f)) # reconnected mid-game: the stream resumes without its header, ask for it if step["frame"] > -124: await ws.send(json.dumps({"step": "replay"})) async def binary(self, ws, msg): if not self.sizes and msg[0] != EVENT_PAYLOADS: return # not readable until the header for cmd, payload in self.events(msg): if cmd == POST_FRAME: self.x[payload[4]] = struct.unpack_from(">f", payload, 9)[0] if cmd == FRAME_BOOKEND: frame = struct.unpack_from(">i", payload)[0] + self.lead dx = self.x[1 - self.port] - self.x[self.port] # this pad lands `lead` frames from now, and a walking pair closes about 3 units a frame if abs(dx) < REACH + 3 * self.lead: await ws.send(pad(frame, A if frame % 2 else 0)) else: await ws.send(pad(frame, 0, 188 if dx > 0 else 68)) async def handler(ws): match = Match() async for msg in ws: if isinstance(msg, str): await match.text(ws, json.loads(msg)) else: await match.binary(ws, msg) def process_request(connection, request): if request.path.endswith("/ping"): return connection.respond(http.HTTPStatus.OK, "pong") async def main(): async with serve(handler, "0.0.0.0", 3000, process_request=process_request, max_size=None): await asyncio.get_running_loop().create_future() asyncio.run(main()) ``` ```sh pip install websockets && python bot.py ``` Run it, and `curl localhost:3000/ping` should say `pong`. ## 3. Put It on the Internet stomped needs a public `https` URL for your bot. Two options: - **Put it on a cloud box in US East.** Any VM or container host with a public `https` URL works. The arena is in Ashburn, Virginia and a pad is due 11 ms after its frame is sent, so the box should be in the same region; from further away your bot plays extra frames behind (see [Timing](https://docs.stomped.dev/reference/match-socket/#timing)). - **Run it at home through a tunnel.** `cloudflared tunnel --url http://localhost:3000` or `ngrok http 3000` gives you a public `https` URL pointing at your machine, WebSockets included, with your home's round trip on every pad. **Heads up: this opens a port on your personal computer to the internet.** The bot above only answers `/ping` and the socket, but make sure you know what you're exposing. Your URL is also your bot's password, so register something unguessable like `https://your-host/7f3a9c2e-…`. The bot above answers on any path. ## 4. Register It Sign in at [stomped.dev](https://stomped.dev), go to [Bots](https://stomped.dev/bots), paste the URL. stomped pings it and opens a socket right then, and if both work your bot is on the ladder and gets its first match within a few minutes. ## 5. Make It Good - **Read more of the game.** The binary messages are the raw `.slp` event stream, the same bytes as the replay file. The bots above only pull out two fields. The [stream layout](https://docs.stomped.dev/reference/match-socket/#the-game-server-bot) and the Slippi spec list everything else, and in TypeScript slippi-js's `SlpStream` parses all of it for you. - **Don't be late.** The game runs at 60 Hz and your pad has 11 ms from when the frame was sent, so host your bot next to the arena (US East). Late pads count as neutral. See [Timing](https://docs.stomped.dev/reference/match-socket/#timing). - **Check the handshake** so random people can't start games on your server: [The Handshake](https://docs.stomped.dev/reference/match-socket/#the-handshake). - **Give it to an agent.** [/llms-full.txt](https://docs.stomped.dev/llms-full.txt) is the whole spec and API in one file. # Match Socket A match is one WebSocket from stomped to your bot: when the match starts stomped connects to the registered URL (`https` upgraded to `wss`) and closes the socket when the match is over. Your bot never polls and never calls stomped. The socket carries: 1. JSON text frames, server → bot: the current **step**. The server always tells you where you are. 2. JSON text frames, bot → server: the reply the step asks for, or a request: `ping`, `replay`. 3. Binary messages, server → bot: the game as the raw `.slp` event stream, one message per frame. 4. Binary messages, bot → server: 12-byte controller pads, one per frame. ## The Handshake The upgrade request carries three headers: | header | value | | --- | --- | | `x-stomped-match` | the match id this socket will carry; `deploy-check` for the registration probe | | `x-stomped-timestamp` | unix milliseconds, as a string | | `x-stomped-signature` | `base64(ed25519_sign(".."))` under stomped's platform key, where `` is your bot's registered URL, byte for byte | The platform public key is `GET https://api.stomped.dev/.well-known/stomped.json`, `{"publicKey": ""}`; fetch it once and cache it. The URL is your bot's credential: it is one bot's alone (a second registration of it, by anyone and in any spelling — trailing slash, host case, default port; stomped stores the URL as it parses, refuses a query or fragment, and returns the URL it stored — is refused), so give it an unguessable path such as `https://bots.example.com/7f3a9c2e…`, not a bare hostname, which is public in DNS and certificate logs. Verifying the handshake is optional on top of that and stops spoofed games: reject a timestamp more than 30 seconds from your clock, verify the signature over your own registered URL (a handshake captured at another bot does not verify at yours), and refuse the upgrade with `401`. Your server has 3 seconds to complete the upgrade; a failed connect is retried every second until the game starts, so a bot that is restarting when the match is seated still plays if it is back within the `character` and `ready` steps. The upgrade offers no WebSocket subprotocol; there is nothing to echo. ## The Deploy Check Registration, and every later URL change, probes the server before the bot can be seated: 1. `GET /ping` must answer `2xx` with the body `pong` within 1 second. Redirects are not followed. 2. `` must accept the signed WebSocket upgrade, with `x-stomped-match: deploy-check`. stomped closes it right away; no step is sent. Either step failing refuses the request with `400` and a message naming the step. In production the URL must be `https` and resolve to a public address; private and loopback ranges are refused at registration and again at every connect. ## The Steps Four steps, in order. Every frame the server sends is `{"step": …}` plus the whole match state (`matchId`, your `port`, the `opponent`, the `stage`, `inputDelayFrames`, `sentAt`), so one message tells a bot everything, whether it just connected, reconnected, or asked. Each also carries `version`, the version of this spec the frames follow (1 today); a change that would break a bot written against it bumps the number. Your reply echoes the step. Each step's page has the exact fields and an example: | step | the server sends | you reply | deadline | | --- | --- | --- | --- | | [`character`](https://docs.stomped.dev/reference/match-socket/character/) | pick your character | `{"step":"character","character":2,"costume":1}` | 5 s, else a random character | | [`ready`](https://docs.stomped.dev/reference/match-socket/ready/) | both picks | `{"step":"ready"}` | 10 s, then the game starts anyway | | [`game`](https://docs.stomped.dev/reference/match-socket/game/) | the game is on | nothing: pads | | | [`over`](https://docs.stomped.dev/reference/match-socket/over/) | how it ended | nothing: the socket closes | | Both bots get `character` at the same instant and neither reply is relayed: the picks are blind, revealed to both in `ready`. The stage is drawn before the picks, at random from Battlefield (31), Final Destination (32), Dream Land N64 (28), Yoshi's Story (8), Fountain of Dreams (2), Pokémon Stadium (3), and is in every frame. The characters, with how many costumes each has: | id | character | costumes | | --- | --- | --- | | 0 | Captain Falcon | 0–5 | | 1 | Donkey Kong | 0–4 | | 2 | Fox | 0–3 | | 3 | Mr. Game & Watch | 0–3 | | 4 | Kirby | 0–5 | | 5 | Bowser | 0–3 | | 6 | Link | 0–4 | | 7 | Luigi | 0–3 | | 8 | Mario | 0–4 | | 9 | Marth | 0–4 | | 10 | Mewtwo | 0–3 | | 11 | Ness | 0–3 | | 12 | Peach | 0–4 | | 13 | Pikachu | 0–3 | | 14 | Ice Climbers | 0–3 | | 15 | Jigglypuff | 0–4 | | 16 | Samus | 0–4 | | 17 | Yoshi | 0–5 | | 18 | Zelda | 0–4 | | 19 | Sheik | 0–4 | | 20 | Falco | 0–3 | | 21 | Young Link | 0–4 | | 22 | Dr. Mario | 0–4 | | 23 | Roy | 0–4 | | 24 | Pichu | 0–3 | | 25 | Ganondorf | 0–4 | **Errors.** A rejected reply (not JSON, no or wrong `step`, a character id outside 0–25, a costume the character lacks, a text frame over 64 KB) gets the current step again with `error` set to the reason, same deadline, and you may reply again. A pad that is not 12 bytes is answered the same way. Each reason is told once per match. If the deadline passes with no valid reply, the step resolves on its own and the next step follows. **Reconnects.** If your socket drops, stomped reconnects every second and sends the current step's frame. Nothing you missed is replayed on its own; those frames were played with neutral pads. In `game` the live frames resume at once, without the header: keep the parser from before the drop (each frame message is complete in itself, so it reads on) or ask for a [`replay`](https://docs.stomped.dev/reference/match-socket/replay/). A [`ping`](https://docs.stomped.dev/reference/match-socket/ping/) at any time gets the current step's frame back. ## The Game, Server → Bot Binary frames carry the raw `.slp` event stream, byte for byte as the replay file: 1. The first message is everything before the first frame: the Event Payloads event (`0x35`), Game Start (`0x36`) and the Gecko List, carried as Message Splitter (`0x10`) events whose internal command is `0x3D` (about a hundred of them). A streaming parser sees the splitter events, not a Gecko List command; only a file reader reassembles them. 2. Then one message per game frame holding exactly that frame's events in file order: Frame Start (`0x3A`), Pre-Frame Update (`0x37`) per port, Item Update (`0x3B`) per item, Post-Frame Update (`0x38`) per port, Frame Bookend (`0x3C`). Character projectiles are items, so Item Updates appear with items off. 3. The last message is Game End (`0x39`). Concatenating every binary message (after a reconnect, from the `replay` message on) is byte-identical to the `raw` block of the stored replay (`GET /matches/{id}.slp`). Feed the messages to slippi-js's `SlpStream`, or any streaming `.slp` parser, as they are. Frame numbering is the `.slp` frame index: the first frame is −123, play starts at 0. Your `port` is the Slippi player index; read your spawn from the first Post-Frame Update (on Battlefield port 0 starts bottom centre, port 1 above the top platform). The game is Melee NTSC 1.02, 4 stocks, 8 minutes, no items, damage ratio 1.0, Pokémon Stadium frozen, pause off, and vanilla: no UCF and no Slippi gameplay codes, so wobbling is legal and there is no ledge grab limit. Game Start's per-player controller fix still reads UCF because the recorder copies a toggle nothing sets; the Gecko List is the truth. ## Pads, Bot → Server Binary frames of exactly 12 bytes, little-endian (the `Pad` schema after the frame): | offset | type | field | | --- | --- | --- | | 0 | i32 | frame | | 4 | u16 | buttons | | 6 | u8 | stickX | | 7 | u8 | stickY | | 8 | u8 | cstickX | | 9 | u8 | cstickY | | 10 | u8 | L | | 11 | u8 | R | Buttons use the GameCube physical bit layout, as the slp pre-frame `physicalButtons`: DPAD_LEFT `0x0001`, DPAD_RIGHT `0x0002`, DPAD_DOWN `0x0004`, DPAD_UP `0x0008`, Z `0x0010`, R `0x0020`, L `0x0040`, A `0x0100`, B `0x0200`, X `0x0400`, Y `0x0800`, START `0x1000`. Sticks are raw 0–255 with centre 128; triggers are raw 0–255 with 0 released. The `L` and `R` bits are the triggers' digital click: Melee reads the bit as a full press whatever the byte says, and the byte alone as an analog press (light shield). The game applies its own dead zones; nothing is pre-processed. Neutral is `buttons=0, sticks=128, triggers=0`. - The pad for frame F is what the game polls at frame F. You may send pads for any future frame up to 600 frames past the last poll; the last one received before the poll wins. - A pad for a frame already polled, or beyond that window, is ignored. A message that is not 12 bytes is ignored, and told once. - A frame polled without a pad from you plays neutral and counts in `missed`, on the `over` frame and on the match record. ## Timing **The clock.** The engine runs at a real 60 Hz: frame n's pads are read at its tick, 16.7 ms after the previous frame's, and the frame is computed in about 5 ms. Frames never come faster than that. Whatever holds a frame past its tick stalls the game for that long and the ticks resume from the late frame; there is no catch-up. **The delay.** You see the game `inputDelayFrames` (1 frame) behind the engine: frame F's events are sent to you once frame `F + inputDelayFrames` is done, so the pads up to that frame are already read. Having seen frame F's bookend, send the pad for `F + 1 + inputDelayFrames`: the first one still open. It is read at the next tick. **The budget.** That pad is due 11 ms after frame F's events were sent to you, measured on stomped's clock from the send to the pad's arrival, so it covers the network both ways and your compute: one frame minus the engine's share. In a clean frame the budget ends just before the tick, so the game is exactly 60 Hz and a late pad is polled neutral at the tick. If the engine or the arena is slow, the send is later and the deadline moves with it: the budget is never shortened, the game waits. Whether your socket was up when the frame went out does not matter. The arena runs in Ashburn, Virginia (US East); host next to it. A bot whose round trip is longer than the budget still plays by aiming further ahead: the pad for `F + k` lands if it arrives before frame `F + k` is read, so a bot with a 25 ms round trip sends the pad for `F + 3` and plays two frames behind the rest. The stream tells you whether you made it: each frame's pre-frame event carries the controller the game read for your port, so a pad that arrived late shows up there as neutral. **The first frames.** The `game` frame goes out before the engine boots and says the last frame the engine finished (`frame`, −124 at the start): send the pads for `frame + 1` through `frame + 1 + inputDelayFrames` as soon as you receive it, then one per bookend. The engine's boot takes seconds; they will be there in time. The same rule covers a reconnect. Frame −122 is a Melee lag frame and is polled with −123's pad, exactly as on hardware. ## How a Game Ends - **Stocks.** The last bot with a stock wins, on the frame the other's last stock is lost. Both lost on the same frame is a draw. - **Time.** When the timer runs out, more stocks wins; equal stocks, lower percent wins; equal both is a draw. Percent is what the game holds on the final frame, so a bot KO'd just before time stands at 0 after its respawn. No sudden death; the replay's own Game End placements are not used. - **Forfeit.** A bot forfeits when no pad of its lands for 300 consecutive polls, 5 seconds of game time, whether its socket is down, it sends nothing, or its pads keep arriving after their frame was polled. The game is stopped; in the replay a forfeit is a no-contest Game End (method 7) whose LRAS initiator is the forfeiting port. A bot that has not connected by the time the game would start (the end of `ready`) forfeits before the game is run; the other bot picks and readies as usual and is then sent `over`. Forfeits are rated, `score` 0 against 4; both bots forfeiting together is a draw. - **No game.** If neither bot connects the match is aborted: no result, no ratings, and both miss streaks grow. If the engine breaks (a crash, or the match outliving its 12-minute wall clock) the match is aborted unrated with `endReason: "engine"`, and both bots still get `over`. ## The End `over` is the last frame; the server closes the socket after it. The result is on the match record, `GET /matches/{id}`, and the replay at `GET /matches/{id}.slp`. While the game runs, `GET /live/{id}` shows each port's latest stocks, percent and position. # Match Socket Steps Every step frame the server sends and every reply, as schemas. ### character Server sends: Pick your character. Late or invalid past the deadline: a random character, costume 0. ```json { "step": "character", "version": 1, "sentAt": 1761740000123, "matchId": "Xk3p9QaB", "mode": "live", "port": 1, "opponent": { "botId": "b7Qm2ZkA", "name": "rusher" }, "stage": 31, "inputDelayFrames": 1, "deadlineAt": 1761740005123 } ``` - `step` (`"character"`) - `version` (integer): The match socket version these frames follow; a breaking change bumps it. - `sentAt` (integer): When the server sent this frame, unix milliseconds. - `matchId` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `port` (`0` | `1`): Your port, 0 or 1 — the Slippi player index in the event stream. - `opponent` (object) - `botId` (string) - `name` (string) - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): The stage this match is played on. - `inputDelayFrames` (integer): How many frames behind the engine you see the game: frame F reaches you once frame F + inputDelayFrames is done, so having seen F, send the pad for F + 1 + inputDelayFrames — the first one still open, due at the next tick. - `error` (string, optional): Present when your last reply was rejected and the step is asked again. A log line, not something to parse. - `deadlineAt` (integer): Reply before this, unix milliseconds on the server's clock. You reply: Your pick. Both ports may play the same character in the same costume. ```json { "step": "character", "character": 2, "costume": 1 } ``` - `step` (`"character"`) - `character` (`0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` | `10` | `11` | `12` | `13` | `14` | `15` | `16` | `17` | `18` | `19` | `20` | `21` | `22` | `23` | `24` | `25`): A playable character's slp external id (`Character` in @slippi/slippi-js): 0 Captain Falcon … 25 Ganondorf. - `costume` (integer (0–5)): Costume index, 0 = default. Characters have 4 to 6; see the character list. ### ready Server sends: Both picks are in. Prepare for the matchup and say when you are set; at the deadline the game starts anyway. ```json { "step": "ready", "version": 1, "sentAt": 1761740000123, "matchId": "Xk3p9QaB", "mode": "live", "port": 1, "opponent": { "botId": "b7Qm2ZkA", "name": "rusher" }, "stage": 31, "inputDelayFrames": 1, "players": [ { "character": 9, "costume": 0 }, { "character": 2, "costume": 1 } ], "deadlineAt": 1761740010123 } ``` - `step` (`"ready"`) - `version` (integer): The match socket version these frames follow; a breaking change bumps it. - `sentAt` (integer): When the server sent this frame, unix milliseconds. - `matchId` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `port` (`0` | `1`): Your port, 0 or 1 — the Slippi player index in the event stream. - `opponent` (object) - `botId` (string) - `name` (string) - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): The stage this match is played on. - `inputDelayFrames` (integer): How many frames behind the engine you see the game: frame F reaches you once frame F + inputDelayFrames is done, so having seen F, send the pad for F + 1 + inputDelayFrames — the first one still open, due at the next tick. - `error` (string, optional): Present when your last reply was rejected and the step is asked again. A log line, not something to parse. - `players` ([[Pick](#pick), [Pick](#pick)]): Both picks, by port. - `deadlineAt` (integer): Reply before this, unix milliseconds on the server's clock. You reply: You are set. ```json { "step": "ready" } ``` - `step` (`"ready"`) ### game Server sends: The game is on: the .slp event stream follows as binary messages and your pads go back as 12-byte binary messages. No text reply. Sent again on a reconnect, where the live frames resume without the header: ask for a `replay` if your parser lost the stream. ```json { "step": "game", "version": 1, "sentAt": 1761740000123, "matchId": "Xk3p9QaB", "mode": "live", "port": 1, "opponent": { "botId": "b7Qm2ZkA", "name": "rusher" }, "stage": 31, "inputDelayFrames": 1, "players": [ { "character": 9, "costume": 0 }, { "character": 2, "costume": 1 } ], "frame": -124 } ``` - `step` (`"game"`) - `version` (integer): The match socket version these frames follow; a breaking change bumps it. - `sentAt` (integer): When the server sent this frame, unix milliseconds. - `matchId` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `port` (`0` | `1`): Your port, 0 or 1 — the Slippi player index in the event stream. - `opponent` (object) - `botId` (string) - `name` (string) - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): The stage this match is played on. - `inputDelayFrames` (integer): How many frames behind the engine you see the game: frame F reaches you once frame F + inputDelayFrames is done, so having seen F, send the pad for F + 1 + inputDelayFrames — the first one still open, due at the next tick. - `error` (string, optional): Present when your last reply was rejected and the step is asked again. A log line, not something to parse. - `players` ([[Pick](#pick), [Pick](#pick)]): Both picks, by port. - `frame` (integer): The last frame the engine has finished (−124: none yet). Send pads for frame + 1 through frame + 1 + inputDelayFrames now, then one per Frame Bookend. You reply: nothing; pads are the reply. ### over Server sends: The match is over. The server closes the socket after this frame. ```json { "step": "over", "version": 1, "sentAt": 1761740000123, "matchId": "Xk3p9QaB", "mode": "live", "port": 1, "opponent": { "botId": "b7Qm2ZkA", "name": "rusher" }, "stage": 31, "inputDelayFrames": 1, "players": [ { "character": 9, "costume": 0 }, { "character": 2, "costume": 1 } ], "winner": 0, "endReason": "stocks", "missed": [ 0, 6 ] } ``` - `step` (`"over"`) - `version` (integer): The match socket version these frames follow; a breaking change bumps it. - `sentAt` (integer): When the server sent this frame, unix milliseconds. - `matchId` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `port` (`0` | `1`): Your port, 0 or 1 — the Slippi player index in the event stream. - `opponent` (object) - `botId` (string) - `name` (string) - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): The stage this match is played on. - `inputDelayFrames` (integer): How many frames behind the engine you see the game: frame F reaches you once frame F + inputDelayFrames is done, so having seen F, send the pad for F + 1 + inputDelayFrames — the first one still open, due at the next tick. - `error` (string, optional): Present when your last reply was rejected and the step is asked again. A log line, not something to parse. - `players` ([[Pick](#pick) | null, [Pick](#pick) | null]): Both picks, by port; null for a bot that never picked. - `winner` (`0` | `1` | null): Null = draw, or no result. - `endReason` (`"stocks"` | `"time"` | `"forfeit"` | `"engine"`): `stocks`: last stock standing (both lost on one frame: a draw). `time`: the timer ran out — more stocks wins, then lower percent; equal is a draw. `forfeit`: no pad of a bot's landed for 300 consecutive polls, or it never connected. `engine`: the engine broke; the match is `aborted` and unrated. - `missed` ([integer, integer]): Frames polled without a pad, by port; each one was played neutral. You reply: nothing; pads are the reply. ### ping You reply: Ask for the current step. The server answers with its frame, as on a connect: where you are, a keepalive and a latency probe against `sentAt`. At most one a second. ```json { "step": "ping" } ``` - `step` (`"ping"`) Server sends: nothing on its own; the current step's frame comes back in answer. ### replay You reply: Ask for the whole .slp stream so far, in `game`: the server answers with one binary message holding the header and every finished frame, exactly the bytes a bot connected from the start has received. Live frames keep coming meanwhile; discard binary messages until the one that begins with `0x35` (the Event Payloads event; no live frame starts with it), then feed it and everything after to your parser. Rejected before the first frame was streamed and outside `game`. At most one a second, and not while the previous answer is still on its way to you. ```json { "step": "replay" } ``` - `step` (`"replay"`) Server sends: nothing on its own; the current step's frame comes back in answer. # API Base URL `https://api.stomped.dev`. JSON in and out. Every endpoint has its own page in the sidebar, generated from the contract the server implements. Matches, live, leaderboard, health and the platform key need no auth; bots, account and keys need a dashboard session or an API key. You never need the API to play; it exists for scripting, such as a deploy job that re-registers a bot or a cron job that pauses it. ## API Keys Two kinds, created in the dashboard under API keys or with `POST /keys`. Both share the same scopes and endpoints; scopes are fixed when the key is created. - **Signature key** (the default). You generate an Ed25519 keypair and register the public half; every request is signed with the private key. No secret crosses the wire, and a captured request cannot be altered or reused elsewhere, only replayed as-is within a five-minute window. - **Bearer key.** stomped generates a secret token, shown exactly once at creation (`stp_` followed by random base64; stomped keeps a hash). Send it as `Authorization: Bearer stp_…`. Treat it like a password; the `stp_` prefix makes a leaked token greppable. Lost it? Revoke the key and create a new one. ## Signing Requests Generate a keypair (`ssh-keygen -t ed25519` works) and register the public key: OpenSSH `.pub` lines, PEM blocks and raw base64 are all accepted. The key id shown at creation goes on every request, with a timestamp and the signature: | header | value | | --- | --- | | `x-stomped-key` | the key id | | `x-stomped-timestamp` | unix milliseconds, as a string; within 5 minutes of stomped's clock | | `x-stomped-signature` | `base64(ed25519_sign("..."))` | `METHOD` is uppercase, `path` includes the query string (`/bots?status=active`), and `body` is the exact raw bytes sent, empty for a bodyless request. ```js async function stomped(privateKey, keyId, method, path, body) { const raw = body ? JSON.stringify(body) : ""; const timestamp = String(Date.now()); const message = `${timestamp}.${method}.${path}.${raw}`; const signature = Buffer.from( await crypto.subtle.sign("Ed25519", privateKey, new TextEncoder().encode(message)), ).toString("base64"); return fetch(`https://api.stomped.dev${path}`, { method, headers: { "content-type": "application/json", "x-stomped-key": keyId, "x-stomped-timestamp": timestamp, "x-stomped-signature": signature, }, body: raw || undefined, }); } await stomped(privateKey, keyId, "POST", "/bots", { name: "my-first-bot", url: "https://your-bot.example.com", }); ``` Requests from stomped to your bot (the match socket) are signed with the platform key regardless of which kind of key you use. ## Scopes Each endpoint page names the scope it requires. A dashboard session carries every scope. A key for a deploy script wants `bots.read` and `bots.write` (the default) and nothing more. | scope | allows | | --- | --- | | `bots.read` | list and inspect your bots | | `bots.write` | register, update, pause, remove bots | | `keys.read` | list your API keys | | `keys.write` | create and revoke API keys | | `account.read` | read your account | | `account.write` | change your handle | ## Errors Errors are JSON, `{"code": "NOT_FOUND", "status": 404, "message": "…"}`, with `data` when there is more to say. - `400` invalid input (`data.issues` lists the fields), a failed deploy check (the message names the step), or a refused name (`invalid name`). - `401` no or invalid auth; `403` the key lacks the scope. - `404` not yours or does not exist. Bots are owner-only, so another account's bot is a `404`. - `409` a bot name you already use, a URL already registered to a bot, or the bot or API key cap. - `429` rate limited, with a `Retry-After` header in seconds. Limits are per account, per IP (an IPv6 /64) when anonymous: bot registration and URL changes 10/min, other writes 30/min, replay downloads 30/min, match reads (`/matches`, records) 120/min, everything else 600/min; sign-in emails 3/min per address. Replay downloads also carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the bucket is full) on every response, so a crawler can pace itself without ever seeing a `429`. An account holds at most 20 API keys and 5 bots. ## Scoring and Rating - The match record carries stocks and percent per port. `score` is stocks remaining, 4 against 0 on a forfeit. Placement is 1 for the winner and 2 for the loser, 1 and 1 on a draw. - Ratings are [openskill](https://openskill.me) (Weng-Lin): a bot starts at `mu = 25`, `sigma = 25/3`, and the number shown is `mu − 3σ`, so new bots start near 0 and climb as sigma shrinks. A draw rates as a tie, a forfeit as a loss. - The leaderboard ranks every bot with at least one completed match. Rating deltas are on the match record once it completes. ## Matchmaking - No queue, one game per match, no sets. Every 5 seconds the scheduler starts at most one match. A bot plays one match at a time; the number running at once is capped, so a bot may wait when the arena is busy. - A bot is due 6 minutes after its last match ended, so expect a game every 7 to 10 minutes while the arena has room, less often when it is full. A new bot is due the moment it registers and its wait climbs to the norm over its first 10 games (6 minutes × (games ÷ 10)², never under the 2-minute cooldown). - Each tick seats the most overdue bot against an opponent: any bot rested at least 2 minutes that is not among its last 5 opponents, nor it among theirs, drawn by rating rank with weights 1, 1/2, 1/3 …, so close matches are common and every opponent is reachable. With only recent opponents rested the bot waits; each minute it is overdue allows the oldest of them again. A new bot's games 4 to 10 rank the opponents from the top of the leaderboard down instead, so it meets the best bots inside its first hour. Two bots of one account never meet. Being drawn is a game like any other, so a bot can play more often than its due time, never sooner than 2 minutes after a match. - A match still running after 12 minutes is aborted unrated. ## Missed Games A miss is a match your bot was seated for and never answered: not one text frame, not one pad. Misses count consecutively; any answered match resets the count. An opponent that never connected is not a miss. - After 10 consecutive misses the bot is seated only every 3 hours, so a dead server stops bleeding rating. - When a miss streak is a week old the bot is set to `paused`. - Pausing or unpausing resets the count. Pause before taking your server down: paused bots are not seated, and a match already running finishes normally. ## Records and Replays - `GET /matches/{id}` is the permanent record: stage, characters, stocks and percent per port, frames played, how it ended, who won, rating deltas, and the engine's random seed. `GET /matches/{id}.slp` is the `.slp` the engine wrote, identical to what both bots were streamed. Replays may be deleted after a retention period; the record stays and `replayBytes` becomes null. - Nothing is hidden from a bot: the seed is in the Game Start block, every Frame Start carries the frame's RNG seed, and the opponent's inputs are in each Pre-Frame Update. Inputs are public, and so are replays: anyone may study, and imitate, any bot's play. # Endpoints Base URL `https://api.stomped.dev`. ## bots Register and manage your bots. ### List your bots `GET /bots` · scope bots.read Lists your own bots, optionally filtered by mode or status. query parameters: - `mode` (`"live"`, optional): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `status` (`"active"` | `"paused"`, optional): `active` bots are seated by matchmaking whenever idle; `paused` bots sit out. stomped pauses a bot itself after a week-long streak of missed games (see Rules). Returns: - `bots` ([Bot](#bot)[]) ### Register a bot `POST /bots` · scope bots.write Registers an HTTP server you host as a bot. Before accepting, stomped runs the **deploy check**: `GET {url}/ping` must answer with the body `pong`, and the URL must accept a signed WebSocket upgrade (`x-stomped-match: deploy-check`) — proof your server is live and ready to play; registration is refused otherwise. `name` must be unique among your own bots, and `url` across all of stomped (either taken → `409`): the URL is the bot's credential — the handshake is signed over it — so give it an unguessable path, not a bare hostname. A hateful or explicit `name` is refused (`400`). New bots start `active` and enter matchmaking on the next tick. An account holds at most 5 bots (`409` past that); bots of one account are never matched against each other. Body: - `name` (string, min length 1, max length 64) - `mode` (`"live"`, optional, default `"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `url` (string, max length 2048): Where stomped connects the match WebSocket (and the `/ping` deploy check). In production it must be `https` — upgraded to `wss` for match sockets — and resolve to a public address (private/loopback ranges rejected), checked at registration and again at every connect. Stored as the URL parses (lowercase scheme and host, no default port, dot segments resolved) without a trailing slash; a query, fragment or credentials are refused. The `url` the registration returns is the one the handshake is signed over. Registered URLs are never exposed publicly. Returns: [Bot](#bot) ### Get a bot `GET /bots/{id}` · scope bots.read Owner-only: returns your own bot and `404`s for anyone else's, so registered URLs stay private. Public surfaces (leaderboard, matches) show only a bot's name and its owner's handle. path parameters: - `id` (string) Returns: [Bot](#bot) ### Update a bot `PATCH /bots/{id}` · scope bots.write Updates name, URL, or status. Pause (`status: "paused"`) before taking your server down: a bot that stops answering forfeits its matches. Pausing takes effect on the next matchmaking tick; a match already running finishes normally. path parameters: - `id` (string) Body: - `name` (string, optional, min length 1, max length 64) - `url` (string, optional, max length 2048): Where stomped connects the match WebSocket (and the `/ping` deploy check). In production it must be `https` — upgraded to `wss` for match sockets — and resolve to a public address (private/loopback ranges rejected), checked at registration and again at every connect. Stored as the URL parses (lowercase scheme and host, no default port, dot segments resolved) without a trailing slash; a query, fragment or credentials are refused. The `url` the registration returns is the one the handshake is signed over. Registered URLs are never exposed publicly. - `status` (`"active"` | `"paused"`, optional): `active` bots are seated by matchmaking whenever idle; `paused` bots sit out. stomped pauses a bot itself after a week-long streak of missed games (see Rules). Returns: [Bot](#bot) ### Remove a bot `DELETE /bots/{id}` · scope bots.write Removes the bot. Completed matches keep their record. path parameters: - `id` (string) Returns: - `ok` (`true`) ## account Your account and its API keys. ### Get your account `GET /me` · scope account.read The calling account. `name` is the public handle (shown as `@name` on the leaderboard) — empty until one is picked. Returns: [User](#user) ### Set your handle `POST /me/handle` · scope account.write Sets the public handle, which doubles as the display name. Body: - `handle` (string): 2–32 chars: lowercase letters, digits, underscores. Unique across stomped; a few names (admin, stomped, deleted, you…) are reserved. A hateful or explicit name is refused (`400`). Returns: [User](#user) ### List your API keys `GET /keys` · scope keys.read Every key on the account, including revoked ones (metadata only). Returns: - `keys` ([ApiKeyMeta](#apikeymeta)[]) ### Create an API key `POST /keys` · scope keys.write Creates an API key of either kind — see the API page. A `signature` key (the default) registers the **public** half of an Ed25519 keypair — the private key never leaves you — and requests are authenticated by signing them with it. A `bearer` key returns a `stp_…` secret **once** (stomped stores only a hash); send it as `Authorization: Bearer …`. Scopes are fixed at creation; grant a key only what it needs (a bot-deploy script wants `bots.read` + `bots.write`, nothing more). An account holds at most 20 unrevoked keys (409 when full). Body: object Returns: - `id` (string) - `kind` (`"bearer"` | `"signature"`) - `name` (string) - `publicKey` (string | null): The registered key for `signature` keys, else null. - `scopes` (`"bots.read"` | `"bots.write"` | `"keys.read"` | `"keys.write"` | `"account.read"` | `"account.write"`[]) - `createdAt` (string) - `lastUsedAt` (string | null) - `revokedAt` (string | null) - `secret` (string, optional): Bearer keys only: the `stp_…` token, shown exactly once — stomped stores a hash. ### Revoke an API key `POST /keys/{id}/revoke` · scope keys.write Revocation is immediate: the bearer token or signatures from this key stop authenticating. path parameters: - `id` (string) Returns: [ApiKeyMeta](#apikeymeta) ## matches Permanent match records and replays. Public. ### List matches `GET /matches` Matches, newest first. Page backwards with `before`; the newest 10,000 matches are reachable. Public — no auth needed. query parameters: - `mode` (`"live"`, optional): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `botId` (string, optional) - `limit` (integer (1–200), optional, default `20`) - `before` (string, optional): A match id: only matches that started before it. Pass the last id of the previous page to get the next one. Returns: - `matches` ([MatchSummary](#matchsummary)[]) ### Get a match `GET /matches/{id}` The permanent match record. The replay itself is a file: `GET /matches/{id}.slp`, available once the match completes. Public — no auth needed. path parameters: - `id` (string) Returns: [Match](#match) ### Download a replay `GET /matches/{id}.slp` The match's .slp file, exactly what both bots were streamed. `404` while the match runs or when no game was played (a forfeit before the first frame). Public — no auth needed; its own replay-downloads limit, per account when the request carries an API key, and every response says what is left (`RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`). path parameters: - `id` (string) Returns: The replay, as `attachment; filename=".slp"`. ## live Running matches, frame by frame. Public. ### List running matches `GET /live` Every running match with each port's latest stocks, percent and position. query parameters: - `mode` (`"live"`, optional): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. Returns: - `matches` ([LiveMatch](#livematch)[]) ### Spectate a running match `GET /live/{id}` One running match; `404` once it has ended (read its record instead). path parameters: - `id` (string) Returns: [LiveMatch](#livematch) ## leaderboard The rankings. Public. ### Get the leaderboard `GET /leaderboard` Every bot with at least one completed match, ranked by conservative openskill rating (see Rules). Public — no auth needed. query parameters: - `mode` (`"live"`, optional, default `"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. Returns: - `rows` ([LeaderboardRow](#leaderboardrow)[]) ## meta Platform plumbing. ### Liveness probe `GET /health` Returns: - `status` (`"ok"`) ### Platform public key `GET /.well-known/stomped.json` stomped's Ed25519 platform public key — every request stomped sends to a bot is signed with its private half. Fetch once and cache. Returns: - `publicKey` (string) ## your bot Not stomped endpoints: what stomped does to YOUR server — the deploy check at registration and the match socket. ### Deploy check `GET {your url}/ping` Called when you register the bot or change its URL. Your server must answer `200` with the body `pong` within 1 second (redirects are not followed), and the URL must accept a signed WebSocket upgrade (`x-stomped-match: deploy-check`) — otherwise the request is refused with `400`. See Match Socket. Returns: The literal body `pong`. # Schemas ## User - `id` (string) - `name` (string) - `email` (string) ## ApiKeyMeta - `id` (string) - `kind` (`"bearer"` | `"signature"`) - `name` (string) - `publicKey` (string | null): The registered key for `signature` keys, else null. - `scopes` (`"bots.read"` | `"bots.write"` | `"keys.read"` | `"keys.write"` | `"account.read"` | `"account.write"`[]) - `createdAt` (string) - `lastUsedAt` (string | null) - `revokedAt` (string | null) ## Bot - `id` (string) - `ownerId` (string) - `name` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `url` (string, max length 2048): Where stomped connects the match WebSocket (and the `/ping` deploy check). In production it must be `https` — upgraded to `wss` for match sockets — and resolve to a public address (private/loopback ranges rejected), checked at registration and again at every connect. Stored as the URL parses (lowercase scheme and host, no default port, dot segments resolved) without a trailing slash; a query, fragment or credentials are refused. The `url` the registration returns is the one the handshake is signed over. Registered URLs are never exposed publicly. - `status` (`"active"` | `"paused"`): `active` bots are seated by matchmaking whenever idle; `paused` bots sit out. stomped pauses a bot itself after a week-long streak of missed games (see Rules). - `statusChangedAt` (string): When `status` last changed; registration counts. - `createdAt` (string) ## MatchSummary - `id` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `status` (`"running"` | `"completed"` | `"aborted"`): `aborted` = the mode's wall clock expired, neither bot connected, or the engine failed: no placements, no rating changes. - `stage` (`31` | `32` | `28` | `8` | `2` | `3` | null): Null while the match runs (`GET /live/{id}` has it). - `players` ([MatchPlayer](#matchplayer)[]) - `summary` ([GameSummary](#gamesummary) | null): The result, once the match ends. - `replayBytes` (integer | null): Size of the .slp at `GET /matches/{id}.slp`; null while running, and once the arena's retention period has deleted the replay. - `startedAt` (string) - `endedAt` (string | null) ## MatchPlayer - `port` (`0` | `1`): 0 or 1 — the Slippi player index. - `botId` (string) - `botName` (string) - `character` (`0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` | `10` | `11` | `12` | `13` | `14` | `15` | `16` | `17` | `18` | `19` | `20` | `21` | `22` | `23` | `24` | `25` | null): Null while the match runs, and for a bot that never picked. - `costume` (integer (0–5) | null) - `placement` (integer | null): 1 = won, 2 = lost; a draw is 1 for both. Null while running. - `score` (integer | null): Stocks left at the end (a forfeit scores 0 against 4). Null while running. - `ratingDelta` (number | null): Rating after minus before, once the match completes. ## Match - `id` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `status` (`"running"` | `"completed"` | `"aborted"`): `aborted` = the mode's wall clock expired, neither bot connected, or the engine failed: no placements, no rating changes. - `stage` (`31` | `32` | `28` | `8` | `2` | `3` | null): Null while the match runs (`GET /live/{id}` has it). - `players` ([MatchPlayer](#matchplayer)[]) - `summary` ([GameSummary](#gamesummary) | null): The result, once the match ends. - `replayBytes` (integer | null): Size of the .slp at `GET /matches/{id}.slp`; null while running, and once the arena's retention period has deleted the replay. - `startedAt` (string) - `endedAt` (string | null) - `seed` (string | null): The engine's random seed, as in the replay's Game Start block (both bots have it from frame −123). Null on the record while the match runs. ## GameSummary The result of a finished game, or where an aborted one stood. - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): A legal stage's slp id (`Stage` in @slippi/slippi-js). - `players` ([object, object]): By port. - `character` (`0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` | `10` | `11` | `12` | `13` | `14` | `15` | `16` | `17` | `18` | `19` | `20` | `21` | `22` | `23` | `24` | `25` | null): Null for a bot that never picked. - `costume` (integer (0–5) | null) - `stocks` (integer): Stocks left at the end. - `percent` (number): Damage at the end. - `missed` (integer, optional, default `0`): Frames polled without a pad from this bot; each one was played neutral. - `frames` (integer): Frames played, from frame 0 to the last. - `endReason` (`"stocks"` | `"time"` | `"forfeit"` | `"engine"`): `stocks`: last stock standing (both lost on one frame: a draw). `time`: the timer ran out — more stocks wins, then lower percent; equal is a draw. `forfeit`: no pad of a bot's landed for 300 consecutive polls, or it never connected. `engine`: the engine broke; the match is `aborted` and unrated. - `winner` (`0` | `1` | null): Null = draw (or no result on `engine`). ## LiveMatch - `id` (string) - `mode` (`"live"`): `live`: the game runs on a real 60 Hz clock one frame behind the engine: a bot sees frame F once frame F + 1 is done and has until the next tick, 11 ms, to land its pad for F + 2; a frame polled without a pad plays neutral. - `stage` (`31` | `32` | `28` | `8` | `2` | `3`): Drawn before the picks. - `frame` (integer): The latest frame the engine reported (−124 before the first). - `players` (object[]) - `port` (`0` | `1`): 0 or 1 — the Slippi player index. - `botId` (string) - `botName` (string) - `character` (`0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` | `10` | `11` | `12` | `13` | `14` | `15` | `16` | `17` | `18` | `19` | `20` | `21` | `22` | `23` | `24` | `25` | null) - `costume` (integer (0–5) | null) - `stocks` (integer) - `percent` (number) - `x` (number) - `y` (number) - `startedAt` (string) ## LeaderboardRow - `rank` (integer) - `botId` (string) - `name` (string) - `owner` (string): The owner's public handle. - `rating` (number): Conservative openskill estimate `mu − 3σ`, rounded to 1dp. New bots start ~0. - `gamesPlayed` (integer) - `wins` (integer) - `losses` (integer) - `draws` (integer): Equal stocks and percent on time, same-frame double KOs, double forfeits. ## Pick A character and costume. - `character` (`0` | `1` | `2` | `3` | `4` | `5` | `6` | `7` | `8` | `9` | `10` | `11` | `12` | `13` | `14` | `15` | `16` | `17` | `18` | `19` | `20` | `21` | `22` | `23` | `24` | `25`): A playable character's slp external id (`Character` in @slippi/slippi-js): 0 Captain Falcon … 25 Ganondorf. - `costume` (integer (0–5)): Costume index, 0 = default. Characters have 4 to 6; see the character list. ## Pad One controller state. On the wire it is 8 bytes after the i32 frame. - `buttons` (integer (0–65535)) - `stickX` (integer (0–255)) - `stickY` (integer (0–255)) - `cstickX` (integer (0–255)) - `cstickY` (integer (0–255)) - `l` (integer (0–255)) - `r` (integer (0–255))