|
| 1 | +--- |
| 2 | +title: "Chat pricing" |
| 3 | +meta_description: "Understand how Chat SDK features contribute to your message count, including messages, typing indicators, reactions, and cost optimization strategies." |
| 4 | +meta_keywords: "chat pricing, message counting, typing indicators, reactions, cost optimization" |
| 5 | +intro: "How Chat SDK features contribute to your message count and strategies to optimize costs." |
| 6 | +--- |
| 7 | + |
| 8 | +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. |
| 9 | + |
| 10 | +## Chat operations <a id="operations"/> |
| 11 | + |
| 12 | +The following table shows how Chat operations contribute to your message count: |
| 13 | + |
| 14 | +| Operation | Messages counted | |
| 15 | +| --- | --- | |
| 16 | +| [Messages](/docs/chat/rooms/messages) || |
| 17 | +| Send message | 1 inbound message | |
| 18 | +| Message delivery | 1 outbound message per subscriber | |
| 19 | +| Update message | 1 inbound message | |
| 20 | +| Message update delivery | 1 outbound message per subscriber | |
| 21 | +| Delete message | 1 inbound message | |
| 22 | +| Message deletion delivery | 1 outbound message per subscriber | |
| 23 | +| [History](/docs/chat/rooms/history) || |
| 24 | +| History retrieval | 1 outbound message per retrieved message | |
| 25 | +| [Typing indicators](/docs/chat/rooms/typing) || |
| 26 | +| Typing keystroke | 1 inbound message; repeats every heartbeat interval (default 10s) | |
| 27 | +| Typing keystroke delivery | 1 outbound message per subscriber per heartbeat | |
| 28 | +| Typing stop | 1 inbound message | |
| 29 | +| Typing stop delivery | 1 outbound message per subscriber | |
| 30 | +| [Room reactions](/docs/chat/rooms/reactions) || |
| 31 | +| Room reaction | 1 inbound message | |
| 32 | +| Room reaction delivery | 1 outbound message per subscriber | |
| 33 | +| [Message reactions](/docs/chat/rooms/message-reactions) || |
| 34 | +| Message reaction send | 1 inbound message | |
| 35 | +| Message reaction delete | 1 inbound message | |
| 36 | +| Message reaction summary delivery | 1 outbound message per subscriber; multiple reactions may be rolled up into a single summary | |
| 37 | +| [Presence](/docs/chat/rooms/presence) || |
| 38 | +| Presence enter | 1 inbound message | |
| 39 | +| Presence leave | 1 inbound message | |
| 40 | +| Presence update | 1 inbound message | |
| 41 | +| Presence event delivery | 1 outbound message per presence subscriber | |
| 42 | +| [Occupancy](/docs/chat/rooms/occupancy) || |
| 43 | +| Occupancy event | 1 outbound message per subscriber (generated on membership changes, debounced up to 15s) | |
| 44 | +| [Moderation](/docs/chat/moderation) || |
| 45 | +| Moderation rule invocation (before or after publish) | 1 outbound webhook event per moderated message | |
| 46 | + |
| 47 | +## Rooms and channels <a id="channels"/> |
| 48 | + |
| 49 | +Each Chat [room](/docs/chat/rooms) is backed by a single Ably Pub/Sub channel. All room features, such as messages, typing, reactions, presence, and occupancy, share that one channel. |
| 50 | + |
| 51 | +Channels contribute to your [channel count](/docs/platform/pricing#channels). The more rooms a client is attached to, the more channels are consumed. [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 to reduce your channel count. |
| 52 | + |
| 53 | +## Connections <a id="connections"/> |
| 54 | + |
| 55 | +Ably bills each connected client for [connection minutes](/docs/platform/pricing#connections). A connection-minute is counted for every minute a client maintains an open connection, regardless of activity. Clients that remain connected but idle still accrue connection minutes. Close connections when the client is done to stop accruing connection minutes. |
| 56 | + |
| 57 | +## Cost optimization <a id="optimization"/> |
| 58 | + |
| 59 | +### Reduce typing indicator frequency |
| 60 | + |
| 61 | +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. |
| 62 | + |
| 63 | +### Use server-side batching |
| 64 | + |
| 65 | +[Server-side batching](/docs/messages/batch#server-side) groups messages into single deliveries. Use this for high-throughput rooms where slight delay is acceptable. |
| 66 | + |
| 67 | +### Use occupancy instead of presence |
| 68 | + |
| 69 | +Use [occupancy](/docs/chat/rooms/occupancy) instead of [presence](/docs/chat/rooms/presence) when you only need member counts, not individual identities. |
0 commit comments