API Cost Break-Even
Compare provider fixed and per-call costs, reliability-adjusted cost per successful call and total spend for a target volume.
1 credit per call · $0.003 USDC with x402
Sample input
{
"calls": 1000,
"providers": [
{
"id": "a",
"unit_price_usd": 0.01,
"fixed_cost_usd": 0,
"success_rate": 0.99
},
{
"id": "b",
"unit_price_usd": 0.005,
"fixed_cost_usd": 2,
"success_rate": 0.95
}
]
}Worked sample output
{
"ok": true,
"mode": "cost_break_even",
"calls": 1000,
"best": {
"id": "b",
"unit_price_usd": 0.005,
"fixed_cost_usd": 2,
"success_rate": 0.95,
"total_cost_usd": 7,
"cost_per_expected_success_usd": 0.007368
},
"ranking": [
{
"id": "b",
"unit_price_usd": 0.005,
"fixed_cost_usd": 2,
"success_rate": 0.95,
"total_cost_usd": 7,
"cost_per_expected_success_usd": 0.007368
},
{
"id": "a",
"unit_price_usd": 0.01,
"fixed_cost_usd": 0,
"success_rate": 0.99,
"total_cost_usd": 10,
"cost_per_expected_success_usd": 0.010101
}
]
}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-prod.onrender.com/v1/prepaid/cost-break-even' \
-H "Authorization: Bearer $BOUNTY_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: workflow-request-001' \
-H 'X-Max-Credits: 1' \
--data '{"calls":1000,"providers":[{"id":"a","unit_price_usd":0.01,"fixed_cost_usd":0,"success_rate":0.99},{"id":"b","unit_price_usd":0.005,"fixed_cost_usd":2,"success_rate":0.95}]}'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-prod.onrender.com/v1/prepaid/cost-break-even. 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": {
"calls": 1000,
"providers": [
{
"id": "a",
"unit_price_usd": 0.01,
"fixed_cost_usd": 0,
"success_rate": 0.99
},
{
"id": "b",
"unit_price_usd": 0.005,
"fixed_cost_usd": 2,
"success_rate": 0.95
}
]
}
}Reuse a retry key only for the same input. Failed execution returns reserved credits. Full integration and recovery guide · Machine-readable recipe