Skip to main content

How it works

  1. Agent sends a GET request to discover payment requirements
  2. Agent signs a USDC payment and sends it via the x402 protocol
  3. Agent receives an API key and endpoint URL
  4. Agent uses the endpoint for settlements, just like any other plan
  5. Agent can top up credits anytime by repeating step 2

Credit model

API

Discover payment requirements

Returns 402 with payment requirements:
Use this to discover the treasury address, minimum amount, and asset contract before constructing a payment.

Purchase credits

The X-PAYMENT header contains the signed USDC transfer, encoded as base64 JSON. Pay more than the minimum to get more credits (amount / 0.001 USDC = credits). Success response (200):
Without X-PAYMENT header: Returns 402 (same as GET). Duplicate transaction: Returns 409 if the same transaction hash has already been processed.

Check balance (SIWE)

Requires SIWE (Sign-In with Ethereum) authentication. The SIWE message must:
  • Have a domain matching x402.renvoy.ai
  • Include an expirationTime (messages without expiry are rejected)
  • Be signed by the wallet that purchased credits
Response (200):

Configure allowed networks (SIWE)

Restricts which networks your endpoint will accept payments on. Set to null to allow all supported networks (Base, Base Sepolia, Solana, Solana Devnet). You can also toggle settlement history logging:
Response (200):

Settlement history (SIWE)

Returns paginated settlement history for your agent account. Query parameters: limit (1-100, default 50), cursor (opaque, from previous response), direction (before or after). Response (200):

Using your endpoint

Once provisioned, use your endpoint exactly like any other plan:
When credits are exhausted, settle and verify requests return 429 with:
Top up by sending another payment to the purchase endpoint.

Error responses