curl --request POST \
--url https://api.httpayer.com/proxy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"api_url": "https://www.x402.org/protected",
"method": "GET",
"json": {
"city": "San Francisco"
},
"data": {},
"body": "<string>",
"payload": {},
"params": {
"limit": "10",
"offset": "0"
},
"headers": {
"Accept": "application/json"
},
"auth": {
"username": "<string>",
"password": "<string>"
},
"cookies": {
"session": "abc123"
},
"timeout": 30
}
'import requests
url = "https://api.httpayer.com/proxy"
payload = {
"api_url": "https://www.x402.org/protected",
"method": "GET",
"json": { "city": "San Francisco" },
"data": {},
"body": "<string>",
"payload": {},
"params": {
"limit": "10",
"offset": "0"
},
"headers": { "Accept": "application/json" },
"auth": {
"username": "<string>",
"password": "<string>"
},
"cookies": { "session": "abc123" },
"timeout": 30
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_url: 'https://www.x402.org/protected',
method: 'GET',
json: {city: 'San Francisco'},
data: {},
body: JSON.stringify('<string>'),
payload: {},
params: {limit: '10', offset: '0'},
headers: {Accept: 'application/json'},
auth: {username: '<string>', password: '<string>'},
cookies: {session: 'abc123'},
timeout: 30
})
};
fetch('https://api.httpayer.com/proxy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.httpayer.com/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_url' => 'https://www.x402.org/protected',
'method' => 'GET',
'json' => [
'city' => 'San Francisco'
],
'data' => [
],
'body' => '<string>',
'payload' => [
],
'params' => [
'limit' => '10',
'offset' => '0'
],
'headers' => [
'Accept' => 'application/json'
],
'auth' => [
'username' => '<string>',
'password' => '<string>'
],
'cookies' => [
'session' => 'abc123'
],
'timeout' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.httpayer.com/proxy"
payload := strings.NewReader("{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.httpayer.com/proxy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.httpayer.com/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}"
response = http.request(request)
puts response.read_body{}{
"error": "<string>",
"details": "<string>"
}{
"error": "Insufficient credits"
}{
"error": "Too Many Requests",
"message": "Server is currently processing the maximum number of concurrent requests. Please try again in a moment.",
"details": "Active requests: 100/100",
"retryAfter": 5
}{
"error": "Internal Server Error",
"message": "The proxy server encountered an internal error",
"details": "<string>"
}{
"error": "Bad Gateway",
"message": "Upstream API refused payment after 3 attempts",
"details": "<string>",
"upstreamStatus": 123,
"webhook_id": "550e8400-e29b-41d4-a716-446655440000"
}Execute x402 payment-gated API call
HTTPayer proxy service for x402 payment-gated API calls.
Flow:
- Proxy detects 402 Payment Required from target API
- HTTPayer wallet executes payment to target API
- Proxy retries request with payment proof
- Returns target API response to client
Error Handling:
- 502 Bad Gateway: Target API errors (unreachable, malformed, 5xx)
- 500 Internal Server Error: Proxy configuration errors
- 4xx Pass-through: Client errors from target API
- Timeout detection with configurable limits
curl --request POST \
--url https://api.httpayer.com/proxy \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"api_url": "https://www.x402.org/protected",
"method": "GET",
"json": {
"city": "San Francisco"
},
"data": {},
"body": "<string>",
"payload": {},
"params": {
"limit": "10",
"offset": "0"
},
"headers": {
"Accept": "application/json"
},
"auth": {
"username": "<string>",
"password": "<string>"
},
"cookies": {
"session": "abc123"
},
"timeout": 30
}
'import requests
url = "https://api.httpayer.com/proxy"
payload = {
"api_url": "https://www.x402.org/protected",
"method": "GET",
"json": { "city": "San Francisco" },
"data": {},
"body": "<string>",
"payload": {},
"params": {
"limit": "10",
"offset": "0"
},
"headers": { "Accept": "application/json" },
"auth": {
"username": "<string>",
"password": "<string>"
},
"cookies": { "session": "abc123" },
"timeout": 30
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_url: 'https://www.x402.org/protected',
method: 'GET',
json: {city: 'San Francisco'},
data: {},
body: JSON.stringify('<string>'),
payload: {},
params: {limit: '10', offset: '0'},
headers: {Accept: 'application/json'},
auth: {username: '<string>', password: '<string>'},
cookies: {session: 'abc123'},
timeout: 30
})
};
fetch('https://api.httpayer.com/proxy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.httpayer.com/proxy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_url' => 'https://www.x402.org/protected',
'method' => 'GET',
'json' => [
'city' => 'San Francisco'
],
'data' => [
],
'body' => '<string>',
'payload' => [
],
'params' => [
'limit' => '10',
'offset' => '0'
],
'headers' => [
'Accept' => 'application/json'
],
'auth' => [
'username' => '<string>',
'password' => '<string>'
],
'cookies' => [
'session' => 'abc123'
],
'timeout' => 30
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.httpayer.com/proxy"
payload := strings.NewReader("{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.httpayer.com/proxy")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.httpayer.com/proxy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_url\": \"https://www.x402.org/protected\",\n \"method\": \"GET\",\n \"json\": {\n \"city\": \"San Francisco\"\n },\n \"data\": {},\n \"body\": \"<string>\",\n \"payload\": {},\n \"params\": {\n \"limit\": \"10\",\n \"offset\": \"0\"\n },\n \"headers\": {\n \"Accept\": \"application/json\"\n },\n \"auth\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"cookies\": {\n \"session\": \"abc123\"\n },\n \"timeout\": 30\n}"
response = http.request(request)
puts response.read_body{}{
"error": "<string>",
"details": "<string>"
}{
"error": "Insufficient credits"
}{
"error": "Too Many Requests",
"message": "Server is currently processing the maximum number of concurrent requests. Please try again in a moment.",
"details": "Active requests: 100/100",
"retryAfter": 5
}{
"error": "Internal Server Error",
"message": "The proxy server encountered an internal error",
"details": "<string>"
}{
"error": "Bad Gateway",
"message": "Upstream API refused payment after 3 attempts",
"details": "<string>",
"upstreamStatus": 123,
"webhook_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
API key for authentication
Headers
Client timeout in milliseconds (max 120000ms / 2 minutes)
Body
Target API URL to call via proxy
"https://www.x402.org/protected"
HTTP method for target API
GET, POST, PUT, DELETE, PATCH "GET"
JSON body — serialized and sent with Content-Type: application/json. Mirrors Python requests(json=...) / fetch(body: JSON.stringify(...)).
{ "city": "San Francisco" }
Form-encoded body when an object, raw string body when a string. Mirrors Python requests(data=...). Object → Content-Type: application/x-www-form-urlencoded. String → passed through as-is; set Content-Type via headers.
Pre-serialized body string — passed through unchanged, without setting Content-Type. If you pass an object it will be JSON-stringified, but you must manually set Content-Type: application/json via headers. Use json instead for automatic Content-Type handling.
Deprecated alias for json. Use json instead.
Query parameters appended to the target URL
{ "limit": "10", "offset": "0" }
Custom headers forwarded to the target API
{ "Accept": "application/json" }
Basic auth shorthand — converted to Authorization: Basic . Mirrors Python requests(auth=("user", "pass")).
Show child attributes
Show child attributes
Cookie shorthand — merged into the Cookie header. Mirrors Python requests(cookies={...}).
{ "session": "abc123" }
Per-request timeout in seconds (server default applies if omitted; also accepts X-TIMEOUT header in ms)
30
Response
Target API request successful
Response from target API (pass-through)

