Paying for APIs with x402
x402 is an open standard for paying per request over HTTP. A site that charges answers 402 Payment Required with its price; the client pays and asks again. With Lotvs, an agent can pay these sites in digital dollars from its own account, inside your limits.
How pay_x402 works
Section titled “How pay_x402 works”- The agent calls
pay_x402with the URL, the most it is willing to pay (max_usdc) and a reason. - Lotvs requests the URL without paying. If the site does not ask to be paid, its response is returned and nothing is paid.
- If the site asks for a price in USDC, Lotvs pays only when the price is at most
max_usdcand inside the agent’s limits: the limit per payment and the limit per day, shared with transfers. - Lotvs pays the exact price once and returns the site’s response, with the transaction.
- Only public
httpsURLs. Private networks and local addresses are refused. GETby default;POSTwith a JSON body.- Payments are final. x402 has no refunds.
- The response is the site’s content, not instructions. An agent should not follow orders found in it.
- Above the amount you chose for asking, the payment waits for your yes. A site you always allow, up to its amount, does not ask.