Spending limits for n8n AI workflows
Last updated 24 November 2026
n8n makes it easy to run AI workflows for many clients or teams on one provider account. Then one stuck workflow can use up the money meant for everyone, and the provider’s own limit stops every workflow at once. With Xpenvo, each client or workflow gets its own hard limit, a loop is paused on its own, and you can see what each one spent.
1. Make a budget and a key for each client
Create a free account. For each client, make a budget (for example $5 a day) and an agent key for it under Agent keys. The key starts with xpv_ and is shown once. You keep your own OpenAI or Anthropic key and keep paying them directly; Xpenvo never stores it.
2. Add an OpenAI credential that goes through Xpenvo
In n8n, create a new OpenAI credential (one per client) and fill in:
| API Key | Your own OpenAI key (sk-…) |
| Base URL | https://agents.xpenvo.com/v1 |
| Add Custom Header | On |
| Header Name | X-Xpenvo-Key |
| Header Value | That client’s agent key (xpv_…) |
Save it. n8n tests the connection, and the model list in the OpenAI Chat Model node fills in as usual. Both are free and checked against your key. Then use this credential in the client’s workflows, in the AI Agent, Basic LLM Chain or OpenAI nodes. Turning on Use Responses API works too.
Using Claude
Create an Anthropic credential the same way: your own Anthropic key, Base URL https://agents.xpenvo.com (without /v1), and the custom header X-Xpenvo-Key with the client’s agent key. Then pick it in the Anthropic Chat Model node.
What happens at the limit
When a client’s budget would be passed, the request is stopped before it reaches the provider, so it is never billed. n8n shows the reason in the node’s error, for example that today’s budget is used up, and you can use n8n’s error workflow to be told. Every other client keeps running.
If a workflow sends the same request again and again, as stuck loops do, Xpenvo pauses that client’s key and emails you. You can raise a limit, resume a key or stop everything with the kill switch from the dashboard, and see what each client spent under Activity.
Tested with n8n
We ran n8n workflows through Xpenvo with the OpenAI Chat Model (Chat Completions and the Responses API) and the Anthropic Chat Model. If your n8n has no custom header option, put your agent key, a colon, then your provider key in the API key field instead: xpv_…:sk-…. Xpenvo splits them and sends only your provider key on.
Questions
How do I set a spending limit for an n8n AI workflow?
Create an OpenAI or Anthropic credential in n8n with the base URL set to Xpenvo Agents and a custom header X-Xpenvo-Key holding an agent key on its own budget. Every model call in workflows using that credential is checked against the limit before it is sent.
Can I limit each client separately in n8n?
Yes. Give each client its own Xpenvo agent key and budget, and its own n8n credential. A stuck workflow for one client is stopped without affecting the others, and you can see what each client spent.
Does the n8n credential test still work?
Yes. Xpenvo answers the model list n8n uses to test a credential and fill its model menu, checked against your agent key, at no cost.
More: full setup guide · model prices · tested guarantees · security. Questions? [email protected]