> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockradar.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Agent Payments

> Get paid by AI agents in stablecoins, with payments arriving in your Blockradar wallet as ordinary deposits

<Note>
  In a nutshell<br />
  AI agents can pay for APIs and data per request, in stablecoins, through open agent payment protocols. If you sell to agents, a Blockradar address can receive those payments. They arrive as ordinary deposits, with the usual webhook and the paying agent's wallet as the sender, so there is nothing new to integrate on the Blockradar side.
</Note>

## Supported Protocols

| Protocol | Networks and tokens |
| - | - |
| [x402](https://www.x402.org) | EVM chains, USDC (EIP-3009) |

<Tip>
  Building the agent that pays? See [Make Agent Payments](/en/use-cases/make-agent-payments).
</Tip>

## Prerequisites

<Steps>
  <Step title="API Key">
    Get your API key from the [Blockradar Dashboard](https://dashboard.blockradar.co). Navigate to **Developers** to generate one.
  </Step>

  <Step title="EVM Master Wallet">
    Create a master wallet in the dashboard on the chain you charge on, such as Base (see [Create a Master Wallet](/en/guides/create-master-wallet)).
  </Step>

  <Step title="USDC Enabled">
    Enable USDC on the wallet. Your wallet only detects deposits for assets you have added. See [Asset Management](/en/use-cases/asset-management).
  </Step>

  <Step title="Webhook URL">
    Configure a webhook endpoint in your dashboard under **Developers → Webhooks** to be notified of each payment.
  </Step>
</Steps>

***

## How x402 Works

[x402](https://www.x402.org) is an open protocol that lets an API charge per request. Your API answers an unpaid request with HTTP `402 Payment Required` and the price, the agent retries with a signed USDC authorization, and a **facilitator** verifies that authorization and submits the transfer on-chain, paying the gas. The USDC moves straight from the agent's wallet to your `payTo` address.

You run the x402 server middleware and choose the facilitator. Blockradar is where the money lands.

## Get Paid with x402

<Steps>
  <Step title="Set a Blockradar address as payTo">
    Use the master wallet's address, or [generate a child address](/en/api-reference/addresses/generate-address) per product or customer and attach `metadata` so each payment maps back to what was bought. On the [Checkout plan](/en/use-cases/checkout#checkout-plan), child addresses are not available, so use the master wallet's address.
  </Step>

  <Step title="Settle through a facilitator">
    Point your x402 middleware at a facilitator that supports your network. [Circle's Facilitator Service](https://developers.circle.com/facilitator-service) settles USDC on Arc, Base, and Polygon PoS. Use a Circle API key when configuring it.
  </Step>

  <Step title="Receive the payment as a deposit">
    When the facilitator settles, the USDC transfer to your `payTo` address is detected like any other deposit and fires the usual [`deposit.success` webhook](/en/use-cases/deposit-stablecoins#webhook-payload).
  </Step>
</Steps>

In the webhook, `senderAddress` is the **buyer's wallet**, not the facilitator that submitted the transaction, so you can see who paid. `hash` matches the `transaction` in the `PAYMENT-RESPONSE` your server returned.

<Tip>
  x402 payments are often a cent or less. If `payTo` is a child address with auto-sweep on, each payment is swept to the master wallet separately. Set a [sweep threshold](/en/use-cases/asset-management) on USDC, or use the master wallet's address as `payTo`, so you are not paying to sweep amounts smaller than the sweep fee.
</Tip>

***

## x402 Limitations

* **EVM networks.** Payments on non-EVM x402 networks, such as Solana, have not been tested with Blockradar addresses.
* **No Circle Gateway nanopayments.** Circle's batched sub-cent payment option has not been tested with Blockradar wallets.

***

## Best Practices

* **One address per product or customer.** Generate a child address per paid resource or per buyer account and tag it with `metadata`, so every deposit webhook tells you what was bought without a lookup.
* **Reconcile by hash.** Match each `deposit.success` webhook's `hash` to the `transaction` your server returned in `PAYMENT-RESPONSE`.
* **Test on testnet first.** Point your middleware at a testnet network, such as Base Sepolia (`eip155:84532`), and pay yourself with testnet USDC from the [faucets](/en/use-cases/supported-assets) before going live.

***

## API Reference

| Endpoint | Description |
| - | - |
| [Generate Address](/en/api-reference/addresses/generate-address) | Create a dedicated `payTo` address |
| [Update Address](/en/api-reference/addresses/update-address) | Turn auto-sweep on or off for an address |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.