←All use cases

Locus Pro · Prepaid tool credits

AI Agent Spending Limits

Cap what an AI agent can spend on APIs, data and tools: a prepaid balance, a monthly limit per workspace or per agent, a price ceiling on every call, and approval above an amount you choose.

Updated

How do you set spending limits for an AI agent?

Give the agent a balance it can spend, not a card it can run up. With Locus Pro, an agent pays for each API, data or tool call from prepaid credits, and every limit is checked before the provider runs. A call over any limit is refused with a clear error and costs nothing. Most teams combine three limits: a monthly cap for the whole workspace, a monthly budget for each agent, and a price ceiling on each call.

Which limits does Locus Pro enforce?

  • •Prepaid balance — The agent can only spend credits that are already there. When the balance cannot cover a call, Locus returns HTTP 402 before the provider runs.
  • •Workspace monthly hard limit — A ceiling for the calendar month across every agent and key. It counts completed charges plus calls still in progress, and refuses new calls once reached.
  • •Monthly budget per agent or connected app — Set a budget on an agent key, or on an app such as Claude Code or Cursor when you approve its sign-in. One agent cannot use up the budget meant for the others.
  • •Per-call and per-loop limits — An agent key can carry a maximum price per call and a maximum spend per loop, which stops a retry loop after a few calls instead of a few hundred.
  • •Price ceiling on each call — The agent sends max_credits with a call. If the price would exceed it, the call is refused before dispatch and nothing is charged. This matters for live-priced services.
  • •Approval above an amount — Optionally ask a person before any agent call over a set price. The agent gets an approval link to send to an admin and retries once it is approved.

Can I set a spending cap on an AI coding agent?

Yes. When Claude Code, Codex, Cursor or another MCP client signs in to Locus Pro, the consent screen lets you set a monthly budget for that app. The coding agent can then search the catalog and call paid tools until it reaches the budget, and calls beyond it are refused with the budget, the amount already committed and the reset date. Searching the catalog, describing a tool and checking the balance are free.

How do I set per-agent or per-customer spend caps in my product?

On an Enterprise workspace, each of your customers gets their own balance and policy. Calls name the customer, Locus charges that customer’s balance at the base price plus your markup, and a policy can limit what each customer’s agents spend. Your own workspace limits still apply on top, so a single customer cannot exhaust your pool.

What stops a runaway agent loop from draining the budget?

  • •The per-loop limit on the agent key caps spend for one task run.
  • •The per-call price ceiling stops one expensive call.
  • •The monthly budget and the workspace hard limit cap total exposure.
  • •Retries that reuse the same idempotency key replay the stored result instead of paying again.
  • •An API key cannot raise its own limits; changing them needs a signed-in owner or admin.

Is this the right tool for agents that shop or pay merchants?

Locus Pro limits what agents spend on APIs, data and tools in its catalog. If your agent buys goods from merchants or pays people, you need a card or payment platform with its own controls; compare them in the agentic payment platforms guide.

Connect and control usage

Locus Pro uses prepaid credits. Start with the agent connection guide, review current plans, and configure spending controls before scaling a workflow. Pay With Locus is the separate on-chain wallet product.

Related resources

Frequently asked questions

What happens when an agent hits its spending limit?

The call is refused before the provider runs and nothing is charged. The error names the limit, the amount already committed and when the limit resets, so the agent can stop or ask a person.

Can I require human approval for expensive agent calls?

Yes. Turn on approval above an amount you choose. An agent call over that price returns an approval link for an admin, and the agent retries after approval.

Do spending limits count calls that are still running?

Yes. Monthly limits count completed charges plus holds on calls in progress, so parallel calls cannot overshoot the limit.

Can an agent raise its own limit?

No. An API key cannot change spend controls. Raising a limit needs a signed-in owner or admin.