Skip to main content

Spend limits and alerts

An AI agent residential proxy spending limit should bound what the agent can spend on network access, not what its model can spend on tokens. NexaLayer lets an account owner set a per-key USD cap and a UTC daily USD cap for paid proxy sessions. A purchase that would exceed either limit is rejected with 402 BUDGET_EXCEEDED; it does not reserve a session or automatically pause the API key. Start with a funded account, a deliberately small limit, and an approved task. Read the current budget before creating a paid session. If the task needs more than the approved amount, stop and ask the owner rather than changing the limit to make the purchase succeed.

What a NexaLayer spend limit actually covers

The control applies to paid network proxy session purchases through NexaLayer. It is useful when a browser agent needs a proxy for a regional check, permitted automation, or a task that needs IP continuity. It is not a budget for every service the agent can reach. The settings key_limit_usd and daily_limit_usd express dollar limits. The product catalog describes what a purchase buys and how that product is priced. Do not infer cost from the number of browser steps: a page navigation, a model call, and a proxy-session purchase are different operations. NexaLayer describes its network offering as residential and ISP proxies, but the live catalog organizes products as dynamic and static. Do not assume a particular product identifier establishes a residential or ISP classification. Check the current product documentation for the resource you intend to purchase.

Network proxy spend is not an LLM token budget

A NexaLayer cap constrains USD spend on paid proxy resources. It does not count prompt tokens, completion tokens, model-provider charges, or model-gateway usage. A model-gateway per-key budget and a NexaLayer per-key budget protect different resources. Configure and monitor both separately if the workflow uses both. This is not a general agent cost-governance system. Cloud compute, browser hosting, and external services need their own controls. Keep the scope explicit when reporting costs to an owner.

Set a per-key and daily budget cap

The owner configures the budget with PUT /v1/account/budget. Supply the API key using the documented authentication header, and include an Idempotency-Key for the write. These are illustrative USD limits, not recommended defaults for every workload.
This sets a USD 50 per-key cap, a USD 10 daily cap, alert thresholds, and an explicitly unpaused state. Adapt the amounts to the approved workload. Do not copy paused:false into an update without checking whether the owner intentionally paused the key. Choose a cap before enabling paid session creation. An alert is useful feedback, but receiving an alert is not approval for more spend. Increasing a limit or changing the pause state is an owner policy decision.

Read the current cap, estimated spend, and UTC reset

Read the budget after updating it and before a purchase:
The budget response reports limits, estimated accepted spend, manual pause state, and the next UTC daily reset. The usage-alerts endpoint reports thresholds that have been crossed. Inspect returned values rather than assuming an earlier task’s reading still describes the available allowance. The daily boundary is a UTC day, not local midnight or a rolling 24-hour window. Use the reported next reset when explaining when the daily allowance becomes available again. A daily reset does not override the per-key cap or an owner’s manual pause. No response JSON is reproduced here: use the current response and documented schema rather than guessed property names. Estimated accepted spend helps planning but does not replace billing reconciliation.

Humans set the guardrail; the agent stays inside it

The default agent workflow starts with the owner funding the account and setting the limit. The agent discovers products, reads the budget, requests approval for a paid purchase, and uses an approved session within that allowance. Treat a request to raise the limit as separate from permission to run the task. A useful escalation states the requested resource, live price, current constraint, and a smaller alternative if one exists. An unfinished task is not permission to lift a cap.

What happens when a purchase would exceed the cap

402 BUDGET_EXCEEDED means no session was reserved

If a purchase would pass a key or daily limit, NexaLayer rejects it with HTTP 402 and BUDGET_EXCEEDED. The purchase is not reserved, no charge is taken, and the key is never paused automatically. Do not retry this 402 automatically. After the owner raises the cap or approves a smaller purchase, retry with a new idempotency key: a completed write, including a 402, is stored for 24 hours and replayed if you reuse the same Idempotency-Key. This illustrative envelope shows the shape. Its message is explanatory example text, not a quotation of a production response:
Do not loop on the rejected purchase. Read the budget and ask the owner whether to reduce the purchase or raise the allowance. After that change and approval, retry with a new idempotency key. The same 402 BUDGET_EXCEEDED is also returned if the key is already manually paused; only then should the owner unpause it with PUT /v1/account/budget. See the error documentation for the current envelope.

A cap is not an automatic key pause

Exceeding a budget does not automatically pause the API key. The cap rejects the purchase. paused: true is only an explicit owner pause, set or cleared with PUT /v1/account/budget. Do not equate a rejected order with a disabled key, and do not tell an operator to unpause unless the key was already manually paused. pause_on_exceed is deprecated and unused. Omit it from new integrations. An older example containing that field is not evidence of automatic pausing. Read the actual pause state before proposing any policy change.

INSUFFICIENT_BALANCE is a funding problem, not a cap problem

INSUFFICIENT_BALANCE also returns HTTP 402, but it means the account needs funding rather than a higher allowance. No order is placed. Stop and ask the owner to review billing; increasing the cap alone does not add money. Do not auto-retry while the account remains unpaid, and do not pick a retry key from memory. After the owner tops up, retry the approved purchase with a new idempotency key — reusing the original key would replay the stored 402 for up to 24 hours. A top-up is not blanket permission for a larger purchase.

Use the network-proxy MCP to read or change a budget

The official NexaLayer MCP is a network-proxy session MCP, not a general MCP gateway. It exposes product discovery, session lifecycle, health, usage, budgets, and alerts. nexalayer_get_budget and nexalayer_usage_alerts are read-only. nexalayer_set_budget changes policy and must stay behind client-side owner approval. Use npx -y @nexalayer/mcp for the official MCP. See MCP setup for client configuration. Keep approval enabled for budget changes and paid session creation, with unique idempotency keys for approved writes. A read-only budget check does not approve the following write.

Limits are not a substitute for the billing ledger

A budget is a safety control, not the billing ledger. Reconcile purchases and charges through billing. Large or unusual purchases still need owner approval even if they fit under a numeric cap. Read pricing for billing concepts, then retrieve GET https://api.nexalayer.net/v1/public/products at purchase time for identifiers, prices, currency, and units. If an example uses dynamic_2, confirm that product_no is still in the live catalog; do not use retired identifiers such as dynamic_dyn3 or out_dynamic_1. A catalog check on 2026-11-29 around 11:20–11:23 Asia/Singapore showed dynamic inventory at $0.23/GB (`dynamic_2` only), shared static prices at $0.75, $1.06, and $2.72/month, and exclusive static prices from $1.43 to $5.88/month. That is a dated observation, not a quote — inventory can flicker, and the live API is authoritative. Do not calculate an allowance from a cached marketing price or assume every product uses the same quantity unit.

Questions and answers

What is a NexaLayer spend limit? It caps dollars an API key can spend on paid network proxy sessions, not LLM tokens or model-gateway usage. The owner sets per-key and UTC daily limits; the agent operates inside that guardrail. What happens when an agent exceeds the cap? The purchase returns 402 BUDGET_EXCEEDED, with no session reserved and no charge taken. The key is not automatically paused. Do not retry until the owner raises the cap or approves a smaller purchase, then use a new idempotency key. If the same 402 appears because the key is already manually paused, only the owner should unpause it. Can a residential proxy MCP change the budget on its own? Budget changes must stay behind client-side owner approval. Read-only budget and alert tools help an agent plan; they do not grant authority to raise limits. For a step-by-step walkthrough that sets a cap, creates an approved session, and verifies the exit IP from a browser, see Set a proxy spending cap for a browser agent.