# Every call gets a ceiling you choose.

> Send max_credits on any billable Dizo request to set a hard ceiling on what that one call can spend. A simple guard for scripts and AI agents.

`max_credits` is a hard limit on what a single request may spend. Set it from a dry-run quote or a quick formula, and a typo or a misread prompt can't become a large bill.

## Highlights
- **One field.** Add `"max_credits": 60` to the request body of any billable endpoint.
- **Hard ceiling.** The request cannot spend more than the number you send, whatever else it asks for.
- **Quote, then cap.** Use the `dry_run` maximum as your `max_credits` so an approved price is enforced.
- **Layers with key policy.** Keys carry their own `max_credits_per_request`; your request can always be tighter.
- **Agent default.** Dizo's agent rules say to always send it. MCP connections also default to 500 credits per call.
- **Visible usage.** Every response reports `credits_used`, plus `x-dizo-credits-remaining` in the headers.

## Steps
1. **Check your key** — Call `GET /v1/me` for `max_credits_per_request` and remaining budget.
2. **Work out the ceiling** — Quote with `dry_run`, or compute it: 0.04 per result, 1 per email, 10 per phone.
3. **Send with max_credits** — Include the ceiling and an `Idempotency-Key` header on the real call.
4. **Read credits_used** — Compare actual spend with the ceiling and adjust next time.

