Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Anygas Xyz Planning API
version: 3.28.2
contact:
name: Robyn AnyGas
url: https://anygas.xyz
license:
name: Service terms
url: https://anygas.xyz/svc/api/terms
x-lastUpdated: '2026-07-29'
description: 'Operations tagged planning across 2 of this provider''s published API definitions: anygas-openapi.json, anygas-xyz-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.anygas.xyz/svc
description: Production gateway (also https://anygas.xyz/svc)
tags:
- name: Planning
description: Validate whole multi-step workflows before executing any of them.
paths:
/api/route/plan:
post:
tags:
- Planning
summary: Validate a whole multi-step plan before executing step one
operationId: planRoute
description: '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.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- steps
properties:
steps:
type: array
items:
$ref: '#/components/schemas/RouteRequest'
constraints:
type: object
properties:
maxTotalFeeBps:
type: integer
example: 60
maxTotalSeconds:
type: integer
example: 120
maxStepSeconds:
type: integer
requireNonCustodial:
type: boolean
responses:
'200':
description: Per-step results, accumulated totals, feasibility and (if infeasible) the binding constraint plus its remedy
content:
application/json:
schema:
type: object
'400':
description: Malformed plan
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
servers:
- url: https://api.anygas.xyz/svc
description: Production gateway (also https://anygas.xyz/svc)
components:
schemas:
RouteRequest:
type: object
required:
- fromChain
- toChain
- amount
properties:
fromChain:
description: 'Source node: EVM chain id or one of "solana"/"stellar"/"bitcoin".'
oneOf:
- type: string
- type: integer
example: 42161
toChain:
description: Destination node.
oneOf:
- type: string
- type: integer
example: bitcoin
amount:
type: string
description: Source-token smallest units.
example: '50000000'
fromToken:
type: string
description: Symbol or address; omit for native.
example: USDC
toToken:
type: string
description: Symbol or address; omit for native.
example: BTC
toAddress:
type: string
description: Recipient; defaults to fromAddress.
fromAddress:
type: string
description: Quote origin; anonymous default used if omitted.
slippage:
type: number
description: Fraction, e.g. 0.005.
token:
type: string
description: 'Shorthand: sets BOTH fromToken and toToken (e.g. "USDC"). Accepted on POST bodies and as a GET query parameter. Explicit fromToken/toToken win when present.'
example: USDC
Error:
type: object
description: Every error carries a stable errorCode plus recovery metadata. The legacy `error` string is retained for backward compatibility - branch on errorCode.
properties:
error:
type: string
description: human-readable message (legacy field)
errorCode:
type: string
example: INSUFFICIENT_FLOAT
description: stable machine code; see GET /api/errors for the full catalogue
retryable:
type: boolean
retryAfterMs:
type: integer
description: present when the failure is transient
suggestedAction:
type: string
description: what the caller should actually do next
docs:
type: string
required:
- error
x-refined-from:
- anygas-openapi.json
- anygas-xyz-openapi.json