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

# Agent Wallets

> Wallets for AI agents to spend USDC autonomously, with guardrails.

Agent Wallets let an AI agent hold its own USDC wallet and spend autonomously — within limits you control. The agent pays for APIs, data, or services on its own, while guardrails ensure it can never spend beyond your rules.

## The problem it solves

AI agents need to pay for things on their own. But you can't safely hand an agent a wallet's private key — one bad instruction and it could be drained. Agent Wallets give the agent a constrained way to spend, so a leaked key can only do what you allowed.

## How it works

1. **Create an agent** — give it a name, a daily spending limit, and an allowlist of addresses it can pay.
2. **Get an API key** — shown once. The agent uses this as a Bearer token to spend.
3. **Fund the wallet** — send USDC to the agent's wallet address.
4. **The agent spends** — it calls the spend endpoint with its key. Every transaction is checked against your rules before money moves.

## Guardrails

| Control         | Effect                                              |
| --------------- | --------------------------------------------------- |
| **Daily limit** | Caps total spend per rolling 24h window             |
| **Allowlist**   | Restricts exactly which addresses the agent may pay |
| **API key**     | The agent spends with a key, never a seed phrase    |

If a spend would breach the allowlist or daily limit, it's **blocked and logged** — the transfer never happens.

## Spending from an agent wallet

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -X POST https://www.conduitpay.xyz/api/agents/spend \
    -H "Authorization: Bearer cak_live_..." \
    -H "Content-Type: application/json" \
    -d '{"recipient":"0x...","amount":"1.50"}'
  ```

  ```bash Windows (cmd) theme={null}
  curl -X POST https://www.conduitpay.xyz/api/agents/spend -H "Authorization: Bearer cak_live_..." -H "Content-Type: application/json" -d "{\"recipient\":\"0x...\",\"amount\":\"1.50\"}"
  ```
</CodeGroup>

A valid spend returns a transaction hash. A blocked spend returns an error explaining why.

## Autonomous x402 payments

This is where Agent Wallets and Conduit's x402 facilitator come together. An agent can autonomously discover a paid API, pay for it from its own wallet — within its guardrails — and receive the data back, with no human in the loop.

Conduit handles the entire loop in a single call:

<CodeGroup>
  ```bash macOS / Linux theme={null}
  curl -X POST https://www.conduitpay.xyz/api/agents/x402-fetch \
    -H "Authorization: Bearer cak_live_..." \
    -H "Content-Type: application/json" \
    -d '{"url":"https://www.conduitpay.xyz/api/arc-stats"}'
  ```

  ```bash Windows (cmd) theme={null}
  curl -X POST https://www.conduitpay.xyz/api/agents/x402-fetch -H "Authorization: Bearer cak_live_..." -H "Content-Type: application/json" -d "{\"url\":\"https://www.conduitpay.xyz/api/arc-stats\"}"
  ```
</CodeGroup>

You can also target a marketplace listing directly by sending `{"listingId":"<marketplace-listing-id>"}` as the body instead of a URL.

Behind that one request, Conduit:

1. Authenticates the agent with its API key
2. Reads the target endpoint's x402 paywall (price + payment address)
3. Pays that price from the agent's wallet — **enforcing the allowlist and daily limit**
4. Re-requests the endpoint with the on-chain payment proof
5. Returns the data plus a receipt

A successful response includes the data and the payment record:

```json theme={null}
{
  "paid": true,
  "amountPaid": "0.001",
  "txHash": "0x...",
  "data": { "...": "live API response" }
}
```

<Info>
  The guardrails still apply. For an agent to pay an x402 endpoint, that endpoint's payment address must be in the agent's allowlist — so even autonomous API payments stay within the rules you set.
</Info>

## Withdrawing funds

As the owner, you can withdraw remaining funds from any agent wallet back to your own address at any time, directly from the dashboard — owner withdrawals bypass the agent's limits since they're authorized by your wallet.

<Warning>
  Always call `www.conduitpay.xyz` for authenticated API requests. The bare domain redirects, and browsers/curl drop the Authorization header on redirect.
</Warning>
