The short answer
A multiplayer API is a service your game calls to handle the parts of online play that are not game logic: player identity, matchmaking, rooms, shared state and a realtime transport between players.
The term is used for several different things. In Godot, MultiplayerAPI is a class inside the engine. In Unity, “Multiplayer Services” is a set of Lobby, Matchmaker and Relay services. In PlayFab it is the Multiplayer Servers and matchmaking REST API. And Multiplayer API (multiplayerapi.com) is a specific product: a hosted HTTP + WebRTC backend for web, Unity and any other client. This page covers the category; the sections below show where each fits.
The five jobs of a multiplayer API
- Identity — who is this player? Guest accounts, sessions, upgrading to a username and password later.
- Matchmaking and rooms — which players share a session, how a room is created, joined by code, locked and cleaned up, and who is host.
- State — a shared source of truth (health, score, whose turn it is) that late joiners and reconnecting players receive, with rules about who may write what.
- Transport — how data moves between players: direct peer-to-peer with WebRTC, through a relay, or through a game server.
- Persistence — what survives the match: stats, inventory, leaderboards, save data.
A multiplayer API does not simulate your game. Rendering, physics and game rules stay in your code; the API removes the infrastructure around them.
Five types of multiplayer API, compared
| Type | Examples | You still run… | Best for |
|---|---|---|---|
| Engine-level API | Godot MultiplayerAPI, Unity Netcode for GameObjects, Mirror | the server (or a host player), accounts, matchmaking | Games committed to one engine that want deep scene replication |
| Platform services | Steamworks, Epic Online Services, Xbox services | game networking and servers | Games shipping on those storefronts, cross-play, achievements |
| Game backend platforms | PlayFab, Nakama (Heroic Labs), AccelByte, Beamable | game servers or server code; sometimes the backend itself | Live-ops games with economies, storefronts and large teams |
| Realtime netcode services | Photon, Colyseus | game logic on a server, or per-CCU plans | Fast-paced games where a server is the authority |
| Hosted HTTP + WebRTC API | Multiplayer API | nothing: no game server, no signaling, no TURN | Web games, indie and small-team games, prototypes, AI-built games |
Compare them side by side in the game backend comparison, or read how the hosted API differs from Godot's MultiplayerAPI.
How a hosted multiplayer API works
Your game calls the API over HTTP for identity, rooms and state, and opens WebRTC connections between players for the fast data. The server only coordinates; it never runs your game.
import { Multiplayer } from 'https://multiplayerapi.com/sdk/mp.esm.min.js';
const mp = new Multiplayer({ key: 'mp_pk_...' });
await mp.login(); // identity: instant guest account
const room = await mp.quickmatch({ mode: 'ffa', max_players: 8 }); // matchmaking + room
room.on('peer', (p, from) => others[from] = p); // transport: direct, peer-to-peer
setInterval(() => room.send({ x: me.x, y: me.y }), 50);
room.mine('hp', 100); // state: validated by your rules
await mp.submitScore('arena', score); // persistence: leaderboard
The most important design choice is which channel carries which data:
| Channel | Call | Delivery | Use it for |
|---|---|---|---|
| Direct | room.send(data) | peer-to-peer, best effort, zero server cost | positions, aim, animation |
| State | room.set(path, value) | server-validated, kept for the match, reaches late joiners | health, score, whose turn |
| Events | room.emitEvent(topic, data) | ordered, guaranteed, not persisted | chat, rematch, one-shots |
When you do not need a multiplayer API
- You are building a server-authoritative, physics-heavy shooter that needs the simulation to run on a trusted server. Use dedicated servers with an engine netcode stack or a service like Photon Fusion, or Colyseus.
- You only need local or hot-seat multiplayer.
- You are shipping exclusively on one console or storefront whose platform services already cover everything you need.
When one saves you weeks
- A browser game that should stay a static site.
- A weekend prototype or game-jam entry that has to be online by Sunday.
- A game written by an AI coding agent: the agent can read one reference file and create its own keys. See multiplayer for AI-generated games.
- Turn-based, co-op, party and .io games, where rules on shared state are enough authority.
Go deeper
What is a multiplayer API?
A multiplayer API is a service your game calls to handle the parts of online play that are not game logic: player identity, matchmaking, rooms, shared state and a realtime transport between players.
What is the difference between a multiplayer API and a game server?
A game server runs your game simulation. A multiplayer API provides the surrounding services — identity, matchmaking, rooms, shared state, transport — and, in the hosted peer-to-peer model, does not run your simulation at all.
Is Godot's MultiplayerAPI the same thing as Multiplayer API (multiplayerapi.com)?
No. Godot's MultiplayerAPI is an engine-level class for RPCs and replication; you still provide the server or host. Multiplayer API at multiplayerapi.com is a separate, hosted service you call over HTTP and WebRTC from any engine. See the comparison.
Which multiplayer API is best for a browser game?
For browser games that should stay static sites, a hosted HTTP + WebRTC API avoids running a server. For fully server-authoritative games, a netcode service or dedicated servers fit better. The backend comparison lists each option.
How much does a multiplayer API cost?
It varies by model: per concurrent user, per request, per server-hour, or flat. Multiplayer API (multiplayerapi.com) is a flat $19.99 per month for every game, with a free sandbox.
Make your game online today
Free sandbox keys in one call, no account and no card. $19.99/month when you ship, for every game you make.
Free sandbox · $19.99/mo to go live · cancel anytime