CodeWords raises $9M seed round
BlogResources

How to scale a WhatsApp AI chatbot without going broke

Learn how to scale your WhatsApp AI chatbot cost-effectively — right-size AI models, manage memory, batch sends, and use CodeWords pricing tiers smartly.

Rebecca PearsonRebecca Pearson6 min read
How to scale a WhatsApp AI chatbot without going broke

Scaling a WhatsApp AI chatbot is exciting — until the invoice arrives. What starts as a tidy automation serving a handful of users can balloon into a surprisingly expensive operation if you haven't thought through how each conversation, model call, and message send adds up. The good news is that most of the cost bloat is avoidable with a few deliberate decisions made early.

TL;DR

  • Right-sizing your AI model — using a lightweight model for simple queries — can cut inference costs by 80% or more without users noticing a drop in quality.
  • Limiting conversation memory and caching common responses prevents redundant API calls from eroding your margin.
  • CodeWords' Personal Device connection removes daily message caps entirely, making it the most cost-efficient path for high-volume operations.

Why scaling a WhatsApp AI chatbot gets expensive fast

Every message your bot sends or receives triggers a chain of costs: a model inference call, possibly a memory read and write, and (if you're using the Business API) a conversation fee from Meta. At low volume, these are negligible. At 500 or 5,000 conversations a day, the math looks very different.

The three biggest cost drivers are:

  1. AI model selection — using a frontier model for every single query, including "what are your opening hours?"
  2. Unbounded conversation memory — storing and replaying entire conversation histories on every turn
  3. Unmanaged outbound volume — sending messages without rate controls or daily caps

Let's work through each one.

Right-size your AI model to the task

Not every query deserves a frontier model. GPT-5 is powerful, but sending it a question like "Do you open on Sundays?" is like hiring a surgeon to put on a plaster. The answer is always the same; you don't need reasoning or nuance.

A practical tiering approach:

  • Simple FAQs and lookups (hours, pricing, location): use GPT-5-mini or Claude Haiku 4.5. These are a fraction of the cost of their bigger siblings and are more than capable for factual, low-complexity responses.
  • Multi-turn reasoning, objection handling, or personalised recommendations: use GPT-5 or Claude Sonnet 4.6. Reserve these for the conversations that actually benefit from deeper intelligence.

In CodeWords, you can set your default model and then override it per-workflow or per-intent. A well-structured system prompt can also instruct the model to keep responses brief for simple intents, which reduces output tokens — and output tokens are where most of the cost lives.

A rough rule of thumb: if you can write the answer in a lookup table, you don't need a large model to generate it.

Limit your conversation memory window

Conversation memory is one of the most valuable features of a WhatsApp AI chatbot — and one of the most misunderstood cost drivers. By default, many setups replay the entire conversation history on every turn. For a ten-message thread, that's ten times the tokens compared to a single-turn response.

CodeWords uses Redis for per-user conversation memory, keyed by phone number. The default TTL (time-to-live) is one to two hours, which means context expires naturally and doesn't accumulate indefinitely.

But you can go further:

  • Cap the memory window: only include the last three to five exchanges in the prompt rather than the full history. Most conversations don't need context from ten turns ago.
  • Summarise instead of replay: after a set number of turns, summarise the conversation so far into a single context block. This dramatically reduces tokens while preserving the important thread.
  • Set aggressive TTLs for low-stakes bots: if your bot handles short transactional queries — order status, appointment confirmations — a 30-minute TTL is often plenty.

Each of these reduces the token count per API call, which is a direct reduction in inference cost.

Cache frequent responses

Some questions get asked constantly. If your bakery bot gets "What time do you close?" 200 times a day, you're making 200 AI inference calls to produce functionally identical answers. That's wasteful.

Response caching works by storing the output for a given input and serving it directly without hitting the model again. Even a simple cache that covers your 20 most-asked questions can cut daily inference calls significantly.

In practice, this looks like:

  1. Identify your top recurring queries (check your conversation logs)
  2. Write canonical answers for each
  3. Use intent matching or keyword detection to route those queries to cached responses
  4. Send everything else to the model

You don't need a sophisticated setup — a simple lookup in Google Sheets or Notion connected via Composio can serve as a lightweight FAQ cache that Cody, CodeWords' AI automation assistant, can query before escalating to inference.

Batch scheduled sends

Outbound messaging — sending reminders, follow-ups, or updates — is often the highest-volume activity for a growing bot. Sending these one at a time, continuously throughout the day, increases API overhead and, with the Business API, can push you into higher Meta conversation tiers faster than you'd expect.

Batching your scheduled sends means grouping outbound messages into defined windows — say, 9am and 2pm — rather than drip-sending all day. This has several benefits:

  • Reduced API call overhead
  • Easier monitoring and error handling
  • More predictable cost per day
  • Better compliance with anti-spam best practices (irregular timing patterns look more human)

CodeWords supports scheduled automation workflows, so you can configure a daily 9am send for appointment reminders rather than triggering them the moment a booking is made.

Use daily caps to protect your budget

Daily message caps are a cost control mechanism, not just a compliance feature. Setting a cap means that even if something goes wrong — a loop, a surge in traffic, an unexpected viral post — you won't wake up to a runaway bill.

On the CodeWords Business API plans, caps are built in: 5 DMs/day on Starter, 20 on Growth, and 50 on Business. These limits are intentionally conservative because responsible messaging also protects your sender reputation.

If your volume genuinely exceeds these limits, the right answer usually isn't to upgrade to a plan with a higher cap — it's to switch to Personal Device connection.

Personal Device: the high-volume, low-cost path

CodeWords' Personal Device connection lets you connect your own WhatsApp number via a pairing code in about 30 seconds. Unlike the Business API, it has no daily message caps and no per-conversation fees from Meta.

For businesses handling hundreds of inbound conversations a day — customer support, order processing, lead qualification — Personal Device is almost always the more cost-effective choice. You're not paying Meta per conversation. You're just paying for CodeWords and your AI model inference.

The tradeoff is that outbound messaging carries more risk with a personal number (see our guide on WhatsApp automation mistakes that get your number flagged), so keeping inbound-first is even more important here. But for a bot that's primarily responding to customer-initiated conversations, Personal Device is the right call.

CodeWords pricing tiers: choosing the right plan

CodeWords offers plans across a range of scales. Here's how to match your volume to the right tier:

  • Getting started or testing: the lower tiers give you enough room to validate your bot without committing to scale costs
  • Growing business with moderate volume: mid-tier plans cover most SME use cases, especially when combined with model right-sizing
  • High volume or enterprise: at this point, Personal Device connection often makes more sense than a high-cap Business API plan

You can review the full breakdown at codewords.agemo.ai/pricing. The key principle is to choose the plan that matches your actual send volume — not your aspirational volume — and then optimise inference costs separately.

A practical cost-optimisation checklist

Before you scale, run through this:

  • Are you using the lightest model that can handle each query type?
  • Is your memory window capped at a sensible number of turns?
  • Do you have a cached response layer for your top 20 recurring questions?
  • Are scheduled sends batched into defined windows?
  • Have you set daily message caps appropriate to your plan?
  • Have you evaluated whether Personal Device is more cost-effective at your volume?

Most businesses find that ticking four or five of these boxes reduces their per-conversation cost by 40 to 60 percent without any noticeable change in bot quality.

Scaling sustainably

Cost optimisation isn't a one-time task — it's an ongoing practice. As your volume grows, revisit your model choices, cache coverage, and memory configuration every few months. What was efficient at 100 conversations a day may need tuning at 1,000.

CodeWords makes this easier than most platforms because the infrastructure — Redis memory, Composio integrations, model selection — is all managed for you. You're configuring behaviour, not rebuilding plumbing every time you want to change something.

If you're ready to build or optimise your WhatsApp AI chatbot, start with CodeWords and describe what you want to Cody. You can be live in under an hour.

Get started today

Your first agent is free to build.

Describe what you need. Cody handles the build, the connections, and the deployment.