# What one AI reply on WhatsApp really costs when Zapier runs the flow

> Source: <https://dev.to/murad_adil_auto/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow-4llc>
> Published: 2026-11-23 13:00:06+00:00

**Recommendation:** Compute per-reply cost from the API usage object's cached and uncached input plus output tokens, and add Zapier task and WhatsApp message fees before estimating monthly spend.
More in the playbook "Controlling LLM cost": <https://wpnews.pro/playbooks/llm-cost>

This article was drafted with AI help and reviewed by the author.

Someone asks "how much will the WhatsApp AI assistant cost us a month?" and the first answer is usually the model bill.

That's one line out of three. When a Zap runs the flow, every AI reply also uses Zapier tasks, and the reply itself is a WhatsApp message that Meta may charge for. On a small or mid-sized flow the model line can end up the smallest of the three.

This post does two things. It gives you a per-reply formula you can fill in with your own numbers. Then it adds one Code by Zapier step that logs the real model cost of each reply on the HubSpot contact and flags a handoff when one conversation gets expensive.

All prices in this post are placeholders. The code was run locally against sample inputs with Node.js. It wasn't run inside Zapier, HubSpot or WhatsApp.

A typical inbound AI reply flow looks like this:

``` text Trigger: Webhooks by Zapier (Catch Hook) inbound WhatsApp message -> Filter: drop status callbacks and duplicates -> HubSpot: Find Contact by phone -> Webhooks by Zapier: POST to the model API -> Code by Zapier: cost and budget check -> Paths A: handToHuman = no -> WhatsApp send reply -> HubSpot update contact B: handToHuman = yes -> HubSpot create task -> WhatsApp send handoff note` ``

Your flow might use a built-in AI app instead of a raw webhook. The cost lines are the same. You just might not see the token counts as easily.

Zapier counts a task for each successful action step. Triggers don't count. Filter and Paths steps don't count. Formatter doesn't count. Code by Zapier does count, one task per run within your plan's standard runtime. Steps that error or don't run don't count. Replaying a whole Zap run counts the successful steps again.

That's from Zapier's own task usage help page. It changes, so recheck it for your plan.

In the Zap above, path A runs these task-counting steps per reply:

So about five tasks per AI reply. Add one more if you split the model work into a classify call and an answer call.

Your cost per task is your plan price divided by the tasks it includes, or the overage rate if you go past it. Check your own plan page.

The model API returns a usage object with each response. If you call OpenAI's Responses API, you get `usage.input_tokens`, `usage.output_tokens`, and `usage.input_tokens_details.cached_tokens`. Cached tokens are part of input tokens, not extra. Other providers use different field names for the same idea.

Per reply:

``` text model cost = (uncached input x input price + cached input x cached price + output x output price) / 1,000,000` ``

The input side grows fast in a chat. Each reply resends the system prompt, any FAQ text you paste in, and the conversation so far. A short customer question can still mean thousands of input tokens.

Meta's pricing page says it charges per delivered message, by category and by the recipient's country code. User messages to you are free.

The part that changed recently matters for AI replies. Free-form replies inside the 24-hour customer service window are "service" messages. Per Meta's pricing page, from 1 October 2026 each business phone number gets the first 1,000 service messages a month free, and service messages after that are charged at the published rate. Utility templates sent inside an open window are now charged too.

So a busy AI assistant isn't free on the WhatsApp side anymore. If your provider is a BSP, they may add their own markup on top. Read Meta's current rate card and your BSP's pricing before you plug in a number.

These numbers are invented to show the arithmetic. Replace every one of them.

| Assumption | Example value | | --- | --- | | AI replies per month | 2,000 | | Input tokens per reply | 3,000, of which 2,000 cached | | Output tokens per reply | 250 | | Example model prices per 1M tokens | input 1.00, cached 0.10, output 4.00 USD | | Task-counting steps per reply | 5 |

Model tokens:

Zapier: 5 x 2,000 = 10,000 tasks. Whether that's cheap depends on whether it fits your plan or pushes you to the next tier.

WhatsApp: 2,000 service replies, 1,000 free, 1,000 at your market's service rate.

With these made-up numbers, the model is a few dollars. The task volume is what moves your Zapier plan, and the WhatsApp line is the one that scales with every message. Your numbers will be different. The point is to fill in all three before anyone quotes a monthly figure.

A monthly estimate is a guess. A cost logged on every reply is a measurement. HubSpot is a good place for it, because the conversation already lives on the contact.

