Skip to content
4 changes: 4 additions & 0 deletions src/data/nav/aitransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export default {
},
],
},
{
name: 'AI Transport pricing',
link: '/docs/ai-transport/pricing',
},
],
api: [],
} satisfies NavProduct;
4 changes: 4 additions & 0 deletions src/data/nav/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export default {
},
],
},
{
name: 'Chat pricing',
link: '/docs/chat/pricing',
},
{
name: 'Guides',
pages: [
Expand Down
9 changes: 4 additions & 5 deletions src/data/nav/liveobjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ export default {
link: '/docs/liveobjects/concepts/synchronization',
languages: ['javascript', 'swift', 'java'],
},
{
name: 'Billing',
link: '/docs/liveobjects/concepts/billing',
languages: ['javascript', 'swift', 'java'],
},
],
},
{
Expand Down Expand Up @@ -108,6 +103,10 @@ export default {
},
],
},
{
name: 'LiveObjects pricing',
link: '/docs/liveobjects/pricing',
},
],
api: [
{
Expand Down
4 changes: 4 additions & 0 deletions src/data/nav/livesync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default {
},
],
},
{
name: 'LiveSync pricing',
link: '/docs/livesync/pricing',
},
],
api: [
{
Expand Down
4 changes: 4 additions & 0 deletions src/data/nav/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export default {
link: '/docs/platform/pricing/billing',
name: 'Billing',
},
{
link: '/docs/platform/pricing/message-counting',
name: 'Message counting',
},
{
link: '/docs/platform/pricing/limits',
name: 'Limits',
Expand Down
4 changes: 4 additions & 0 deletions src/data/nav/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ export default {
},
],
},
{
name: 'Pub/Sub pricing',
link: '/docs/pub-sub/pricing',
},
{
name: 'Guides',
pages: [
Expand Down
4 changes: 4 additions & 0 deletions src/data/nav/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export default {
},
],
},
{
name: 'Spaces pricing',
link: '/docs/spaces/pricing',
},
],
api: [
{
Expand Down
39 changes: 39 additions & 0 deletions src/pages/docs/ai-transport/pricing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "AI Transport pricing"
meta_description: "Understand how AI Transport token streaming contributes to your message count, including per-token and per-response patterns."
meta_keywords: "AI Transport pricing, message counting, token streaming, message per response, message per token"
intro: "How AI Transport operations contribute to your message count and strategies to optimize costs."
---

[AI Transport](/docs/ai-transport) uses standard Pub/Sub messaging. Each token or message published to Ably counts as an inbound message, and each delivery to a subscriber counts as an outbound message.

## AI Transport operations <a id="operations"/>

The following table shows how AI Transport operations contribute to your message count:

| Operation | Messages counted |
| --- | --- |
| Token publish (per-token) | 1 inbound message per token |
| Token publish (per-response with [append rollup](/docs/ai-transport/token-streaming/token-rate-limits#per-response)) | Multiple tokens conflated into fewer inbound messages |
| Token delivery | 1 outbound message per subscriber |
| [Persistence](/docs/storage-history/storage) storage | 1 additional message per stored message |

The total cost depends on the [token streaming pattern](/docs/ai-transport/token-streaming#token-streaming-patterns) you choose. With per-token streaming, each token is a separate inbound message. With [message-per-response](/docs/ai-transport/token-streaming/message-per-response), append rollup conflates multiple tokens into fewer inbound messages, reducing costs. For example, 300 tokens can be conflated to approximately 100 inbound messages.

<Aside data-type="further-reading">
For how all Ably products count messages, see [message counting](/docs/platform/pricing/message-counting).
</Aside>

## Channels and connections <a id="channels-connections"/>

Each channel used for token streaming contributes to your [channel count](/docs/platform/pricing#channels). Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections) per minute of connection time.

## Cost optimization <a id="optimization"/>

### Use message-per-response streaming

The [message-per-response](/docs/ai-transport/token-streaming/message-per-response) pattern with [append rollup](/docs/ai-transport/token-streaming/token-rate-limits#per-response) conflates multiple tokens into fewer inbound messages, significantly reducing costs compared to per-token streaming.

### Use ephemeral messages

Mark messages as [ephemeral](/docs/pub-sub/advanced#ephemeral) to exempt them from persistence, rewind, resume, and integrations. Use this for streaming tokens where history is not needed.
72 changes: 72 additions & 0 deletions src/pages/docs/chat/pricing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: "Chat pricing"
meta_description: "Understand how Chat SDK features contribute to your message count, including messages, typing indicators, reactions, and cost optimization strategies."
meta_keywords: "chat pricing, message counting, typing indicators, reactions, cost optimization"
intro: "How Chat SDK features contribute to your message count and strategies to optimize costs."
---

The [Chat SDK](/docs/chat) is built on top of [Pub/Sub](/docs/pub-sub). All Chat operations generate Pub/Sub messages that follow the same counting rules.

## Chat operations <a id="operations"/>

The following table shows how Chat operations contribute to your message count:

| Operation | Messages counted |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest something like this format, to make the tables more readable and have fewer repeated links:

| Operation | Messages counted |
| --- | --- |
| [Pub/Sub](/docs/pub-sub) ||
| Publish | 1 inbound message |
| Message delivery | 1 outbound message per subscriber |
| [Presence](/docs/presence-occupancy/presence) ||
| Presence enter | 1 inbound message |
| Presence leave | 1 inbound message |
| Presence update | 1 inbound message |
| Presence event delivery | 1 outbound message per presence subscriber |
| [Message persistence](/docs/storage-history/storage) ||
| Persistence storage | 1 additional message per stored message |
| History retrieval | 1 message per retrieved message |

| --- | --- |
| [Messages](/docs/chat/rooms/messages) ||
| Send message | 1 inbound message |
| Message delivery | 1 outbound message per subscriber |
| Update message | 1 inbound message |
| Message update delivery | 1 outbound message per subscriber |
| Delete message | 1 inbound message |
| Message deletion delivery | 1 outbound message per subscriber |
| [History](/docs/chat/rooms/history) retrieval | 1 message per retrieved message |
| [Typing indicators](/docs/chat/rooms/typing) ||
| Typing keystroke | 1 inbound message; repeats every heartbeat interval (default 10s) |
| Typing indicator delivery | 1 outbound message per subscriber per heartbeat |
| Typing stop | 1 inbound message |
| Typing stop delivery | 1 outbound message per subscriber |
| [Reactions](/docs/chat/rooms/reactions) ||
| Room reaction | 1 inbound message |
| Room reaction delivery | 1 outbound message per subscriber |
| [Message reaction](/docs/chat/rooms/message-reactions) send | 1 inbound message |
| [Message reaction](/docs/chat/rooms/message-reactions) delete | 1 inbound message |
| Message reaction summary delivery | 1 outbound message per subscriber; multiple reactions may be rolled up into a single summary |
| [Presence](/docs/chat/rooms/presence) and [occupancy](/docs/chat/rooms/occupancy) ||
| Presence enter | 1 inbound message |
| Presence leave | 1 inbound message |
| Presence update | 1 inbound message |
| Presence event delivery | 1 outbound message per presence subscriber |
| Occupancy event | 1 outbound message per subscriber (generated on membership changes, debounced up to 15s) |
| [Moderation](/docs/chat/moderation) ||
| Moderation action | 1 inbound message; triggers a message update or delete which follows standard delivery |

<Aside data-type="further-reading">
For how all Ably products count messages, see [message counting](/docs/platform/pricing/message-counting).
</Aside>

## Rooms, channels, and connections <a id="rooms-connections"/>

Each Chat room maps to a set of underlying Pub/Sub channels. Each room feature (messages, typing, reactions, presence, occupancy) uses its own dedicated channel. The total number of channels used by a room depends on which features are active.

Channels contribute to your [channel count](/docs/platform/pricing#channels). The more rooms a client is attached to, and the more features enabled per room, the more channels are consumed.

Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections). Ably counts a connection-minute for every minute a client maintains an open connection, regardless of activity. Clients that remain connected but idle still accrue connection minutes.

## Cost optimization <a id="optimization"/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding some quick info on detaching from rooms and closing connections?


### Reduce typing indicator frequency

Increase the `heartbeatThrottleMs` [room option](/docs/chat/rooms#typing) to reduce typing indicator event frequency. The default is 10 seconds. Increase this value in rooms that tolerate delayed typing feedback.

### Use server-side batching

[Server-side batching](/docs/messages/batch#server-side) groups messages into single deliveries. Use this for high-throughput rooms where slight delay is acceptable.

### Detach from unused rooms

[Detach](/docs/chat/rooms#detach) from rooms when they are no longer needed, and [release](/docs/chat/rooms#release) rooms that are no longer in use. This reduces your channel count and connection usage. Close connections when the client is done to stop accruing connection minutes.

### Use occupancy instead of presence

Use [occupancy](/docs/chat/rooms/occupancy) instead of [presence](/docs/chat/rooms/presence) when you only need member counts, not individual identities. This avoids the n-squared presence event fan-out. For example, 200 members joining and leaving generates approximately **80,400 messages**. See [large-scale presence sets](/docs/presence-occupancy/presence#large-presence) for details.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use [occupancy](/docs/chat/rooms/occupancy) instead of [presence](/docs/chat/rooms/presence) when you only need member counts, not individual identities. This avoids the n-squared presence event fan-out. For example, 200 members joining and leaving generates approximately **80,400 messages**. See [large-scale presence sets](/docs/presence-occupancy/presence#large-presence) for details.
Use [occupancy](/docs/chat/rooms/occupancy) instead of [presence](/docs/chat/rooms/presence) when you only need member counts, not individual identities.

176 changes: 0 additions & 176 deletions src/pages/docs/liveobjects/concepts/billing.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/docs/liveobjects/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ LiveObjects [durably stores](/docs/liveobjects/storage) all objects on a channel

LiveObjects usage is billed based on [Ably's standard pricing model](/docs/platform/pricing). Since LiveObjects is powered by Ably's channel messages, any interaction with LiveObjects - whether sending or receiving operations, maintaining active channels, or keeping connections open through the Realtime LiveObjects API - translates into billable usage. Storage of objects themselves does not incur additional costs; however, there is a [limit](/docs/liveobjects/storage) on the size of the channel object.

For details on how using LiveObjects contributes to your billable usage, see [Billing](/docs/liveobjects/concepts/billing).
For details on how using LiveObjects contributes to your billable usage, see [LiveObjects pricing](/docs/liveobjects/pricing).

### Realtime API <a id="pricing-realtime"/>

Expand Down
Loading
Loading