Skip to content
Intents Route
POST/v0/quotes

Request quotes

A secret key (ik_) as a Bearer token. The prefix sets the mode: _test_ or _live_. Publishable keys (pk_) cannot call it.

  • tradeTypeEXACT_INPUT \| EXACT_OUTPUTOptional
  • fromobjectRequired
  • from.assetstringRequired
  • from.amountstringOptional
  • toobjectRequired
  • to.assetstringRequired
  • to.amountstringOptional
  • senderstringRequired
  • recipientstringRequired
  • refundTostringOptional
  • slippageBpsobjectOptional
  • providersarrayOptional
  • excludeProvidersarrayOptional
  • rankoutput \| speed \| balancedOptional
  • executionModesarrayOptional
  • timeoutMsintegerOptional
  • 200Ranked quotes from every provider that answered in time
curl
curl https://api.intents.fi/v0/quotes \
-X POST \
-H 'authorization: Bearer $INTENTS_SECRET_KEY' \
-H 'content-type: application/json' \
-d '{
"from": {
"asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "100000000"
},
"to": {
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"sender": "0x15AAB9098125C5A728CA818B31620a902C25f764",
"recipient": "0x9b3c1f4A6D2E5b70CA18F4D3e9B2A7C641FD8E05",
"refundTo": "0x15AAB9098125C5A728CA818B31620a902C25f764"
}'
TypeScript
const response = await fetch("https://api.intents.fi/v0/quotes", {
method: "POST",
headers: {
authorization: `Bearer ${process.env.INTENTS_SECRET_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"from": {
"asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "100000000"
},
"to": {
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"sender": "0x15AAB9098125C5A728CA818B31620a902C25f764",
"recipient": "0x9b3c1f4A6D2E5b70CA18F4D3e9B2A7C641FD8E05",
"refundTo": "0x15AAB9098125C5A728CA818B31620a902C25f764"
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();
Python
import os
import httpx
response = httpx.post(
"https://api.intents.fi/v0/quotes",
headers={"authorization": f"Bearer {os.environ['INTENTS_SECRET_KEY']}"},
json={
"from": {
"asset": "eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "100000000"
},
"to": {
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"sender": "0x15AAB9098125C5A728CA818B31620a902C25f764",
"recipient": "0x9b3c1f4A6D2E5b70CA18F4D3e9B2A7C641FD8E05",
"refundTo": "0x15AAB9098125C5A728CA818B31620a902C25f764"
},
)
response.raise_for_status()
data = response.json()
{ "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.