Create two custom contact properties first:

`ai_window_cost_usd` (number)`ai_window_started_at` (date and time, or a single-line text holding an ISO timestamp)
These are example internal names. Use whatever your portal allows.

Then map these fields into the Code by Zapier step:

| Input name | Mapped from | | --- | --- | | `inputTokens` | model response, `usage.input_tokens` | | `cachedTokens` | model response, `usage.input_tokens_details.cached_tokens` | | `outputTokens` | model response, `usage.output_tokens` | | `windowCostUsd` | HubSpot Find Contact, `ai_window_cost_usd` | | `windowStartedAt` | HubSpot Find Contact, `ai_window_started_at` |

Zapier passes every input as a string, so the code converts and guards each one.

``` js // Code by Zapier (JavaScript). Runs right after the model call. // Prices are placeholders. Copy current rates from your provider's pricing page. const PRICE*PER*MILLION = { input: 1.0, // example USD per 1M uncached input tokens cached: 0.1, // example USD per 1M cached input tokens output: 4.0 // example USD per 1M output tokens } const BUDGET*PER*WINDOW*USD = 0.5 // example cap per contact per 24-hour window const WINDOW*MS = 24  *60*  60 * 1000

const num = (value) => { const n = Number(value) return Number.isFinite(n) && n >= 0 ? n : 0 }

const inputTokens = num(inputData.inputTokens) const cachedTokens = Math.min(num(inputData.cachedTokens), inputTokens) const outputTokens = num(inputData.outputTokens) const usageMissing = inputData.inputTokens === undefined || inputData.inputTokens === ''

const callCost = ((inputTokens - cachedTokens)  *PRICE*PER*MILLION.input + cachedTokens*  PRICE*PER*MILLION.cached + outputTokens * PRICE*PER*MILLION.output) / 1e6

const now = Date.now() const windowStart = Date.parse(inputData.windowStartedAt || '') const windowOpen = Number.isFinite(windowStart) && now - windowStart < WINDOW_MS

const previousTotal = windowOpen ? num(inputData.windowCostUsd) : 0 const newTotal = previousTotal + callCost

return { callCostUsd: callCost.toFixed(6), windowCostUsd: newTotal.toFixed(6), windowStartedAt: windowOpen ? inputData.windowStartedAt : new Date(now).toISOString(), handToHuman: usageMissing || newTotal >= BUDGET*PER*WINDOW_USD ? 'yes' : 'no', usageMissing: usageMissing ? 'yes' : 'no' } ```

Then use the step's outputs:

`handToHuman`
`windowCostUsd` and `windowStartedAt` back to the contact
A few choices in that code are worth calling out.

**The budget window isn't Meta's window.** Meta's customer service window resets with each user message. The code uses a simpler rolling 24 hours from the first AI reply. That's enough to catch one conversation that keeps going in circles. Change it if you need something else.

**Missing usage means hand off.** If the model call didn't return token counts, something unusual happened. A changed response shape, an error body, or a different model. The safest default is to stop the bot and let a person look. You can relax that once you trust the mapping.

**Cached tokens are capped at input tokens.** It's a small guard against a bad mapping. Cached tokens should never be more than input tokens.

**Prices live in the code on purpose, but only as placeholders.** When your provider changes prices, you change one object. Better still, keep the raw token counts in a Zapier Table or a sheet too, so you can recompute old months with new prices.

Once you can see cost per reply, the levers inside Zapier are concrete.

**Answer the boring questions without the model.** Opening hours, address and "talk to a person" can be caught with a Filter or Paths rule before the model step. Filter and Paths don't use tasks, and a fixed reply doesn't use tokens.

**Drop duplicates early.** WhatsApp webhooks can be delivered more than once. If a duplicate gets past the trigger, you pay for the model call, the tasks and a second WhatsApp message. Filter on the message ID before anything else runs.

**Keep the stable part of the prompt first.** Provider prompt caching works on a repeated prefix. Put the system prompt and fixed FAQ text at the start, unchanged between calls, and the conversation after it.

**Don't replay whole runs casually.** A full replay re-runs every successful step. For an AI reply flow, that can mean a second model call and a second message to the customer.

**Cap the output.** Set a max output tokens value on the model call. A WhatsApp reply rarely needs to be long.

If you want a wider view of agent costs beyond a single Zap, including voice minutes, hosting and the people time to maintain it, there's a good breakdown in this [article on what an AI agent costs per month](https://octacer.com/blogs/ai-agent-cost-per-month).
