All workflows

Provider Route Plan

Choose the cheapest reliable API provider with deterministic fallback routing from caller-supplied price, latency, reliability, trust and freshness measurements.

1 credit per call · $0.01 USDC with x402

Sample input

{
  "policy": "balanced",
  "constraints": {
    "max_price_usd": 0.05,
    "min_success_rate": 0.95
  },
  "candidates": [
    {
      "id": "fast",
      "price_usd": 0.02,
      "success_rate": 0.99,
      "p95_latency_ms": 450,
      "trust_score": 0.9
    },
    {
      "id": "cheap",
      "price_usd": 0.005,
      "success_rate": 0.96,
      "p95_latency_ms": 900,
      "trust_score": 0.8
    }
  ]
}

Worked sample output

{
  "ok": true,
  "mode": "provider_route_plan",
  "decision": "route",
  "policy": "balanced",
  "selected": {
    "id": "fast",
    "price_usd": 0.02,
    "success_rate": 0.99,
    "p95_latency_ms": 450,
    "trust_score": 0.9,
    "freshness_seconds": null,
    "balanced_score": 0.8255
  },
  "fallback_order": [
    {
      "id": "fast",
      "price_usd": 0.02,
      "success_rate": 0.99,
      "p95_latency_ms": 450,
      "trust_score": 0.9,
      "freshness_seconds": null,
      "balanced_score": 0.8255
    },
    {
      "id": "cheap",
      "price_usd": 0.005,
      "success_rate": 0.96,
      "p95_latency_ms": 900,
      "trust_score": 0.8,
      "freshness_seconds": null,
      "balanced_score": 0.742
    }
  ],
  "rejected": [],
  "limitations": [
    "Balanced scoring uses fixed transparent weights: reliability 45%, trust 20%, latency 20%, cost 15%. Inputs are supplied by the caller and are not independently verified."
  ]
}

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/provider-route-plan' \
  -H "Authorization: Bearer $BOUNTY_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: workflow-request-001' \
  -H 'X-Max-Credits: 1' \
  --data '{"policy":"balanced","constraints":{"max_price_usd":0.05,"min_success_rate":0.95},"candidates":[{"id":"fast","price_usd":0.02,"success_rate":0.99,"p95_latency_ms":450,"trust_score":0.9},{"id":"cheap","price_usd":0.005,"success_rate":0.96,"p95_latency_ms":900,"trust_score":0.8}]}'

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/provider-route-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": {
    "policy": "balanced",
    "constraints": {
      "max_price_usd": 0.05,
      "min_success_rate": 0.95
    },
    "candidates": [
      {
        "id": "fast",
        "price_usd": 0.02,
        "success_rate": 0.99,
        "p95_latency_ms": 450,
        "trust_score": 0.9
      },
      {
        "id": "cheap",
        "price_usd": 0.005,
        "success_rate": 0.96,
        "p95_latency_ms": 900,
        "trust_score": 0.8
      }
    ]
  }
}

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