Web, no build step
Import the ES module straight from the CDN, or drop a plain <script> tag and use MP.Multiplayer. Under 7 KB gzipped, zero dependencies, works on touch as it does on a mouse.
Hosted multiplayer backend · WebRTC + server-arbitrated state
Player accounts, matchmaking, rooms, shared state and WebRTC peer-to-peer behind one hosted API. Ten lines of client code put two players in the same room, and you never run a game server.
Free sandbox keys in one call · $19.99/mo to go live · cancel anytime
Illustration: one room, three clients, one shared state
A guest account, a room, positions on the wire, health through the server. Everything below is the complete loop, with nothing omitted for the sake of a short example. The same three calls carry a browser tab, a phone and a Unity build.
import { Multiplayer } from 'https://multiplayerapi.com/sdk/mp.esm.min.js';
const mp = new Multiplayer({ key: 'mp_pk_…', displayName: 'Alice' });
await mp.login(); // the player is in
const room = await mp.quickmatch({ mode: 'ffa', max_players: 8 });
room.on('members', (m) => spawn(m));
room.on('peer', (data, from) => ghosts[from]?.moveTo(data.x, data.y));
room.state.watch('players.*.hp', (hp, path) => updateBar(path, hp));
setInterval(() => room.send({ x: me.x, y: me.y }), 50); // direct, peer-to-peer
room.mine('hp', 100); // state, validated + kept
using MultiplayerApi;
var mp = new Multiplayer("mp_pk_…") { DisplayName = "Alice" };
await mp.Login();
var room = await mp.Quickmatch(new JObject { ["mode"] = "ffa", ["max_players"] = 8 });
room.OnPeerMessage += (bytes, from) => Ghosts[from].Apply(bytes);
room.OnMembersChanged += (members) => Spawn(members);
void Update() {
room.Send(new { x = transform.position.x, z = transform.position.z });
}
// JSON over HTTP. Three routes are enough to be playing.
POST /v1/auth/guest X-Mp-Key: mp_pk_…
→ { account, session }
POST /v1/rooms/quickmatch Authorization: Bearer mp_at_…
{ "mode": "ffa", "max_players": 8 }
→ { room, me, members, tick_ms }
POST /v1/rt/sync ← the loop, one call every tick_ms
{ "room": "A7F3K2", "since": 42, "ops": […], "relay": […] }
Full walkthrough in Start in ten lines · SDK downloads · OpenAPI 3.1
Documentation an agent has to reverse-engineer produces integrations you then have to debug. So the whole API is published as one self-contained plain-text reference, a full OpenAPI 3.1 schema, and a create-a-game endpoint that needs no account, no dashboard and no card. Paste this into Cursor, Claude Code or anything else that can fetch a URL.
Add online multiplayer to my game with the Multiplayer API (https://multiplayerapi.com). Read https://multiplayerapi.com/llms-full.txt first — it is the complete reference. Then create a game with POST https://multiplayerapi.com/v1/games using the preset that matches my genre, and wire the SDK into my client: guest login, quickmatch, positions over room.send(), and health and score in shared state.
llms-full.txt holds every endpoint, rule, recipe and failure mode in one file. openapi.json gives it the machine schema for the same 26 routes.
One unauthenticated POST /v1/games returns a public key, a secret key and a sandbox that runs for 24 hours. Nothing to click, no form to fill.
A preset (realtime_arena, turn_based, coop, strict) ships the state rules with it, so the game is arbitrated from the first commit rather than after the first cheater.
The Multiplayer API is JSON over HTTP plus WebRTC, which every platform already speaks. There is no native plugin to compile and no engine to migrate to. One game key serves every build you publish, so a web version and a Unity version join the same rooms.
Import the ES module straight from the CDN, or drop a plain <script> tag and use MP.Multiplayer. Under 7 KB gzipped, zero dependencies, works on touch as it does on a mouse.
Install from the Package Manager by Git URL. Add com.unity.webrtc for peer-to-peer, or skip it and everything routes through the relay. Same rooms, same keys as your web build.
Three routes are enough to play, and the OpenAPI 3.1 schema generates a client in whatever you write in — Godot, Python, Rust, Go, a custom C++ engine.
WebRTC where it connects, and a server relay for the individual peers it cannot reach, so one player behind a hostile network does not penalize the whole room. Declare a TURN server to bring those players back to direct.
This is the entire mental model. Once you know which channel carries what, adding a genre becomes a configuration question rather than an architecture project.
Choosing the wrong one is the usual mistake. A position pushed through
set() costs a lot for nothing; hit points sent through send()
vanish on the first reconnect. Read the channel guide.
There is no "deathmatch" or "hand of cards" object to fit your game into. There are rooms, a JSON state document, counters and leaderboards. Your game decides what they mean, and the four presets below are only sensible defaults for that decision.
Positions and shots peer-to-peer, health and kills arbitrated in shared state.
Play it realtime · free-for-allOrb pickups streamed direct, score refereed by the server so nobody invents points.
Play it .io · many playersTrajectories on the direct channel, pellets claimed once with setnx().
Everything in shared state, move and turn handoff committed together, atomically.
Play itEvery demo runs on the live API, in your browser, with no install · all demos
The server never simulates your game, which is why there is nothing for you to host. It still refuses any write that breaks the rules you declared, so a client cannot award itself the win. Once peer connections are up, each client calls the server every five seconds.
Who may write which path, at what rate, with what maximum delta per write, and which fields are server-only. With no rules at all, a player can only write under their own subtree.
The host submits the outcome and the other players countersign it. Agreement confirms the match; disagreement flags it for review instead of auto-banning someone over a lost packet.
match.ended, match.disputed, cheat.flagged, player.banned — HMAC-signed and retried, so your backend reacts instead of polling.
Rejoining is reconnecting: state survives, late joiners are caught up, and losing the host migrates the room instead of ending the match.
None of these is hard on its own. Each is a service to deploy, monitor, and keep compatible with the other seven, for as long as the game is online.
Against the alternatives. Engine-bound frameworks such as Unity Multiplayer Services
or Godot's MultiplayerAPI tie your netcode to one engine and still leave the
hosting decision to you. Self-hosted room servers hand you the source and the pager. This is
hosted, engine-agnostic, and billed as one flat subscription.
One price whatever you ship. No per-seat tiers, no per-message metering, and no bill that grows the week your game finds an audience.
$19.99/ month · usd
Every game in your console, with the same limits for all of them.
One call, no account, no card. You get real keys and a sandbox game that runs 2 live rooms for 24 hours — enough to build and test the integration before you decide.
curl -X POST https://multiplayerapi.com/v1/games \
-H 'Content-Type: application/json' \
-d '{"name":"My Game",
"preset":"realtime_arena"}'
Returns mp_pk_… for the client and mp_sk_…, shown once, for your server. Claim it to your console when you subscribe.
Multiplayer API is the hosted multiplayer backend at multiplayerapi.com. It turns a browser game, an engine build or a weekend prototype into an online game, without a dedicated game server on your side.
A multiplayer API is a hosted service that handles everything two or more players need to share a game session: identity, matchmaking, a room, a shared source of truth, and a realtime transport between clients. Multiplayer API does exactly that over HTTP and WebRTC, so you keep your engine, your rendering and your game logic, and stop maintaining netcode infrastructure.
Player accounts with instant guest login, matchmaking and rooms with host migration, shared state validated by declarative rules, WebRTC peer-to-peer with relay fallback, ordered events, leaderboards, inventory and progression, spectators, signed webhooks, cheat detection and a developer console. See the documentation, try the live demos, or drop in the JavaScript SDK.
Three calls are enough to be playing: log in, quickmatch, then sync. A complete realtime loop with position streaming and shared health fits in about ten lines. The JavaScript SDK is under 7 KB gzipped, has zero dependencies and needs no build step. Start with Start in ten lines.
Yes. The JavaScript SDK runs in any modern browser on desktop and mobile, as an ES
module or a plain script tag. The Unity package supports Unity 2021.3 and above, with
optional com.unity.webrtc for peer-to-peer and a server relay when it is
absent. Any other stack can talk to the API directly: it is JSON over HTTP with an
OpenAPI 3.1 schema, so you can generate a client in any
language. One game key serves every build you ship.
Yes, and it is a supported path rather than a side effect. Point a coding agent at
llms-full.txt, a single self-contained reference, or at the
OpenAPI 3.1 schema. The agent can then create a game with
one unauthenticated POST /v1/games, receive the public and secret keys in
the response, and wire the SDK into your client.
Creating a game needs no account, no dashboard and no card: the resulting sandbox runs 2 live rooms for 24 hours, and you subscribe when you want to ship.
Unity Multiplayer Services and Godot's MultiplayerAPI are engine-bound
frameworks: your netcode lives inside one engine and you still decide where the server
runs. Multiplayer API is a hosted, language-agnostic service you call over HTTP and
WebRTC from any stack, including plain web games, custom clients and agent-generated
code.
No dedicated game server, no signaling server, no TURN cluster to babysit. The Multiplayer API server never simulates your game: it connects players, arbitrates writes against the rules you declare, and stores what must survive the match. Positions and animations travel directly between players over WebRTC, and once those connections are up each client only calls the server every five seconds.
Shared state is server-arbitrated. Without rules, a player may only write under their own subtree. With rules, you declare who can write what, at what rate, and with what maximum delta per write, and some fields become server-only.
Match results can require peer attestation, where the host submits and other players
countersign, and disagreements are flagged for review instead of triggering an automatic
ban. Your backend can receive match.ended, cheat.flagged and
player.banned as HMAC-signed webhooks.
One subscription at $19.99 per month covers every game in your console, with up to 128 players per room and up to 2,000 live rooms per game. There is no per-seat pricing and no per-message metering, and you can cancel at any time from your receipt.
Yes. Every live demo on this site runs on the real API, and one
POST /v1/games returns working keys with no account and no card. That
sandbox game runs 2 live rooms for 24 hours, which is enough to build and test a real
integration before you subscribe.
That is the whole test: paste the public key into the SDK, load your game twice, and watch the second tab appear in the first.
$19.99/mo · unlimited games · cancel anytime