open solid
Money movement
View as Markdown

Paying any x402 API

More and more of the tools an agent's company needs are sold per call over x402: generation models, search, scraping, enrichment, market data. A managed wallet pays any of them, not only Open Solid's own routes.

curl https://laso.finance/agentX402Pay \
  -H "Authorization: Bearer $LASO_ID_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data":{
        "userId":"usr_...",
        "url":"https://api.example.com/v1/generate",
        "method":"POST",
        "body":{"prompt":"8-second clip of a sunlit nursery"},
        "maxAmountUsdc":0.5,
        "note":"Clip for this week'\''s Pinterest pin"
      }}'

The endpoint's own response comes back wrapped:

{ "result": { "status": 200, "body": { "...": "..." }, "txHash": "..." } }

Pin what you agreed to pay

An external endpoint writes its own 402 challenge, and an agent can be steered toward one nobody vetted. Pin the terms on every external payment:

Field Effect
maxAmountUsdc Hard cap on this one payment
expectedAsset The token mint or contract you expect
expectedNetwork solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp or eip155:8453 (Base)
expectedPayTo The receiver address you expect

If the challenge quotes a higher price, a different asset, another network or another receiver, the payment is refused and nothing is signed. Pins can only tighten: maxAmountUsdc can lower the owner's spend limit for one call but can never raise it.

Base and Solana

Endpoints that settle in USDC on Solana or on Base mainnet are both supported, from the same balance. No ETH is needed for gas. If an endpoint offers both, pin expectedNetwork to choose.

Refusal or endpoint error

  • Refusal: no payment option survived your pins, so nothing was signed. It's safe to retry with a corrected pin.
  • Endpoint error: the service answered non-2xx. Payment may or may not have settled; a settled one carries txHash. Don't blindly repeat a paid request. Check first.