List available routes for a pair
curl --request GET \
--url https://api.leokit.dev/routes \
--header 'Api-Key: <api-key>'import requests
url = "https://api.leokit.dev/routes"
headers = {"Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Key': '<api-key>'}};
fetch('https://api.leokit.dev/routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/routes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/routes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.leokit.dev/routes")
.header("Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/routes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"from_asset": "<string>",
"to_asset": "<string>",
"from_chain": "<string>",
"to_chain": "<string>",
"routes": [
{
"protocol": "<string>",
"type": "cross-chain-dex",
"estimated_seconds": 123,
"is_intent_based": true,
"requires_same_chain": true
}
],
"unsupported": [
"<string>"
]
}
}{
"message": "<string>",
"code": "<string>"
}Endpoint Details
List Routes
List protocols capable of swapping a given asset pair (respects client modularity settings)
GET
/
routes
List available routes for a pair
curl --request GET \
--url https://api.leokit.dev/routes \
--header 'Api-Key: <api-key>'import requests
url = "https://api.leokit.dev/routes"
headers = {"Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Api-Key': '<api-key>'}};
fetch('https://api.leokit.dev/routes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leokit.dev/routes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.leokit.dev/routes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.leokit.dev/routes")
.header("Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leokit.dev/routes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"from_asset": "<string>",
"to_asset": "<string>",
"from_chain": "<string>",
"to_chain": "<string>",
"routes": [
{
"protocol": "<string>",
"type": "cross-chain-dex",
"estimated_seconds": 123,
"is_intent_based": true,
"requires_same_chain": true
}
],
"unsupported": [
"<string>"
]
}
}{
"message": "<string>",
"code": "<string>"
}Overview
/leokit/routes returns the protocols that can swap a given from_asset → to_asset pair, along with metadata for each (estimated time, intent-based or not, same-chain requirement). The response respects per-client disabled_protocols configured in the LeoKit Dashboard.
Use this for UI like a “swap-via” picker, or to pre-filter protocols before requesting quotes.
Endpoint
GET /leokit/routes
Request
Authentication
Authentication is optional. With anApi-Key, the response is filtered by your client’s modularity settings (disabled protocols/chains). Without one, all globally-enabled protocols are returned.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from_asset | string | Yes | Source asset in CHAIN.SYMBOL-ADDRESS format |
to_asset | string | Yes | Destination asset in CHAIN.SYMBOL-ADDRESS format |
Response
Success (200)
{
"data": {
"from_asset": "ETH.ETH",
"to_asset": "BTC.BTC",
"from_chain": "ETH",
"to_chain": "BTC",
"routes": [
{
"protocol": "thorchain",
"type": "cross-chain-dex",
"estimated_seconds": 600,
"is_intent_based": false,
"requires_same_chain": false
},
{
"protocol": "chainflip",
"type": "cross-chain-dex",
"estimated_seconds": 120,
"is_intent_based": false,
"requires_same_chain": false
}
],
"unsupported": ["oneinch"]
}
}
Field Reference
| Field | Description |
|---|---|
from_chain | Source chain code (e.g. ETH) |
to_chain | Destination chain code (e.g. BTC) |
routes | Array of usable protocols for this pair |
unsupported | Protocols that exist but can’t route this specific pair |
Route Object
| Field | Type | Description |
|---|---|---|
protocol | string | Protocol slug (e.g. thorchain, chainflip, relay, near, harbor) |
type | string | cross-chain-dex, dex-aggregator, bridge, intent-bridge, or aggregator |
estimated_seconds | number | Average time-to-settle for this protocol |
is_intent_based | boolean | True for solver-based intent protocols (Across, deBridge) |
requires_same_chain | boolean | True for protocols that only do same-chain swaps (e.g. 1inch). Cross-chain pairs unsupported |
Caching
Responses are cached for 60 seconds (Cache-Control: public, max-age=60).
Errors
| Status | Code | Description |
|---|---|---|
400 | BAD_REQUEST | Missing from_asset or to_asset |
Examples
Public request (all enabled protocols)
curl "https://api.leokit.dev/leokit/routes?from_asset=ETH.ETH&to_asset=BTC.BTC"
Authenticated request (filtered by client config)
curl -H "Api-Key: YOUR_API_KEY" \
"https://api.leokit.dev/leokit/routes?from_asset=ETH.ETH&to_asset=BTC.BTC"
Notes
- Protocol metadata is static per protocol —
estimated_secondsis an average, not a real-time measurement. - Internal protocol variants (e.g.
thorchain-aggregator-swapout) are filtered out of the response. - For full per-protocol live quotes, follow up with
/leokit/quoteor streaming quotes.