curl --request POST \
--url https://api.route.fun/api/v2/builders/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({quoteId: '<string>'})
};
fetch('https://api.route.fun/api/v2/builders/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.route.fun/api/v2/builders/swap"
payload = { "quoteId": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"quoteId": "<string>",
"builderCode": "<string>",
"amountOut": "<string>",
"minimumAmountOut": "<string>",
"fees": {
"routeBps": 25,
"builderBps": 25,
"policyVersion": 123,
"builderRecipient": "<string>"
},
"expiresAt": 123,
"settlementAvailable": true,
"chainId": 4663,
"payer": "<string>",
"recipient": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>",
"amountIn": "<string>",
"grossAmountOut": "<string>",
"routeFee": "<string>",
"builderFee": "<string>",
"policySource": "onchain",
"registry": "<string>",
"provider": "<string>",
"routes": [
{}
],
"warnings": [
"<string>"
],
"transaction": {
"to": "<string>",
"from": "<string>",
"data": "<string>",
"value": "<string>",
"chainId": 4663
},
"approval": {},
"gas": "<string>",
"simulation": {},
"review": "<string>"
}Prepare a builder swap
Requires swap scope. Use the same API key that created the quote. Ordinary EOA wallets are supported; delegated and contract wallets are currently rejected. Free includes 10 distinct successful swap preparations per rolling hour, counted atomically against the authenticated workspace when the preparation is saved. A prepared but unsubmitted swap counts; approval and receipt calls do not. A refreshed quote is a new preparation. Swap preparations are additionally limited to Free 6/minute, Developer 6/minute, Launch 12/minute and Pro 60/minute. Shared service capacity applies.
curl --request POST \
--url https://api.route.fun/api/v2/builders/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "<string>"
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({quoteId: '<string>'})
};
fetch('https://api.route.fun/api/v2/builders/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.route.fun/api/v2/builders/swap"
payload = { "quoteId": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"quoteId": "<string>",
"builderCode": "<string>",
"amountOut": "<string>",
"minimumAmountOut": "<string>",
"fees": {
"routeBps": 25,
"builderBps": 25,
"policyVersion": 123,
"builderRecipient": "<string>"
},
"expiresAt": 123,
"settlementAvailable": true,
"chainId": 4663,
"payer": "<string>",
"recipient": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>",
"amountIn": "<string>",
"grossAmountOut": "<string>",
"routeFee": "<string>",
"builderFee": "<string>",
"policySource": "onchain",
"registry": "<string>",
"provider": "<string>",
"routes": [
{}
],
"warnings": [
"<string>"
],
"transaction": {
"to": "<string>",
"from": "<string>",
"data": "<string>",
"value": "<string>",
"chainId": 4663
},
"approval": {},
"gas": "<string>",
"simulation": {},
"review": "<string>"
}Authorizations
Server-side key created in an authenticated developer workspace. Builder codes are public attribution, not credentials.
Body
Response
Successful response
Public, case-sensitive registered attribution code. May differ from the API key workspace. Omitted: use the key workspace code.
^[A-Za-z0-9_-]{3,32}$^[0-9]+$^[0-9]+$Show child attributes
Show child attributes
^0x[0-9a-fA-F]{40}$^0x[0-9a-fA-F]{40}$^0x[0-9a-fA-F]{40}$^0x[0-9a-fA-F]{40}$^[0-9]+$^[0-9]+$^[0-9]+$^[0-9]+$onchain, local-preview Show child attributes
Show child attributes
^[0-9]+$