Skip to content

Operate

Admission and limits

How many keys, rooms and requests an account may use, and what happens at a limit.

The Ball2D service enforces these limits when your server asks to open a room. They protect the service, not your process: they are checked on Ball2D's side and apply to every host that uses your keys.

Keys and rooms

LimitValue
Active API keys per account2
Active rooms per key1
Active rooms per account2
Key lifetime1–365 days (7, 30, 90 or 365 in the account page)

A room counts against these limits from the moment the service admits it until it closes. Close rooms with close() so their place is released immediately.

Request budgets

BudgetValue
New room requests per key3 per minute
New room requests per account5 per minute
Requests made with one key10 per minute
Room requests per account20 per minute

Requests refused because a room limit is full still count against the per-minute budgets.

When you reach a limit

createRoom() rejects with a RoomAdmissionError with status 429:

MessageMeaning
This API key already has an active room.Close that room or use another key.
Your account already has two active rooms.Close one of your rooms.
Room request budget exhausted. Try again later.Wait before requesting another room.
Too many requests. Please try again later.Wait before requesting another room.

retryAfterSeconds tells you how long to wait; today it is always 60. Never retry in a tight loop: every refused request still uses your per-minute budget.

Startup and lifetime

The service holds a room's place for 30 seconds while your host starts. Once the room is open, it stays authorized until it closes, its key is revoked, or its key expires, up to one year. The SDK doesn't need to renew anything while the room runs.

Players

maxPlayers sets how many players a room admits, from 2 to 30, counting the host player when there is one. There is no account limit on players.