Workflows

Up to 5 paid checks in one request (POST /api/workflows/run). Each step is a call to /api/x402/<service> with your prepaid credit token and is debited exactly like a direct call: a step that fails is refunded, and after a failure, an empty balance or a STOP decision the remaining steps are not called and not charged. A run is refused up front if your balance is below the quote. Custom steps and the reference syntax ("$1.data.address") are documented at /api/workflows.

No credit token set. Quotes work without one; running needs one — buy credits.

Pre-buy check (Base)

token-risk → sellability → swap-route on one Base token. If token-risk or sellability returns decision STOP, the later steps are not called and not charged.

  1. token-risk {"address":"$input.address"}
  2. sellability {"address":"$input.address","size":"$input.amountUsd"}
  3. swap-route {"tokenOut":"$input.address","amountUsd":"$input.amountUsd"}

Wallet due diligence (Base)

sanctions → address-trust → wallet-drain-watch on one address. A sanctions STOP ends the run before the other two are charged.

  1. sanctions {"address":"$input.address"}
  2. address-trust {"address":"$input.address"}
  3. wallet-drain-watch {"wallet":"$input.address"}

NEAR pre-trade

near-pre-trade-gate (contract control + round-trip exit test) → near-swap-quote from USDC into the same token, at your size. The quote's `to` is taken from the gate's own answer ($1.data.token). A STOP from the gate skips the quote.

  1. near-pre-trade-gate {"token":"$input.token","size":"$input.size"}
  2. near-swap-quote {"from":"USDC","to":"$1.data.token","amount":"$input.size"}

Prefer typing? The terminal runs the same templates: run pre-buy 0x….