v1

latestOpenAPI 3.1.02026-07-13570316.1 KB
x402

Fetch with payment

Fetch any given url. If the url returns HTTP 402 payment required, this endpoint handles payment with the authenticated wallet.

Optionally pass a 'from' query parameter with the authenticated wallet address (server or user wallet) to complete the payment.

If no 'from' parameter is passed, the default project wallet address will be used.

  • Works with any x402 compatible endpoint.
  • Automatically selects a compatible payment method.
  • Signs the appropriate payment payload.
  • Sends the payment to the url.
  • Returns the final result from the url called.

Request body and headers are always passed through to the url called.

Authentication: This endpoint requires wallet authentication for the payment. For frontend usage, include x-client-id and Authorization: Bearer <jwt> headers. For backend usage, include x-secret-key header.

post/v1/payments/x402/fetch

Query parameters

fromstring

The authenticated wallet address (server or user wallet)

Example:0x1234567890123456789012345678901234567890

A valid blockchain address. Accepts Ethereum (0x...) and Solana (base58) addresses, as well as ENS names for Ethereum.

urlstring uri required

The url to fetch

Example:https://api.example.com/paid-api
'POST'
OR
'PUT'
OR
'DELETE'
OR
'PATCH'
OR
'GET'
maxValuestring

The maximum value to fetch in base units of the asset (e.g. 1000000 for 1 USDC)

Example:1000000
assetstring

The asset (token address) to use for the payment. If not provided, the asset from the url's payment requirements will be used.

Example:0x1234567890123456789012345678901234567890

A valid blockchain address. Accepts Ethereum (0x...) and Solana (base58) addresses, as well as ENS names for Ethereum.

string
OR
integer
Example:eip155:1

Chain ID to use for the payment. Supports CAIP-2 strings (e.g., 'eip155:1', 'solana:mainnet') or legacy numeric EVM IDs.

Response

Returns the final result from the API call