AI support chatbot pricing example
This example shows pricing for an AI support chatbot using Ably's AI Transport, where an agent streams token responses to users. It uses Ably's per-message and per-minute billing model.
Scenario
- Chats: 35,000 per month
- Prompts per chat: 4 (to reach resolution)
- Tokens per response: 300 token events
- Agent stream rate: 75 appends per second
- Chat duration: 3 minutes average
Total cost: $109.50/month
Cost breakdown
The following breakdown shows the cost of connections, channels and messages in this scenario.
How messages are counted
Every chat message counts as a billable message. Messages are counted when a user sends a prompt and when the agent delivers a response. Usage is billed in increments of one million messages, rounded up.
One user prompt sent to an agent = 2 messages (one sent to Ably + one delivered to the agent).
How rollup reduces token messages
Without rollup, each streamed token would be a separate message: 300 tokens = 300 messages per response. Rollup batches tokens together, reducing this to 100 messages per response (a 66% saving). Because the append rule is required to use this pattern, persistence is automatically enabled and those messages are stored.
Messages generated by this scenario
| Message type | Calculation | Messages |
|---|---|---|
| User prompts | 35,000 chats × 4 prompts × (1 sent + 1 delivered) | 280,000 |
| Agent responses | 35,000 chats × 4 responses × 100 msgs × (1 sent + 1 delivered) | 28,000,000 |
| Persisted messages | 14,140,000 inbound messages persisted | 14,140,000 |
| Total messages | 280,000 + 28,000,000 + 14,140,000 | 42,420,000 |
| Total message cost | 43,000,000 × $2.50/M | $107.50 |
How connection and channel minutes are counted
Both connection minutes and channel minutes are rounded up per million minutes used.
Connection minutes
Connection minutes are billed based on how long users remain connected.
| Item | Calculation | Total |
|---|---|---|
| Connection minutes | 35,000 chats × 3 mins × 2 (user + agent) | 210,000 mins |
| Connection minutes cost | 1,000,000 mins × $1.00/M | $1.00 |
Channel minutes
Channel minutes are billed based on how long channels are active for.
| Item | Calculation | Total |
|---|---|---|
| Channel minutes | 35,000 chats × 3 mins | 105,000 mins |
| Channel cost | 1,000,000 mins × $1.00/M | $1.00 |
Total cost
The total monthly cost for 35,000 chats.
| Item | Cost |
|---|---|
| Messages | $107.50 |
| Connection minutes | $1.00 |
| Channel minutes | $1.00 |
| Total cost | $109.50/month |