/v0/swap/quoteQuote a swap
Exact-input quote for Intents Swap: every route is asked, the best one for the mode is returned with the all-in cost. Public, no API key, rate-limited per IP. Addresses are optional here; the order asks for them.
Authentication
Section titled “Authentication”None. Intents Swap is public: it runs in the browser with no key, and is rate-limited per IP.
Body parameters
Section titled “Body parameters”fromstringRequiredCAIP-19 of the asset you send
tostringRequiredCAIP-19 of the asset you receive
amountstringRequiredExact input, in the
fromasset's base unitsmodemanual\|walletOptionalmanual= send to a deposit address (the default);wallet= connect and signsenderstringOptionalWallet mode: the source wallet
recipientstringOptionalrefundTostringOptionalslippageBpsintegerOptionalOverride; omitted = automatic (50 bps, 100 on long-tail tokens)
contextobjectOptionalWhere the swap started, for analytics (SPEC-swap §8). Never an address.
context.landingUrlstringOptionalcontext.refstringOptionalcontext.pageTypestringOptional
Responses
Section titled “Responses”- 200The best quote for the mode
- 400Invalid request (
INVALID_REQUEST,UNSUPPORTED_ASSET) - 403
SWAP_REFUSED: we can't route this swap (no reason is given) - 404
NOT_FOUND,NO_ROUTE - 422
TRANSFER_MODE_UNAVAILABLE: no deposit address for this pair - 429
RATE_LIMITED - 503
SWAP_UNAVAILABLE: swap is not configured on this deployment
Request
Section titled “Request”curl https://api.intents.fi/v0/swap/quote \ -X POST \ -H 'content-type: application/json' \ -d '{ "from": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "to": "bip122:000000000019d6689c085ae165831e93/slip44:0", "amount": "100000000", "mode": "manual" }'const response = await fetch("https://api.intents.fi/v0/swap/quote", { method: "POST", headers: { "content-type": "application/json", }, body: JSON.stringify({ "from": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "to": "bip122:000000000019d6689c085ae165831e93/slip44:0", "amount": "100000000", "mode": "manual" }),});
if (!response.ok) { const { error } = await response.json(); throw new Error(`${error.code}: ${error.message}`);}const data = await response.json();import httpx
response = httpx.post( "https://api.intents.fi/v0/swap/quote", json={ "from": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "to": "bip122:000000000019d6689c085ae165831e93/slip44:0", "amount": "100000000", "mode": "manual" },)response.raise_for_status()data = response.json()Errors
Section titled “Errors”{ "error": { "code": "INVOICE_EXPIRED", "message": "This invoice has expired" } }Switch on code, not on the message: every code has a page under Error codes. Base URL https://api.intents.fi; the whole reference is on one page.