Cross-chain swap plan
const url = 'https://api.getchord.xyz/v1/xswap/plan';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"user":"0xb145400da27a2497d9fc2cd5621f2bfd37617af4","chainIn":5042,"chainOut":143,"tokenIn":"0x3600000000000000000000000000000000000000","tokenOut":"0x350035555e10d9afaf1566aaebfced5ba6c27777","amount":"1000000000","slippageBps":100}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.getchord.xyz/v1/xswap/plan \ --header 'Content-Type: application/json' \ --data '{ "user": "0xb145400da27a2497d9fc2cd5621f2bfd37617af4", "chainIn": 5042, "chainOut": 143, "tokenIn": "0x3600000000000000000000000000000000000000", "tokenOut": "0x350035555e10d9afaf1566aaebfced5ba6c27777", "amount": "1000000000", "slippageBps": 100 }'Quotes a token on one chain into a token on another two ways at once — composed (Chord’s router on the origin → USDC/USDG rail → Chord’s router on the destination) and direct (Relay end to end) — and names the one that lands more. Long-tail tokens on Arc / Monad / Robinhood only route on the composed path. Fees come back as three lines (protocol · bridge · network) and gas says who pays on each side. MIN_SIZE below 10 USD of the bridged stable.
Request Bodyrequired
Section titled “Request Bodyrequired”object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
EVM address, hex, case-insensitive.
Force a rail; auto applies the corridor rules (Robinhood → Relay; Monad ↔ Arc → CCTP when the mint relayer is funded; else Relay).
Example
{ "user": "0xb145400da27a2497d9fc2cd5621f2bfd37617af4", "chainIn": 5042, "chainOut": 143, "tokenIn": "0x3600000000000000000000000000000000000000", "tokenOut": "0x350035555e10d9afaf1566aaebfced5ba6c27777", "amount": "1000000000", "slippageBps": 100}Responses
Section titled “ Responses ”object
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Our tier fee on this leg’s output.
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Relay intent id; empty on CCTP until the burn is sent.
CCTP only.
CCTP only.
Circle’s fast-transfer fee, CCTP only.
Why this rail.
object
Our on-chain tier fee per swap leg.
object
The bridge’s own cut.
object
App fee added on Relay.
Gas we front on the destination.
object
Flat per relayer-paid transaction.
True = we eat it (Arc mint).
Who pays gas on each side.
object
Amount in the token’s smallest unit, as a decimal string. Never a float.
Rail-shaped: { rail, requestId, checkEndpoint, steps[], fees, details } — sign steps in order on the origin chain (an approval item may be skipped when the allowance covers it).
object
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Our tier fee on this leg’s output.
object
EVM address, hex, case-insensitive.
EVM address, hex, case-insensitive.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Amount in the token’s smallest unit, as a decimal string. Never a float.
Relay intent id; empty on CCTP until the burn is sent.
CCTP only.
CCTP only.
Circle’s fast-transfer fee, CCTP only.
Why this rail.
object
Our on-chain tier fee per swap leg.
object
The bridge’s own cut.
object
App fee added on Relay.
Gas we front on the destination.
object
Flat per relayer-paid transaction.
True = we eat it (Arc mint).
Who pays gas on each side.
object
Amount in the token’s smallest unit, as a decimal string. Never a float.
Rail-shaped: { rail, requestId, checkEndpoint, steps[], fees, details } — sign steps in order on the origin chain (an approval item may be skipped when the allowance covers it).
object
Per-path failure { code, message } when a path could not be quoted.
object
Example
{ "best": "composed", "composed": { "legs": [ { "kind": "swap" } ], "rail": "relay", "fees": { "network": { "mode": "user" } } }, "direct": { "legs": [ { "kind": "swap" } ], "rail": "relay", "fees": { "network": { "mode": "user" } } }}Invalid parameters — error names the check that failed (INVALID_PARAMS, BAD_ADDRESS, BAD_LIMIT, BAD_HOURS, …).
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}Nothing at this identity (NOT_FOUND, UNKNOWN_TOKEN, NO_ROUTE).
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}Over the per-minute limit (RATE_LIMIT_EXCEEDED). Read X-RateLimit-Reset and back off.
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}The routing engine or an upstream did not answer (ENGINE_ERROR, ROUTE_ERROR).
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}The lane behind this endpoint is not ready or not enabled here (NOT_READY, CHAIN_NOT_ENABLED, NOT_ENABLED, *_UNAVAILABLE). Retry later; do not treat it as an empty answer.
Every non-2xx body.
object
Stable machine code, e.g. INVALID_PARAMS, NOT_READY, RATE_LIMIT_EXCEEDED.
For humans.
HTTP status, when included.
Example
{ "error": "INVALID_PARAMS", "message": "amount must be an integer string in the token's smallest unit"}