## APIs used
| API | Endpoint | Credits | Charged | Reference |
|---|---|---|---|---|
| Natural-language search | `POST /v1/search` | 1 credit / 25 results | Per result returned | [docs](https://dizo.ai/docs/search.md) |
| Batch | `POST /v1/batch` | Same as each item | Per item, same rules | [docs](https://dizo.ai/docs/batch.md) |
| Email finder | `POST /v1/email/find` | 1 credit | Only if found | [docs](https://dizo.ai/docs/email-find.md) |
| Phone finder | `POST /v1/phone/find` | 10 credits | Only if found | [docs](https://dizo.ai/docs/phone-find.md) |
| API keys | `POST /v1/keys` | Free | Never | [docs](https://dizo.ai/docs/keys.md) |
| Key info | `GET /v1/me` | Free | Never | [docs](https://dizo.ai/docs/me.md) |


## What a per-request limit protects against

Most spending accidents with a data API are not large decisions. They are small mistakes that repeat or scale: a `limit` set to 1,000 instead of 100, an `include` array that adds phones when only emails were wanted, a batch built from the wrong spreadsheet tab, or an agent that misunderstands "a few" as "a few thousand". Monthly caps catch these eventually, but by then the money for that request is already spent.

`max_credits` stops the problem at the level of a single call. It is a number you send in the request body that sets a hard ceiling on how many credits that request may spend. Whatever the request asks for, it cannot cost more than the number you wrote. It is the narrowest of Dizo's spending controls, and the one Dizo's agent rules say to send every time.

## How it works

`max_credits` is an optional number on Dizo's billable endpoints, documented on each with the same description: a hard ceiling on credits this request may spend. You will find it on [search](/docs/search), people and company search, the email and phone finders, enrich, reverse lookups, email verify, the decision-maker finder, [batch](/docs/batch) and lists. Because it lives in the body, it travels with the request: your code, your workflow tool or your agent sets it per call.

The value is in credits, the same unit as every price on the [pricing page](/pricing). A search of 100 results is 4 credits. An email find is 1 credit if found. A phone find is 10. So the ceiling for any call is easy to reason about once you know what you are asking for, and easier still once you have a dry-run quote.

Every response reports `credits_used`, and the `x-dizo-credits-used` and `x-dizo-credits-remaining` headers carry the same information. Read them after each call so your code always knows how close a request came to its ceiling.

## Examples from the docs

The search docs show a natural-language query for VPs of Sales at US fintech companies, with `include: ["email"]`, `limit: 25` and `max_credits: 60`. The response reports 26 credits used: 1 credit for 25 results plus 25 emails found. A ceiling of 60 leaves comfortable headroom for that request while ruling out anything wildly larger, such as the same call requesting phones instead of emails by mistake, which could cost up to 1 + 250 = 251 credits.

The batch docs show a 2,500-item email-finder job with `max_credits: 10000`, and a quote of `credits_max` 2,500. In that example the ceiling is generous, four times the maximum; in your own jobs you would usually set it closer to the quote. The lists docs show a 500-row list with `max_credits: 1500` against a `credits_max` quote of 1,020, which is a tighter and more typical margin.

## Choosing the right number

The cleanest method is to quote first. Send the request with `"dry_run": true`, read the maximum, and set `max_credits` to that figure for the real call. That turns an approved quote into an enforced limit, which is exactly what you want when a human signed off on a specific amount.

For routine calls you do not quote, use simple formulas based on what you are asking for:

- **Search without contact data:** `limit` × 0.04, rounded up. 100 results is 4 credits.
- **Search with emails:** `limit` × 0.04 + `limit` × 1. For 25 results, 26.
- **Search with phones:** add `limit` × 10. For 25 results with both, 1 + 25 + 250 = 276.
- **Single email find:** 1. **Single phone find:** 10. **Person enrich with phone:** 2 + 10 = 12.
- **Email verify of 100 addresses:** 100 × 0.25 = 25.
- **Batch:** the quoted `credits_max`, or items × per-item cost.

## How it layers with key and account limits

`max_credits` is one layer of four. Each API key can carry its own `max_credits_per_request`, set when the key is created with `POST /v1/keys`, plus daily and monthly credit caps and an endpoint allow-list. Above the keys, the account has a [monthly spend cap](/features/monthly-spend-cap) in dollars, refills included.

The layers do different jobs. The key-level `max_credits_per_request` is a fixed policy set by whoever owns the account, which the caller cannot raise. The request-level `max_credits` is chosen by the caller for this one call, and is most useful when it is lower than the key's policy. An agent working under a key with a 500-credit per-request ceiling can still send `max_credits: 30` on a small search to make its intent explicit.

MCP connections add a default of their own: `data:read` only and a 500-credit per-call limit unless changed in the console. You can see the effective numbers for any key with `GET /v1/me`, which returns `budget.max_credits_per_request` alongside the remaining daily and monthly credits.

## How agents should use it

Dizo's published agent rules make `max_credits` non-optional: always send it as a hard per-request ceiling. That habit costs nothing and turns every tool call into a bounded action. A model that sends `max_credits` cannot turn a misread instruction into a large charge in a single step, even before the key and account caps come into play.

A sensible agent loop on the [MCP server](/mcp) starts by calling `dizo_whoami` to learn its per-request ceiling and remaining budget. For each billable call it computes a ceiling from the request, quotes anything likely to exceed about 100 credits with `dizo_quote`, asks the human when the quote is large, and then sends the real call with `max_credits` set. After the call, it compares `credits_used` with what it expected and tells the user if they differ meaningfully.

## Turning ceilings into team conventions

Teams that use Dizo from several places, such as a backend service, a workflow tool and a couple of agents, tend to drift into inconsistent habits. One integration sends a ceiling, another does not, and a third sends a number someone picked months ago. A short written convention fixes that: every billable call sends `max_credits`, computed the same way, and anything above a stated threshold is quoted first.

A practical convention has three tiers. Small calls, such as single lookups and searches without contact data, use the formula ceiling directly. Medium calls, such as searches with emails or verify runs on a hundred addresses, use the formula plus a small margin. Large calls, meaning batches, lists and anything over about 100 credits, are quoted with `dry_run` and run with the quoted maximum as the ceiling.

Put the helper that computes ceilings in one shared module, and have code review reject billable calls that skip it. The result is that every request's worst case is known before it is sent.

## Edge cases

A ceiling that is too tight works against you. If you set `max_credits` below what a legitimate request needs, the request cannot complete as asked. Size it from a quote or a formula with a little headroom, and treat it as a backstop against mistakes rather than a way to trim results. If you want fewer records, lower `limit`; if you want fewer contact lookups, change `include`.

Misses are free, so the ceiling only binds on data actually found. A batch of 1,000 email lookups with a ceiling of 1,000 cannot exceed 1,000 credits, and if 30% miss it will use about 700. Monitors use their own parameter, `max_credits_per_run`, which caps each scheduled run rather than a single request.

When a call is refused for any reason, branch on the stable `error.code` and follow the plain-English `error.fix` in the response rather than retrying blindly. Send an `Idempotency-Key` header on every POST so a legitimate retry within 24 hours is never charged twice.

## When you can skip it

Free endpoints never need it. Counts, billing, usage, pricing, key information, suppression and feedback are never charged. For humans running one-off calls in the playground or with `dz_test_` keys, which return synthetic data and never spend credits, a ceiling adds little.

For anything automated with a live key, send it. The cost is one field, and the protection is immediate. [Sign up](/signup) for a live key and 250 free credits, and read the [per-key caps](/features/per-key-spend-caps) page to set the policy layer above it.

## FAQ

### What does max_credits do?
It sets a hard ceiling on how many credits a single request may spend. You send it in the request body, and the request cannot cost more than that number.

### How is it different from max_credits_per_request on a key?
`max_credits_per_request` is a fixed policy set on the key by the account owner. `max_credits` is chosen by the caller for one request. Use both: the key sets the outer limit and the request can be tighter.

### What number should I use?
Quote the request with `"dry_run": true` and use the quoted maximum. Without a quote, work it out from the published costs: 0.04 per search result, 1 per email, 10 per phone.

### Do misses count toward the ceiling?
No. Lookups that find nothing are free, so only data actually returned draws on the limit.

### Is there a default limit for MCP clients?
Yes. MCP connections default to `data:read` only and a 500-credit per-call limit unless changed in the console. Agents should still send `max_credits` on every call.

### Does it apply to monitors?
Monitors have their own parameter, `max_credits_per_run`, which caps each scheduled run. The docs example sets it to 100.
