Lumière PayCheck Free API key

Payments on Base + Solana

How AI Agents Pay for APIs with USDC

· updated · 3 min read

AI agents pay for APIs with USDC using x402: the API answers with a price, and the agent signs a USDC payment for exactly that amount and sends it with its next request. No account, card or API key is needed. Here's how the flow works step by step, and how to check an API before your agent pays it.

The x402 payment flow

  1. The agent calls the API. If the API wants payment, it answers with HTTP status 402 and a quote.
  2. The quote lists the terms: the price, the network (for example Base or Solana), the token (usually USDC) and the wallet that gets paid, called payTo.
  3. The agent signs a payment for exactly that amount from its own USDC wallet, using an x402 client library.
  4. The agent calls again with the signed payment in a header.
  5. The API checks the payment and returns the data.

Because the money is USDC, a dollar stablecoin, prices are easy to read, and calls can cost a fraction of a cent. That makes pay-per-call pricing practical for agents that need data the moment they need it.

Why agents should check before they pay

USDC payments can't be charged back. A 402 quote only shows that a seller is asking for money, and a settled payment only shows that money moved. Neither proves the agent got the data it paid for. Things that can go wrong:

  • The endpoint is down or broken, and the agent pays for nothing.
  • The price jumped since the agent last called it.
  • The payout wallet changed without warning, which can be a sign the seller was hijacked.

How to check an API first

Lumière PayCheck monitors more than 138,000 x402 endpoints. It checks whether each 402 quote is valid, whether the price and payout wallet stay stable, and whether the endpoint answers. It also makes small real test payments to confirm endpoints deliver what they advertise. PayCheck doesn't process or hold your payments: your agent still pays the seller directly.

Each endpoint gets a verdict:

  • Proceed: a real paid test delivered, and the endpoint is reliable in monitoring.
  • Caution: something isn't confirmed yet, often because it hasn't been paid-tested. It doesn't mean "don't pay".
  • Avoid: don't pay it.

From code, send the quote's url, amount and payTo to the free check-payment endpoint before paying. It answers with allow true or false and the reasons. If allow is false, your agent shouldn't pay.

POST https://lumierepaycheck.org/v1/check-payment
Content-Type: application/json

{ "url": "https://example.com/api", "amount": "10000", "payTo": "0xSellerWallet" }

For a quick grade without a quote, call GET /v1/score?url=<endpoint>.

From an agent framework, use the free MCP server at https://lumierepaycheck.org/mcp, or the npm package lumiere-paycheck-mcp. Your agent calls check_payment before it pays and report_outcome afterward to say whether it got what it paid for.

Keep your agent's spending safe

  • Set a cap per payment and per day, so one bad endpoint or a loop can't drain the wallet.
  • Retry with the same payment. If a call fails after you paid, reuse the same signed payment instead of signing a new one, so the same request is never charged twice.
  • Keep the agent's wallet small. Fund it with what it needs for a few days, not your whole balance.

FAQ

Does an agent need an account or API key to pay with x402? No. The signed USDC payment in the request is what gets access. Some sellers add their own sign-in on top, so check each API's listing.

What's the difference between caution and avoid? Caution means something isn't confirmed yet, often that no paid test has run. Avoid means your agent shouldn't pay the endpoint.

Does PayCheck hold my agent's money? No. It doesn't process, route or hold your payments. It only checks the endpoint so your agent can decide before it pays.

Check any x402 endpoint for free before your agent pays it: 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