Skip to main content

API Key Authentication

All LeoKit API endpoints require authentication via an API key. You can pass the API key using either the request header (recommended) or query parameter. Pass your API key in the Api-Key header:
Api-Key: your_api_key_here

Query Parameter Method (Alternative)

Alternatively, you can pass the API key as a query parameter:
GET /leokit/quote?api_key=your_api_key_here&...

Client Configuration

Each API key is associated with a client configuration that controls various aspects of the API behavior. These settings allow you to customize which chains and protocols are available to your application.

Disabled Chains

You can exclude specific blockchain networks from quotes and asset lists by providing an array of blockchain short names. Example:
{
  "disabled_chains": ["SOL", "AVAX", "FANTOM"]
}
This configuration would exclude Solana, Avalanche, and Fantom from all API responses.

Disabled Protocols

You can exclude specific DEX protocols from quote aggregation by providing an array of protocol UUIDs. Example:
{
  "disabled_protocols": ["thorchain-uuid", "maya-uuid"]
}
This configuration would prevent THORChain and MAYAChain quotes from being included in results.

Client Fees

Configure revenue sharing for each protocol using the client fees setting. This allows you to earn a percentage of each swap. Example:
{
  "client_fees": {
    "fee_bps": 30,
    "thorchain_address": "thor1...",
    "mayachain_address": "maya1...",
    "chainflip_address": "0x...",
    "relay_address": "0x...",
    "near_address": "example.near"
  }
}
Parameters:
  • fee_bps: Fee in basis points (30 = 0.30%)
  • Protocol-specific addresses: Your wallet addresses for receiving fees on each protocol

Invalid API Key Response

If you provide an invalid or missing API key, the API will return a 403 Forbidden error: Status Code: 403 Forbidden
{
  "error": "Unknown Api-Key",
  "status": 403,
  "code": "CLIENT_CONFIG_IS_NOT_SET"
}
Make sure to include a valid API key with every request to avoid authentication errors.