> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leokit.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List Routes

> List protocols capable of swapping a given asset pair (respects client modularity settings)

## 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 an `Api-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)

```json theme={null}
{
  "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)

```bash theme={null}
curl "https://api.leokit.dev/leokit/routes?from_asset=ETH.ETH&to_asset=BTC.BTC"
```

### Authenticated request (filtered by client config)

```bash theme={null}
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_seconds` is 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/quote`](/api-reference/quotes) or [streaming quotes](/api-reference/endpoint/streaming-quotes).


## OpenAPI

````yaml /api-reference/openapi.json GET /routes
openapi: 3.0.3
info:
  title: Leokit API
  version: 1.0.0
  description: API reference for Leokit
servers:
  - url: https://api.leokit.dev
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /routes:
    get:
      summary: List available routes for a pair
      description: >-
        Returns the protocols capable of swapping a given asset pair. Respects
        per-client modularity (disabled_protocols/disabled_chains) when an
        Api-Key is provided.
      parameters:
        - name: from_asset
          in: query
          required: true
          schema:
            type: string
          example: ETH.ETH
        - name: to_asset
          in: query
          required: true
          schema:
            type: string
          example: BTC.BTC
      responses:
        '200':
          description: Routes for the pair.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutesResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
      security:
        - {}
        - ApiKeyAuth: []
components:
  schemas:
    RoutesResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - from_asset
            - to_asset
            - from_chain
            - to_chain
            - routes
            - unsupported
          properties:
            from_asset:
              type: string
            to_asset:
              type: string
            from_chain:
              type: string
            to_chain:
              type: string
            routes:
              type: array
              items:
                $ref: '#/components/schemas/RouteEntry'
            unsupported:
              type: array
              items:
                type: string
    RouteEntry:
      type: object
      required:
        - protocol
        - type
        - estimated_seconds
        - is_intent_based
        - requires_same_chain
      properties:
        protocol:
          type: string
        type:
          type: string
          enum:
            - cross-chain-dex
            - dex-aggregator
            - bridge
            - intent-bridge
            - aggregator
        estimated_seconds:
          type: integer
        is_intent_based:
          type: boolean
        requires_same_chain:
          type: boolean
    Error:
      type: object
      description: Generic error payload.
      properties:
        message:
          type: string
        code:
          type: string
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: 'Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4'

````