# Chat pricing How Chat SDK features contribute to your message count and strategies to optimize costs. The [Chat SDK](https://ably.com/docs/chat.md) is built on top of [Pub/Sub](https://ably.com/docs/pub-sub.md). All Chat operations generate Pub/Sub messages that follow the same counting rules. ## Chat operations The following table shows how Chat operations contribute to your message count: | Operation | Messages counted | | --- | --- | | [Messages](https://ably.com/docs/chat/rooms/messages.md) || | 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](https://ably.com/docs/chat/rooms/history.md) || | History retrieval | 1 outbound message per retrieved message | | [Typing indicators](https://ably.com/docs/chat/rooms/typing.md) || | Typing keystroke | 1 inbound message; repeats every heartbeat interval (default 10s) | | Typing keystroke delivery | 1 outbound message per subscriber per heartbeat | | Typing stop | 1 inbound message | | Typing stop delivery | 1 outbound message per subscriber | | [Room reactions](https://ably.com/docs/chat/rooms/reactions.md) || | Room reaction | 1 inbound message | | Room reaction delivery | 1 outbound message per subscriber | | [Message reactions](https://ably.com/docs/chat/rooms/message-reactions.md) || | Message reaction send | 1 inbound message | | Message reaction delete | 1 inbound message | | Message reaction summary delivery | 1 outbound message per subscriber; multiple reactions may be rolled up into a single summary | | [Presence](https://ably.com/docs/chat/rooms/presence.md) || | 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](https://ably.com/docs/chat/rooms/occupancy.md) || | Occupancy event | 1 outbound message per subscriber (generated on membership changes, debounced up to 15s) | | [Moderation](https://ably.com/docs/chat/moderation.md) || | Moderation rule invocation (before or after publish) | 1 outbound webhook event per moderated message | ## Rooms and channels Each Chat [room](https://ably.com/docs/chat/rooms.md) is backed by a single Ably Pub/Sub channel. All room features, such as messages, typing, reactions, presence, and occupancy, share that one channel. Channels contribute to your [channel count](https://ably.com/docs/platform/pricing.md#channels). The more rooms a client is attached to, the more channels are consumed. [Detach](https://ably.com/docs/chat/rooms.md#detach) from rooms when they are no longer needed, and [release](https://ably.com/docs/chat/rooms.md#release) rooms that are no longer in use to reduce your channel count. ## Connections Ably bills each connected client for [connection minutes](https://ably.com/docs/platform/pricing.md#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. ## Cost optimization ### Reduce typing indicator frequency Increase the `heartbeatThrottleMs` [room option](https://ably.com/docs/chat/rooms.md#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](https://ably.com/docs/messages/batch.md#server-side) groups messages into single deliveries. Use this for high-throughput rooms where slight delay is acceptable. ### Use occupancy instead of presence Use [occupancy](https://ably.com/docs/chat/rooms/occupancy.md) instead of [presence](https://ably.com/docs/chat/rooms/presence.md) when you only need member counts, not individual identities. ## Documentation Index To discover additional Ably documentation: 1. Fetch [llms.txt](https://ably.com/llms.txt) for the canonical list of available pages. 2. Identify relevant URLs from that index. 3. Fetch target pages as needed. Avoid using assumed or outdated documentation paths.