Why agents need a budget, not just a balance
A person running searches notices when a job looks expensive. An agent does not, unless you build that judgement in. It can misread a task, loop on a retry, or decide that enriching every row in a large table is the helpful thing to do. A prepaid balance limits the damage eventually, but only after the balance is gone, which may be money you meant for something else.
This guide sets up a layered budget so that an agent buying B2B data can work without someone watching every call. Each layer catches a different failure: the account cap stops the month from running away, the key caps stop one agent from starving another, the per-request ceiling stops a single bad call, and alerts tell a human before any of those limits bite. The AI agent entry covers the broader pattern.
Prerequisites
You need a Dizo account owner who controls billing, because agents cannot sign themselves up or add payment methods. Live access goes to people who sign up, with 250 free credits. Until then a dz_test_ key returns synthetic data and never spends credits, so you can build and test every control below against the sandbox.
You also need a rough description of what the agent does each day: how many people it searches, how many emails and phones it looks for, and whether it enriches companies. If you do not know yet, run it on a test key for a few days and count the calls.
Step 1: estimate what the agent should cost
Translate the agent's daily work into credits using the published rates. Searches cost 1 credit per 25 results. Email finds cost 1 credit and phone finds 10, both only when something is found. Person enrich is 2 credits when matched, company enrich 1. Free calls include count, balance, key info and pricing.
Take a hypothetical outbound agent that, every weekday, searches 200 people (8 credits), finds emails for the 120 it can (120 credits) and mobile numbers for 20 high-priority contacts (200 credits). That is 328 credits a day. Over 22 working days it is 7,216 credits. At the pay-as-you-go rate of $0.025 the month costs $180.40. On a Builder purchase at $0.021 it would be about $151.54. The cost estimator does the same arithmetic for other mixes.
Add headroom, but not much. The point of the budget is to catch behaviour you did not expect, so a cap far above the estimate catches nothing.
Step 2: set the account cap and alerts
The outermost layer is PUT /v1/billing/limits. Set monthly_cap_usd to a hard ceiling for the calendar month, refills included. For the example agent, $250 leaves room for a busy week without allowing a runaway. Set alerts_pct to [50, 80, 100] and list who should hear about it in alert_emails. Alerts go out by email and webhook at those thresholds and on every refill.
If you use auto-refill, it never exceeds the monthly cap. If a refill would push the month over, it is skipped, you get an alert, and calls stop with 402 monthly_cap_reached once the balance runs out. A refill of $100 when the balance drops below 1,000 credits fits comfortably under a $250 cap. Set locked: true if you want no API key, however scoped, to change these settings.
Step 3: create a capped key for the agent
Never hand an agent the owner's key. Create one with POST /v1/keys and give it only what it needs. For the example: scopes: ["data:read"], daily_cap_credits: 400, monthly_cap_credits: 8000, max_credits_per_request: 250, and allowed_endpoints listing search, email find and phone find. The secret is returned once, so store it in your secrets manager immediately.
Tune the key caps to the estimate from step 1. At 328 credits on a normal day, a 400-credit daily cap allows a busier day but stops a loop within hours instead of days. The 8,000-credit monthly cap sits just above the 7,216-credit estimate, so a genuine increase in workload shows up as an alert you can act on rather than a silent overspend.
Separate keys per agent also make reporting simple. GET /v1/billing lists per-key usage, so you can see which agent spent what without tagging every call yourself. If you connect over the MCP server instead of REST, the connection defaults to data:read and a 500-credit per-call limit unless you change it in the console.
Step 4: make the agent aware of its limits
Instruct the agent to call GET /v1/me once at the start of each session. The response lists its scopes, allowed endpoints, max_credits_per_request, and remaining daily and monthly credits. Over MCP the same call is dizo_whoami. An agent that knows it has 1,640 credits left today can plan its work instead of discovering the limit by hitting it.
Put the rule in the system prompt in plain words: plan within the remaining budget, and stop and ask a person when monthly spend nears the cap. Also tell it never to call billing write endpoints such as top-up, auto-refill, limits or keys without explicit approval in the conversation. A key without billing:write cannot call them anyway, but saying so keeps the agent from trying.
Step 5: quote large jobs and cap every call
Any call likely to exceed roughly 100 credits should be quoted first. Add "dry_run": true to the same request body and Dizo returns the cost without spending anything or returning data. If the quote fits the plan, send the real call. How to use dry-run quotes covers the mechanics in detail.
Separately, send max_credits on every billable request as a hard ceiling for that call. It costs nothing to include and turns a mistaken loop over 500-result pages into a bounded mistake. Pair it with an Idempotency-Key header on every POST, so a retry within 24 hours is never charged twice.
Step 6: watch spend while the agent runs
Every response carries x-dizo-credits-used and x-dizo-credits-remaining. Have the agent read them and keep a running total. In long loops, call GET /v1/billing between batches; it is free and shows balance, month-to-date spend, the cap and refill settings.
Subscribe a webhook to billing.cap_warning, billing.cap_reached, billing.low_balance and billing.refilled with POST /v1/webhooks, so your own systems can pause work or notify a channel. When a call fails, branch on error.code and follow error.fix. Retry only when error.retryable is true, after error.retry_after seconds. A 402 means a cap was hit: the right response is to stop and report, not to retry.
Variations: one agent, a fleet, or a workflow tool
A single agent in a chat client is the simple case: one key, modest caps, and a human nearby who sees the 80 percent alert. A fleet of agents, for example one per sales rep, needs a key each, with daily caps set low enough that one busy rep cannot use the whole month by Wednesday. The account cap then acts as the backstop for the group rather than the main control.
Workflow tools that call the REST API on a schedule are the third pattern. They are predictable, which makes them easy to budget, but they also run unattended overnight. Give each workflow its own key with an allowed_endpoints list that matches exactly the calls it makes, so a mis-edited step cannot start calling phone finds at 10 credits each.
Whatever the pattern, size open-ended jobs with POST /v1/count before searching. It is free, returns the total number of matching records, and tells the agent how big a job would be before any credit is at stake. It is limited to 5 requests per second per key.
Mistakes to avoid
Sharing one key across several agents hides which one is spending and lets a single misbehaving agent exhaust the shared cap. Setting caps far above the estimate means they never trigger when something goes wrong. Leaving billing:write on an agent key invites it to top up its own balance, which is the one thing a budget exists to prevent.
Another common gap is treating alerts as someone else's problem. If the 80 percent email goes to an unmonitored inbox, you have a cap but no warning. Route alerts to a person who can decide whether to raise the limit or pause the agent.
Frequently asked questions
What happens when my agent hits a cap?
Calls return a 402, for example monthly_cap_reached for the account cap. Nothing beyond the cap is spent. The agent should stop, report what it finished and ask a person whether to raise the limit.
Can an agent raise its own limits?
Only with a key that has billing:write, and Dizo's agent guidance says to do that only with explicit human approval. Keys are read-only for billing by default, and the account owner can set locked: true to block all API changes to billing.
Does auto-refill bypass my monthly cap?
No. Auto-refill never exceeds the monthly cap. A refill that would push the month over is skipped, you get an alert, and calls stop once the balance runs out.
Is a dry run free?
Yes. A request with "dry_run": true returns the exact credit cost and spends nothing. Over MCP, dizo_quote does the same for any call.
How do I see spend per agent?
Give each agent its own key. GET /v1/billing returns per-key usage against each key's monthly cap, alongside the account balance and month-to-date spend.
How much headroom should I leave above the estimate?
Enough to absorb a normal busy day, not enough to hide a malfunction. In the example, a daily cap about a fifth above the typical day and a monthly cap about a tenth above the estimate works well. Review both after the first month of real usage.
What caps does an MCP connection get by default?
MCP connections get data:read only and a 500-credit per-call limit unless you change them in the console. Use a dedicated key with your own caps for tighter control.
Last reviewed 2026-11-24.