All workflows

Batch Budget Plan

Allocate a hard budget across many metered API calls and return exact planned calls, dropped calls and spend before execution.

1 credit per call · $0.005 USDC with x402

Sample input

{
  "budget_usd": 1,
  "allow_partial": true,
  "jobs": [
    {
      "id": "verify",
      "calls": 20,
      "unit_price_usd": 0.02,
      "priority": 100
    },
    {
      "id": "enrich",
      "calls": 100,
      "unit_price_usd": 0.01,
      "priority": 60
    }
  ]
}

Worked sample output

{
  "ok": true,
  "mode": "batch_budget_plan",
  "decision": "partially_funded",
  "budget_usd": 1,
  "planned_spend_usd": 1,
  "headroom_usd": 0,
  "allow_partial": true,
  "plan": [
    {
      "id": "verify",
      "calls": 20,
      "unit_price_usd": 0.02,
      "priority": 100,
      "planned_calls": 20,
      "dropped_calls": 0,
      "planned_spend_usd": 0.4
    },
    {
      "id": "enrich",
      "calls": 100,
      "unit_price_usd": 0.01,
      "priority": 60,
      "planned_calls": 60,
      "dropped_calls": 40,
      "planned_spend_usd": 0.6
    }
  ],
  "limitations": [
    "Allocation is deterministic priority-first planning. It does not estimate business value or guarantee provider success."
  ]
}

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/batch-budget-plan' \
  -H "Authorization: Bearer $BOUNTY_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: workflow-request-001' \
  -H 'X-Max-Credits: 1' \
  --data '{"budget_usd":1,"allow_partial":true,"jobs":[{"id":"verify","calls":20,"unit_price_usd":0.02,"priority":100},{"id":"enrich","calls":100,"unit_price_usd":0.01,"priority":60}]}'

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/batch-budget-plan. 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": {
    "budget_usd": 1,
    "allow_partial": true,
    "jobs": [
      {
        "id": "verify",
        "calls": 20,
        "unit_price_usd": 0.02,
        "priority": 100
      },
      {
        "id": "enrich",
        "calls": 100,
        "unit_price_usd": 0.01,
        "priority": 60
      }
    ]
  }
}

Reuse a retry key only for the same input. Failed execution returns reserved credits. Full integration and recovery guide · Machine-readable recipe