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

# Managed agent wallet

> Let an AI agent pay x402 endpoints in USDC from a Laso-custodied Solana wallet, with no private key to hold and no payment header to build.

A **managed agent wallet** is a Solana wallet Laso custodies for your account. The agent makes ordinary authenticated HTTP calls, and Laso settles the x402 payment on its behalf.

It is an alternative to the self-custody wallets in the [agent quickstart](/guides/agent-quick-start). Pick one, not both.

<Info>
  A managed wallet can pay **any** x402 endpoint, not just Laso's. See [Pay an
  endpoint](/guides/managed-wallet-payments).
</Info>

## When to use one

<CardGroup cols={2}>
  <Card title="Good fit" icon="check">
    Your agent runs somewhere you would rather not put a private key. You want
    spending visible in a dashboard and one funding source for Laso and
    third-party x402 services.
  </Card>

  <Card title="Poor fit" icon="xmark">
    You need self-custody or a spending-policy engine richer than a per-payment
    cap. Use Locus, Sponge, or Ampersend instead.
  </Card>
</CardGroup>

## The calls

All four are Firebase callables at `https://laso.finance/<name>`, authorized with `Authorization: Bearer <id_token>`. Arguments go in a `data` object; responses come back in a `result` object.

| Callable                  | Purpose                                        |
| ------------------------- | ---------------------------------------------- |
| `announceAgentConnection` | Tell the human the agent connected             |
| `getAgentWallet`          | Read the wallet address and balance            |
| `agentX402Pay`            | Pay a Laso route or any external x402 endpoint |
| `agentWalletTransfer`     | Send USDC out to a Solana address              |

## Setup

<Steps>
  <Step title="Sign in">
    Call `GET /auth` as in the [authentication guide](/guides/authentication)
    and save the `id_token`, `refresh_token`, and `user_id`. The examples
    reference the token as `$LASO_ID_TOKEN`.
  </Step>

  <Step title="Announce the connection">
    Call this right after sign-in, before anything else.

    ```bash theme={null}
    curl -X POST https://laso.finance/announceAgentConnection \
      -H "Authorization: Bearer $LASO_ID_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "agentName": "your name", "message": "a short hello for your human" }'
    ```

    It flips the dashboard's "waiting for your agent" screen to "connected" and
    returns the wallet's funding state.

    <Warning>
      Nothing enforces this step, so skipping it fails silently: the agent works
      but the human never sees it connect. Treat it as part of signing in.
    </Warning>
  </Step>

  <Step title="Read the wallet and fund it">
    ```bash theme={null}
    curl https://laso.finance/getAgentWallet \
      -H "Authorization: Bearer $LASO_ID_TOKEN"
    ```

    ```json theme={null}
    {
      "user_id": "usr_...",
      "has_wallet": true,
      "wallet_address": "3MZVk97x9SeRxbYpc3jhzRfU2fyA3emYutnqfn9kNfYX",
      "balance_usdc": 0,
      "needs_funding": true
    }
    ```

    Send **USDC on Solana** to `wallet_address`. If `needs_funding` is `true`,
    ask your human for a deposit. If `has_wallet` is `false`, setup finishes at
    [laso.finance/agent/dashboard](https://laso.finance/agent/dashboard).

    <Warning>
      `wallet_address` is the only place to send funds. `user_id` is an account
      id, not an address. USDC sent to it is lost.
    </Warning>
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Pay an endpoint" icon="credit-card" href="/guides/managed-wallet-payments">
    Use `agentX402Pay` for Laso routes and external x402 services.
  </Card>

  <Card title="Guardrails" icon="shield-check" href="/guides/managed-wallet-guardrails">
    Pin the price, asset, network, and receiver before paying a third party.
  </Card>

  <Card title="Spend limit and activity" icon="gauge" href="/guides/managed-wallet-spend-limit">
    The human's per-payment cap, and where every payment is recorded.
  </Card>

  <Card title="Bank accounts" icon="building-columns" href="/guides/agent-bank-accounts">
    Fund this wallet by bank transfer instead of on-chain.
  </Card>
</CardGroup>
