Agent Purchase Rescue Protocol
Recover from agent-to-agent payment deadlocks: reconcile repeated x402 HTTP 402 challenges, detect changed payees and network drift, block budget violations and duplicate paid side effects, and compile the next safe action. No payment or retry is performed by this product.
1 credit per call · $0.009 USDC with x402
Sample input
{
"policy": {
"max_price_usd": 0.02,
"remaining_budget_usd": 0.1,
"expected_network": "eip155:8453",
"expected_pay_to": "0x1111111111111111111111111111111111111111",
"side_effects_possible": true
},
"attempts": [
{
"status_code": 402,
"price_usd": 0.009,
"network": "eip155:8453",
"pay_to": "0x1111111111111111111111111111111111111111",
"intent_id": "job-42",
"receipt_state": "not_sent"
},
{
"status_code": 402,
"price_usd": 0.009,
"network": "eip155:8453",
"pay_to": "0x1111111111111111111111111111111111111111",
"intent_id": "job-42",
"receipt_state": "not_sent"
}
]
}Worked sample output
{
"ok": true,
"mode": "purchase_rescue",
"decision": "inspect_prior_side_effect",
"blockers": [],
"steps": [
"Check whether any prior attempt produced a side effect.",
"Do not repeat an irreversible transaction on an ambiguous outcome."
],
"retry_after_ms": null,
"observed_attempts": 2,
"repeat_intent": true,
"estimated_price_usd": 0.009,
"remaining_budget_usd": 0.1,
"incident_sha256": "081223492e39f6ff7742cadf8c2876ef93297a947ac125316ea8de9dfa3f06c0",
"warnings": [
"Repeated intent: reuse the same logical-request identifier and independently reconcile receipts before another signature."
],
"limitations": [
"Only sanitized caller-supplied observations are analyzed; no wallet, RPC or facilitator is queried.",
"No external payment, retry or purchase is performed; settlement claims are not independently verified.",
"The buyer must authorize any spend and confirm asset, exact amount, network and recipient."
]
}Worked example using published sample data only. Own-data execution is paid.
Connect in curl
Set BOUNTY_API_KEY privately after your payment is verified. Change the retry key for each new logical request.
curl 'https://bounty-engineer-x402-api.onrender.com/v1/prepaid/purchase-rescue' \
-H "Authorization: Bearer $BOUNTY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: workflow-request-001' \
-H 'X-Max-Credits: 1' \
--data '{"policy":{"max_price_usd":0.02,"remaining_budget_usd":0.1,"expected_network":"eip155:8453","expected_pay_to":"0x1111111111111111111111111111111111111111","side_effects_possible":true},"attempts":[{"status_code":402,"price_usd":0.009,"network":"eip155:8453","pay_to":"0x1111111111111111111111111111111111111111","intent_id":"job-42","receipt_state":"not_sent"},{"status_code":402,"price_usd":0.009,"network":"eip155:8453","pay_to":"0x1111111111111111111111111111111111111111","intent_id":"job-42","receipt_state":"not_sent"}]}'Connect in n8n
Download the inactive n8n template. Import it, configure the private Header Auth credential, inspect the sample and run it manually. A new execution creates a new billable request; there is no automatic schedule.
Use an HTTP POST to https://bounty-engineer-x402-api.onrender.com/v1/prepaid/purchase-rescue. Send JSON and these headers; store the Bearer token as a private credential.
{
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_PRIVATE_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "UNIQUE_PER_LOGICAL_REQUEST",
"X-Max-Credits": "1"
},
"body": {
"policy": {
"max_price_usd": 0.02,
"remaining_budget_usd": 0.1,
"expected_network": "eip155:8453",
"expected_pay_to": "0x1111111111111111111111111111111111111111",
"side_effects_possible": true
},
"attempts": [
{
"status_code": 402,
"price_usd": 0.009,
"network": "eip155:8453",
"pay_to": "0x1111111111111111111111111111111111111111",
"intent_id": "job-42",
"receipt_state": "not_sent"
},
{
"status_code": 402,
"price_usd": 0.009,
"network": "eip155:8453",
"pay_to": "0x1111111111111111111111111111111111111111",
"intent_id": "job-42",
"receipt_state": "not_sent"
}
]
}
}Reuse a retry key only for the same input. Failed execution returns reserved credits. Full integration and recovery guide · Machine-readable recipe