planning

Validate a whole multi-step plan before executing step one

Agents execute WORKFLOWS, not single transfers, but every quoting API validates one hop at a time — so an agent discovers that step 3 is impossible only after paying for steps 1 and 2, and money spent reaching a dead end is not recovered by discovering it was a dead end. POST the whole plan and get it validated up front. Fees and durations ACCUMULATE across steps. Evaluation stops at the first unroutable step rather than reporting speculative results for steps behind it. When a plan is infeasible the response names the BINDING CONSTRAINT and the value that would work (bindingConstraint, whatWouldMakeThisWork) — a bare "no" sends an agent into blind retries. Optional constraints: maxTotalFeeBps, maxTotalSeconds, maxStepSeconds, requireNonCustodial. READ-ONLY: nothing is signed, reserved or moved. Each feasible step now carries a signed attestation of its quoted terms, so a validated plan is also a LOCKABLE one: pass a step's attestation with minOut to that step's execute call and execution is bound to the terms you were shown. Without it the plan is advice only, and the price can move between validating and running it.

post/api/route/plan

Request

  • Base URL: https://api.anygas.xyz/svc
  • URL: https://api.anygas.xyz/svc/api/route/plan
  • Auth: none declared

Request body

Example request

{
  "steps": [
    {
      "amount": "50000000",
      "fromToken": "USDC",
      "toToken": "BTC",
      "token": "USDC"
    }
  ],
  "constraints": {
    "maxTotalFeeBps": 60,
    "maxTotalSeconds": 120
  }
}

Response

Per-step results, accumulated totals, feasibility and (if infeasible) the binding constraint plus its remedy

object required

Changes

No recorded changes to this operation across all 1 revision of this API.