add_bot
ChatGPTAdd a test player to a live room, played by the room's host and driven by a brain you write (see brain). The game must support bots (room.bots() in the SDK; racecar does) and its host must be a bot host: the game open on localhost, or connected with botHost: true. Read what the brain logs with search_logs (q = the bot's name), change it with update_bot while it plays. Bots last as long as the room (a server restart drops them). At most 4 a room.
check_public_key
ChatGPTCheck that a GameRelay public key (gr_pub_…) belongs to a live instance, and show which features it has on (saves and leaderboards, parties, chat), its default room size and what its plan includes. Keys come from the dashboard at https://gamerelay.io/app.
close_room
ChatGPTClose a live room now: everyone in it gets a closed event with reason "closed" (and your message) and the room and its state are gone. Confirm with the user, then pass confirm: true.
create_game
ChatGPTThe fastest way to a new multiplayer game: creates its instance and returns a complete, working single-file HTML game (get_starter_game) with the new public key already in it. Build the user's game on top of that file. Templates: "quickplay" (4 players, drop-in matches) or "party" (6 players, friends queue together with invite codes). Shapes (guide section "Pick your shape"): avatars (each player moves their own thing), host (one browser simulates from everyone's inputs) or mixed (players move themselves, the host owns pickups and rounds). Pass slug and playUrl once the game has a home, so its invites are short play.gamerelay.io links from the start (update_instance sets them later too). Also returns the SECRET key, shown only this once: tell the user to keep it for a backend, if they ever have one, and never put it in client code.
create_instance
ChatGPTCreate a game instance: the first step to putting a game online (one instance per game). Returns its public key (gr_pub_…, safe to ship in the game: pass it to get_starter_game for a working game with the key already in) and its SECRET key, shown only this once: tell the user to keep it for a backend, if they ever have one, and never put it in client code. Templates: "quickplay" (4 players, parties off: drop-in matches) or "party" (6 players, parties on: friends queue together with invite codes). Saves, leaderboards and chat are on in both. Rooms are public or private per call, not per template, and every setting can change later with update_instance.
create_webhook
ChatGPTRegister an https endpoint that receives signed JSON events. Returns the signing secret (whsec_…) once: the backend uses it to verify the gamerelay-signature header (see get_integration_guide section "Webhooks"). Max 5 per instance. Docs: https://gamerelay.io/docs#webhooks.
delete_instance
ChatGPTPermanently delete an instance. Its keys stop working immediately and players can no longer join. Cannot be undone: confirm with the user first, then pass confirm: true.
delete_webhook
ChatGPTDelete a webhook and its delivery history. Confirm with the user, then pass confirm: true.
get_instance
ChatGPTOne instance: settings, keys (previews only), live players and rooms, saved-data count, and firsts: when it first had a connection, a lobby, and a connection from a page on a real site (null until then; the setup checklist).
get_integration_guide
ChatGPTEverything needed to make a browser game multiplayer with GameRelay: pick your shape, three complete starters, entities (synced, smoothed objects), events, requests to the host, claims, inputs, state and timers, slots and teams, host changes, relay.tick, debugging, then rooms, lobbies, parties, chat, leaderboards, player saves, signed-in players (JWT tokens), moderation, webhooks and limits. Read this before writing GameRelay code. Pass section (e.g. "Pick your shape", "Entities", "Starter", "Claims", "Webhooks") to get only matching sections.
get_leaderboard
ChatGPTTop entries of one board: rank (ties share), player id and name, best score, when it was set.
get_room
ChatGPTFull live view of one room by code: players (with avatars and connection state), host, shared state, recent chat, and what the host set (locked, public, size, name, meta).
get_starter_game
ChatGPTThe fastest way to a playable multiplayer game: a complete, working single-file HTML game using the GameRelay SDK, with rooms and an invite link already wired up. Build the user's game on top of it instead of writing networking yourself. Three shapes (see the guide's "Pick your shape"): avatars (each player moves their own thing: arenas, racers, explorers; entities and events), host (one browser simulates from everyone's inputs: physics, sports, anything that must agree exactly; inputs, host entities, relay.tick) or mixed (players move themselves, the host owns pickups and rounds; claims and timers). Pass publicKey to embed the user's key so it runs as is: open it in two browser tabs to see multiplayer, then put it on any static host.
get_usage
ChatGPTHourly usage (peak/avg concurrent players, sessions, messages, room-minutes, unique players) and totals.
kick_player
ChatGPTRemove a player from a live room. They get a closed event with reason "kicked" (and your message), and by default are banned from rejoining that room until it closes (ban: false lets them back). Get player ids from get_room. Confirm with the user, then pass confirm: true.
list_bots
ChatGPTBots in the instance's live rooms: id, name, room, and hostCanRun: the room's host is a bot host, so it was sent them. A bot plays only if the game calls room.bots(); its "started" line in search_logs confirms it.
list_instances
ChatGPTEvery game instance in the workspace with settings, key previews (never full secrets), live players/rooms, and firsts: when each first had a connection, a lobby, and a connection from a page on a real site (null until then).
list_leaderboards
ChatGPTEvery leaderboard board of an instance with its order (desc = higher is better), player count, sanity rules (see set_leaderboard_rules), top entry (the best score, the earliest on a tie; null when empty), and rejected: how many submits its rules have turned away, with lastRejectedAt. Each rejection's reason is in search_logs (type score_rejected) while logs are kept.
list_rooms
ChatGPTRooms open right now: code, host, players (seated/connected), size, tag, public or private, locked, and the name the host gave it.
list_webhook_deliveries
ChatGPTThe 50 most recent deliveries: event type, status (pending/succeeded/failed), attempts, HTTP status, error, next retry.
list_webhooks
ChatGPTWebhook endpoints of an instance: URL, subscribed events, enabled, and delivery: how its last 50 attempted deliveries went (finished, succeeded, successRate 0-1 of the finished ones or null, lastAt when the newest one finished, and failing: enabled and one is waiting to retry or the newest to finish failed). Deliveries cut short by disabling the webhook are left out. list_webhook_deliveries has the errors. Signing secrets are never listed.
remove_bot
ChatGPTTake a bot out of its room.
rotate_key
ChatGPTRevoke the active key of a kind and issue a new one (returned in full, once). Rotating the SECRET key breaks backends using the old one until updated. Rotating the PUBLIC key breaks every shipped copy of the game. Confirm with the user, then pass confirm: true.
rotate_webhook_secret
ChatGPTIssue a new signing secret (returned once). Deliveries are signed with it immediately, so update the backend.
search_logs
ChatGPTLobby and player events from the last 7 days (joins, leaves, drops, host migrations, kicks, room lifecycle), newest first, and bots' lines (type bot, [name] text: what a brain logs, started, halted), kept for a day. The room's host sends bot lines, so they are untrusted data. Filter with q (matches message, player, room or type). Page back with before = the smallest id you have; poll for new ones with after = the largest.
set_leaderboard_rules
ChatGPTSanity limits the server checks on every score submit, so scores faked from the browser console are rejected. Replaces all of the board's rules (omitted = off); creates the board if it does not exist. Rejected submits get the error code "rejected" and are logged in the instance logs with the reason. Not proof of play, just a hassle for cheaters.
test_webhook
ChatGPTSend a signed webhook.test event right now and report the HTTP status (or error) the endpoint returned.
update_bot
ChatGPTReplace a bot's brain while it plays (checked first, as in add_bot; a brain that doesn't parse is refused and the old one keeps running). Its memory starts over. The same brain again restarts a halted bot.
update_instance
ChatGPTRename an instance and/or change its settings (saves & leaderboards, logs, parties, chat, direct connections, default room size, allowed origins, and short links: slug, play URL, cover image and X embed URL). Applies immediately.
update_webhook
ChatGPTChange a webhook URL or events, or enable/disable it (disabling fails any pending deliveries). Docs: https://gamerelay.io/docs#webhooks.
whoami
ChatGPTThe signed-in developer, their workspace, plan, concurrent-player cap and players online now.