curl -X POST '/v1/agent/x402-fetch' \
-H 'Authorization: Bearer yac_connector_api_key' \
-H 'Content-Type: application/json' \
-d '{
"wallet_id": "aw_01abc123",
"url": "https://api.example.com/premium-data",
"method": "GET"
}'
{
"success": true,
"data": {
"status": 200,
"paid": true,
"payment": {
"amount_usd": 0.01,
"asset": "USDC",
"network": "base",
"pay_to": "0x9F8b3A2c1E4D7F6B5A4C3D2E1F0A9B8C7D6E5F4"
},
"body": {
"premium_data": "..."
}
}
}
Fetch a URL with automatic x402 payment — if the URL returns HTTP 402, the wallet pays and retries
curl -X POST '/v1/agent/x402-fetch' \
-H 'Authorization: Bearer yac_connector_api_key' \
-H 'Content-Type: application/json' \
-d '{
"wallet_id": "aw_01abc123",
"url": "https://api.example.com/premium-data",
"method": "GET"
}'
{
"success": true,
"data": {
"status": 200,
"paid": true,
"payment": {
"amount_usd": 0.01,
"asset": "USDC",
"network": "base",
"pay_to": "0x9F8b3A2c1E4D7F6B5A4C3D2E1F0A9B8C7D6E5F4"
},
"body": {
"premium_data": "..."
}
}
}
Bearer yac_...GET, POST, PUT, DELETE, PATCH. Defaults to GET.curl -X POST '/v1/agent/x402-fetch' \
-H 'Authorization: Bearer yac_connector_api_key' \
-H 'Content-Type: application/json' \
-d '{
"wallet_id": "aw_01abc123",
"url": "https://api.example.com/premium-data",
"method": "GET"
}'
{
"success": true,
"data": {
"status": 200,
"paid": true,
"payment": {
"amount_usd": 0.01,
"asset": "USDC",
"network": "base",
"pay_to": "0x9F8b3A2c1E4D7F6B5A4C3D2E1F0A9B8C7D6E5F4"
},
"body": {
"premium_data": "..."
}
}
}