How to Cap AI Spend on a Webhook Across Zapier, Make, and n8n
Add per-day request counters and short prompts so a busy webhook cannot blow past your AI budget.
When a webhook calls a paid model on every request, a sudden spike or a runaway sender can cost real money fast. The defense is a simple daily counter plus disciplined prompting. The same idea works in Zapier, Make, and n8n; only the storage step differs.
What you need
- An AI webhook already running in Zapier, Make, or n8n
- A counter store: Storage by Zapier, a Make Data store, or n8n static data
- A daily request limit you are comfortable paying for
Step 1: Read and bump a daily counter
At the start of the workflow, read a counter keyed by today's date, for example calls-2026-06-21. If it is at or above your limit, stop before the model call. Otherwise increment it and continue.
const day = new Date().toISOString().slice(0, 10);
const data = $getWorkflowStaticData('global');
const key = 'calls-' + day;
data[key] = (data[key] || 0) + 1;
if (data[key] > 500) {
throw new Error('Daily AI limit reached - skipping model call');
}
return $input.all();Step 2: Shrink the prompt and output
Cost scales with tokens. Trim the input to only what the model needs, set a low max_tokens, and pick a smaller model when the task is simple. A classification job rarely needs a flagship model.
{
"model": "gpt-5-mini",
"max_tokens": 60,
"messages": [
{ "role": "user", "content": "{{trimmed_input}}" }
]
}Step 3: Alert when you near the cap
Add a branch that sends a notification when the counter crosses, say, 80 percent of the limit. You find out before the cap kicks in rather than after requests start failing.
Result: even a flood of webhook traffic stops at your chosen daily ceiling, so your AI bill stays predictable no matter what hits the URL.
Watch related tutorials
25:00
18:00
60:00
27:30
22:00
25:00