Skip to main content
POST
/
relay
Execute cross-chain relay payment
curl --request POST \
  --url https://api.httpayer.com/relay \
  --header 'Content-Type: application/json' \
  --data '
{
  "api_url": "https://demo.httpayer.com/base-weather",
  "method": "GET",
  "payload": {},
  "params": {},
  "headers": {
    "X-API-KEY": "your-target-api-key",
    "Authorization": "Bearer token123"
  },
  "network": "base"
}
'
{}

Headers

X-PAYMENT
string

x402 payment header (include on second call after getting payment instructions)

X-TIMEOUT
number

Client timeout in milliseconds

Query Parameters

format
enum<string>
default:text

Response mode. When set to "json", wraps the proxied response as JSON; otherwise returns the raw proxied response as text.

Available options:
json,
text

Body

application/json
api_url
string
required

The target API URL to call via the relay

Example:

"https://demo.httpayer.com/base-weather"

method
enum<string>
required

HTTP method for the target API

Available options:
GET,
POST,
PUT,
DELETE,
PATCH
Example:

"GET"

payload
object

Request body to send to the target API (for POST/PUT/PATCH)

params
object

Query parameters to send to the target API

headers
object

Custom headers to send to the target API (e.g., API keys, authorization tokens)

Example:
{
"X-API-KEY": "your-target-api-key",
"Authorization": "Bearer token123"
}
network
enum<string>

Blockchain network to use for payment

Available options:
base,
base-sepolia,
skale-base,
skale-base-sepolia,
solana-mainnet,
solana-devnet
Example:

"base"

Response

Relay payment successful. Response headers (included only when applicable):

  • X-Client-Payment: Transaction hash of the user's payment to HTTPayer after settlement (e.g., 0x123...)
  • X-Refund-Webhook-Id: Webhook ID to track refund status when a refund is issued (UUID)
  • X-Payment-Response: Details of HTTPayer's payment to the target API (v1, base64-encoded JSON)

Response from target API