{"slug": "what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow", "title": "What one AI reply on WhatsApp really costs when Zapier runs the flow", "summary": "A developer published a per-reply cost formula for WhatsApp AI assistants built on Zapier, breaking the total into three lines: model tokens, Zapier tasks, and Meta's WhatsApp message fees. The writeup notes that each AI reply consumes roughly five task-counting Zapier steps, and that Meta will begin charging for service messages beyond the first 1,000 per business number per month starting October 1, 2026. The accompanying Code by Zapier step logs each reply's real model cost to the HubSpot contact and flags a human handoff when a conversation gets expensive; the code was tested locally with Node.js but not inside Zapier, HubSpot or WhatsApp.", "body_md": "This article was drafted with AI help and reviewed by the author.\n\nSomeone asks \"how much will the WhatsApp AI assistant cost us a month?\" and the first answer is usually the model bill.\n\nThat'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.\n\nThis 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.\n\nAll 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.\n\nA typical inbound AI reply flow looks like this:\n\n``` 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` ``\n\nYour 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.\n\nZapier 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.\n\nThat's from Zapier's own task usage help page. It changes, so recheck it for your plan.\n\nIn the Zap above, path A runs these task-counting steps per reply:\n\nSo about five tasks per AI reply. Add one more if you split the model work into a classify call and an answer call.\n\nYour 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.\n\nThe 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.\n\nPer reply:\n\n``` text model cost = (uncached input x input price + cached input x cached price + output x output price) / 1,000,000` ``\n\nThe 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.\n\nMeta's pricing page says it charges per delivered message, by category and by the recipient's country code. User messages to you are free.\n\nThe 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.\n\nSo 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.\n\nThese numbers are invented to show the arithmetic. Replace every one of them.\n\n| 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 |\n\nModel tokens:\n\nZapier: 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.\n\nWhatsApp: 2,000 service replies, 1,000 free, 1,000 at your market's service rate.\n\nWith 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.\n\nA 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.\n\nCreate two custom contact properties first:\n\n`ai_window_cost_usd` (number)`ai_window_started_at` (date and time, or a single-line text holding an ISO timestamp)\nThese are example internal names. Use whatever your portal allows.\n\nThen map these fields into the Code by Zapier step:\n\n| 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` |\n\nZapier passes every input as a string, so the code converts and guards each one.\n\n``` 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\n\nconst num = (value) => { const n = Number(value) return Number.isFinite(n) && n >= 0 ? n : 0 }\n\nconst inputTokens = num(inputData.inputTokens) const cachedTokens = Math.min(num(inputData.cachedTokens), inputTokens) const outputTokens = num(inputData.outputTokens) const usageMissing = inputData.inputTokens === undefined || inputData.inputTokens === ''\n\nconst callCost = ((inputTokens - cachedTokens)  *PRICE*PER*MILLION.input + cachedTokens*  PRICE*PER*MILLION.cached + outputTokens * PRICE*PER*MILLION.output) / 1e6\n\nconst now = Date.now() const windowStart = Date.parse(inputData.windowStartedAt || '') const windowOpen = Number.isFinite(windowStart) && now - windowStart < WINDOW_MS\n\nconst previousTotal = windowOpen ? num(inputData.windowCostUsd) : 0 const newTotal = previousTotal + callCost\n\nreturn { 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' } ```\n\nThen use the step's outputs:\n\n`handToHuman`\n`windowCostUsd` and `windowStartedAt` back to the contact\nA few choices in that code are worth calling out.\n\n**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.\n\n**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.\n\n**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.\n\n**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.\n\nOnce you can see cost per reply, the levers inside Zapier are concrete.\n\n**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.\n\n**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.\n\n**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.\n\n**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.\n\n**Cap the output.** Set a max output tokens value on the model call. A WhatsApp reply rarely needs to be long.\n\nIf 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).", "url": "https://wpnews.pro/news/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow", "canonical_source": "https://dev.to/murad_adil_auto/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow-4llc", "published_at": "2026-11-23 13:00:06+00:00", "updated_at": "2026-11-23 13:12:30.906830+00:00", "lang": "en", "topics": ["ai-agents", "ai-products"], "entities": ["Zapier", "WhatsApp", "Meta", "HubSpot", "OpenAI", "Node.js"], "also_reported_by": [], "takeaway": "Budget each WhatsApp AI reply across three lines — model tokens, roughly five Zapier tasks per reply, and Meta's per-message fee — and log per-reply model cost in a Code by Zapier step to trigger a human handoff when a conversation gets expensive.", "recommendation": {"advice": "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.", "playbook": "llm-cost", "playbook_url": "https://wpnews.pro/playbooks/llm-cost"}, "alternates": {"html": "https://wpnews.pro/news/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow", "markdown": "https://wpnews.pro/news/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow.md", "text": "https://wpnews.pro/news/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow.txt", "jsonld": "https://wpnews.pro/news/what-one-ai-reply-on-whatsapp-really-costs-when-zapier-runs-the-flow.jsonld"}}