Spaces pricing

Spaces is priced on the number of unique users that interact with your application each month. Cursor updates, locations and connection time don't affect your bill.

Ably prices on monthly active users (MAUs). A user who interacts with your application counts once in a calendar month, whichever products they use, however many spaces they enter, however often their cursor or location updates, and however long they stay connected.

Monthly active users

An MAU is a unique clientId that is active during a calendar month. The Spaces SDK runs over a Pub/Sub realtime client, and a clientId becomes active when a Spaces client created from a realtime client from the device package connects to Ably. It is counted once for that month, whether it was active for a minute or every day.

Each clientId is counted once per app. The same user counts once whether they connect from one device or several, and whether they use Spaces alone or Spaces alongside Pub/Sub, Chat, AI Transport, LiveObjects or LiveSync in the same app.

Identifying users

The Spaces SDK requires every client to have a clientId, because avatar stacks, locations, cursors and locks are attributed to it. Because an MAU is identified by their clientId, the way you assign them decides what you are billed for:

  • Assign one clientId per user, and use it on every device and in every session. A user who collaborates from a phone and a laptop with different clientIds counts as two MAUs.
  • Never share a clientId between users.

Anonymous users

Users who are anonymous to your application still require a clientId. Generate an identifier for each anonymous user and store it on their device, so that a returning anonymous user counts only once. If your application generates a fresh identifier on every visit, each visit counts as a new MAU.

Servers

Spaces clients created from a realtime client from the server package are not counted as MAUs, however many spaces they enter.

If you call the REST API directly rather than through an SDK, declare the caller as a server. With API key authentication, add clientType=server as a request or connection parameter. With token authentication, add the x-ably-clientType claim with the value server to the JWT you issue to the server. A request that doesn't declare itself as a server is counted as a user.

Resource-based pricing

If your account is still on resource-based pricing, Spaces is charged on what you use rather than on your number of MAUs: per million messages, per million channel minutes and per million connection minutes. Each space maps to an underlying channel, and live cursors use a separate channel because of their high update frequency, so both count as channel minutes while a space is in use. How messages are counted lists which Spaces operations generate messages.

To move your account to MAU pricing, follow the migration guide.

Resource efficiency

Regardless of whether you are on MAU pricing or resource-based pricing, effectively managing resources is beneficial to your application:

  • Increase the outboundBatchInterval above its 25ms default to reduce the frequency of cursor position updates, at the cost of less smooth cursor movement.
  • Keep to a maximum of 20 members simultaneously streaming their cursors in a space. Beyond this, the volume of cursor messages increases significantly.
  • Use occupancy on the underlying channel instead of tracking individual presence events in spaces with many members, where you only need a count of active users.
  • Leave spaces and close connections when they are no longer needed to tidy up resources.