Documentation
Pay for a call with x402
x402 lets a client pay for an HTTP request with a crypto wallet. Supported Vaaya endpoints accept USDC on Base, so an agent can pay for a call without opening a Vaaya account.
What you need
Use an x402-compatible client and a wallet that can authorize USDC payments on Base. If you prefer to pay from your Vaaya balance, use the API quickstart with your API key.
Find an available endpoint
The discovery JSON lists the endpoints currently offered for x402 payment. Reading this file is free and does not make a purchase.
curl https://vaaya.ai/.well-known/x402
| Field | What it means |
|---|---|
version | The version of the discovery document format. |
resources | The action URLs available for x402 payment. An empty list means no endpoints are currently advertised. |
instructions | Connection guidance and links to more documentation. |
How a payment works
- Choose a URL from
resources. Send a GET request to that URL to check its inputs and listed price. - Send the action’s JSON inputs in a POST request through your x402 client. An unpaid request to an available endpoint returns HTTP
402 Payment Requiredwith payment instructions. - Have your client check the requested amount, network, asset, and recipient against your payment policy before authorizing it.
- The client retries with the required payment authorization. Vaaya verifies it, runs the call, and settles payment on success.
Use the payment instructions returned by the endpoint. Do not construct a payment from a cached price or send funds to an address copied from an example.
Keep documentation available to your agent
Give your agent the discovery JSON for available URLs and the OpenAPI JSON for request schemas. Use llms.txt to find the rest of the docs.