Lumière PayCheck Free API key

Payments on Base + Solana + Keeta + Tempo, cards via Stripe

How to Set a Spending Limit for an AI Agent, Step by Step

· 5 min read

To set a spending limit for an AI agent that pays x402 APIs, give it a per-payment cap in your x402 client, check each seller before paying, and give the agent its own key with spend limits. Lumière PayCheck's Builder plan ($9 a month) covers the last part for up to three agents. This is the step-by-step version; for why agents need limits at all, see Spending Limits for AI Agents That Pay for APIs.

The x402 protocol itself only tells the client how much to pay for each request. Recent x402 clients add a default per-payment cap (starting with @x402/core 2.23, $1 unless you change it), but nothing in the protocol limits what an agent spends in a day or a month. To prevent an agent from spending too much money on bad endpoints or unexpected usage, you need a trust layer that checks the endpoint before payment and enforces limits at the account level.

Why You Need a Limit Layer

When your AI agent calls an API that uses x402, it receives a quote. The quote includes the price, the network (like Base or Solana), the token (like USDC), and the payout wallet address. Your agent must sign a payment for this exact amount and send it in a header with the request. This process requires no invoice or API key from the seller.

However, this simplicity creates risks. An agent might call a malicious endpoint that charges high prices. It might also call an endpoint that changes its payout wallet to steal funds. Or it might simply make too many calls and drain your budget. x402 proves money moved. It does not prove the API delivered the right data or that the price was fair.

Lumière PayCheck solves this by checking endpoints before they are paid. It monitors over 148,037 x402 endpoints. It grades them and returns a verdict (proceed, caution or avoid) with a 0-100 score. It also provides the Builder plan to control spending for your agents.

> For teams: PayCheck plans: scoped agent keys, spending limits, approvals, signed receipts and a full audit trail.

> Free tool: x402 endpoint checker: paste any x402 URL to see its grade, uptime, price and payout-wallet history before your agent pays it.

Step 1: Check Endpoints Before Payment

Before your agent pays any quote, it should verify the endpoint is safe. You can do this using the PayCheck MCP server or the REST API. This step ensures you are not paying for a broken or dangerous service.

Use the check_payment tool in the MCP server. Pass the quote details to it. The tool returns an allow or deny decision with reasons. A "proceed" verdict means the endpoint passed. "Caution" means something isn't confirmed yet, usually no passed paid test so far, so pay only small amounts. "Avoid" means don't pay.

You can also use the free web checker at https://lumierepaycheck.org/check. Paste any x402 URL there to see its grade, uptime, price and payout-wallet history. This helps you understand what PayCheck looks for. It checks if the 402 quote is valid, if the price and the payout wallet are stable, and if the endpoint answers.

Step 2: Use the Builder Plan for Hard Limits

To set a hard spending limit, you need an account that supports key management. The Lumière PayCheck Builder plan costs $9 per month and covers up to three agents, each with its own key and spend limits. This is the most direct way to control how much your agents can spend. For more agents, or a person approving payments over a set amount, the Business plan ($49 a month) covers up to 25.

With these keys, you define the maximum amount each agent can use. If an agent tries to exceed this limit, the system stops it. This prevents runaway costs if your agent gets stuck in a loop or calls too many expensive endpoints.

You can get a free API key at https://lumierepaycheck.org/free-key to access higher free limits on scores and verdicts. For more control, subscribe to the Builder plan at https://lumierepaycheck.org/subscribe.

Step 3: Monitor and Report Outcomes

Spending limits are not enough. You must also know if your agent got what it paid for. PayCheck makes real paid test calls to confirm endpoints deliver their advertised data. Your agents should do the same by reporting outcomes.

Use the report_outcome MCP tool after your agent completes a task. Tell PayCheck if the endpoint delivered the correct data or failed. This feedback helps PayCheck update its grades. It also helps you identify which sellers are reliable.

You can view endpoint health on the endpoint grade pages. These pages show 30-day volume and how many independent buyers used the service. They also list any flags, such as price increases or wallet changes. Use this data to decide if you should keep using a seller.

Step 4: Verify Receipts for Audit

Every paid test PayCheck makes comes with a signed receipt. These receipts are public at GET /v1/test-receipts. They include the terms, response hashes, amount, result, and time. The signature uses an Ed25519 key.

If you use the Builder plan, you get a 30-day audit trail. This helps you review where your money went. You can verify that each payment was for a checked endpoint. If you need longer records, the Business plan offers a one-year audit trail and CSV export.

FAQ

Can I set a limit directly in x402? Only per payment: recent x402 clients cap each payment ($1 by default from @x402/core 2.23). Daily and monthly limits per agent need something outside the protocol, such as PayCheck agent keys.

What does a caution verdict mean? Something about the endpoint isn't confirmed yet, usually no passed paid test so far, or a payout-wallet change the seller hasn't confirmed. Every verdict comes with its reasons.

How do I add an endpoint that is not in the Bazaar? You can add any HTTPS x402 endpoint outside the Bazaar by posting to https://lumierepaycheck.org/v1/endpoints/submit. Checking one we do not monitor adds it automatically.

Start checking your endpoints for free at https://lumierepaycheck.org/.

Check an endpoint before your agent pays it. Free grades and allow-or-deny checks: lumierepaycheck.org · Every x402 endpoint, graded · Docs

More from the blog