Home/What is a multiplayer API?

explainer · multiplayer apis

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. This guide explains what one does, the five kinds you will run into, and how to pick.

Free sandbox · $19.99/mo to go live · cancel anytime

definition

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.

what it does

The five jobs of a multiplayer API

  1. Identity — who is this player? Guest accounts, sessions, upgrading to a username and password later.
  2. Matchmaking and rooms — which players share a session, how a room is created, joined by code, locked and cleaned up, and who is host.
  3. 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.
  4. Transport — how data moves between players: direct peer-to-peer with WebRTC, through a relay, or through a game server.
  5. 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.

types

Five types of multiplayer API, compared

TypeExamplesYou still run…Best for
Engine-level APIGodot MultiplayerAPI, Unity Netcode for GameObjects, Mirrorthe server (or a host player), accounts, matchmakingGames committed to one engine that want deep scene replication
Platform servicesSteamworks, Epic Online Services, Xbox servicesgame networking and serversGames shipping on those storefronts, cross-play, achievements
Game backend platformsPlayFab, Nakama (Heroic Labs), AccelByte, Beamablegame servers or server code; sometimes the backend itselfLive-ops games with economies, storefronts and large teams
Realtime netcode servicesPhoton, Colyseusgame logic on a server, or per-CCU plansFast-paced games where a server is the authority
Hosted HTTP + WebRTC APIMultiplayer APInothing: no game server, no signaling, no TURNWeb 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 it works

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:

ChannelCallDeliveryUse it for
Directroom.send(data)peer-to-peer, best effort, zero server costpositions, aim, animation
Stateroom.set(path, value)server-validated, kept for the match, reaches late joinershealth, score, whose turn
Eventsroom.emitEvent(topic, data)ordered, guaranteed, not persistedchat, rematch, one-shots
choosing

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.
Questions
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