# x402 Payment Route Optimizer

> x402 Payment Route Optimizer is a paid API for AI agents from x402.halowerk.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-17).

Determines which token/chain combinations a buyer holds can settle a given payment amount to a seller, computing all-in USD costs including gas, swap, and bridge fees, with explicit route classification.

## Facts

- Endpoint: POST https://x402.halowerk.com/route/optimize?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-payment-route-optimizer-01253e3f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RcsVI4EM08uQtqzmBe8bO

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-payment-route-optimizer-01253e3f -d '<json body>'
```

Example prompt: I hold USDC on Base and ETH on mainnet — can you figure out which combination is cheapest to settle a $5 x402 payment to a seller who accepts USDC on Base or ETH on Ethereum, including all gas costs, and flag any routes that need a swap or bridge?

## When to prefer this

Use this endpoint when an AI agent or wallet needs to automatically select the optimal token and chain to settle an x402 payment, especially when the buyer holds multiple tokens across multiple chains and cost minimization matters. Prefer this over manual route selection when swap or bridge paths are in play and the agent must transparently surface all-in costs and risks before committing to a payment.

## Known failure modes

- No feasible route found if buyer holds no tokens the seller accepts and no swap/bridge path exists
- Gas cost estimates may be orders of magnitude off for unusual chains or congested conditions (noted in description as a known limit)
- Stale price feeds could cause incorrect USD normalization
- Missing or malformed buyer holdings or seller acceptance list returns an error
- Unsupported chain combinations may not produce bridge cost estimates

## How this service works

Takes what the caller holds and what the seller accepts and works out which combinations can settle the amount. All costs are brought into USD, otherwise no comparison is possible: gas on the source chain plus, where needed, the cost of a swap or a bridge. Routes that require a swap or a bridge are marked explicitly - they often look cheaper on paper and are slower and riskier in practice. Every assumption is named in assumptions; nothing is folded in silently. Limits: gas costs are ORDERS OF MA

## Output

A list of feasible settlement routes, each with the token and chain combination, total all-in cost in USD (gas + optional swap/bridge fees), a route type label (direct, swap-required, or bridge-required), and a named assumptions block explaining every cost estimate used. Routes requiring swaps or bridges are explicitly flagged as slower and riskier despite potentially lower paper cost.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "priority": {
   "enum": [
    "guenstig",
    "schnell",
    "sicher"
   ],
   "type": "string",
   "default": "guenstig",
   "description": "Which ranking to put first. All three are always returned."
  },
  "available": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "chain",
     "asset",
     "balance"
    ],
    "properties": {
     "asset": {
      "type": "string",
      "description": "Asset address or symbol."
     },
     "chain": {
      "type": "string",
      "description": "CAIP-2 chain, for example eip155:8453."
     },
     "balance": {
      "type": "number",
      "minimum": 0,
      "description": "Balance in USD equivalent."
     }
    },
    "additionalProperties": false
   },
   "maxItems": 30,
   "minItems": 1,
   "description": "What the caller holds."
  },
  "amount_usd": {
   "type": "number",
   "minimum": 0.000001,
   "description": "Amount to be paid, in USD."
  },
  "accepted_by_seller": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "chain",
     "asset"
    ],
    "properties": {
     "asset": {
      "type": "string"
     },
     "chain": {
      "type": "string"
     },
     "scheme": {
      "type": "string",
      "description": "Payment scheme, usually exact."
     }
    },
    "additionalProperties": false
   },
   "maxItems": 30,
   "minItems": 1,
   "description": "What the seller accepts."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-payment-route-optimizer-01253e3f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.halowerk.com](https://www.zero.xyz/host/x402.halowerk.com/llms.txt)
