Skip to main content
POST
/
action
/
builders
/
swap
cURL
curl -X POST https://api.relayer.fi/v1/action/builders/swap \
  -H "Authorization: ApiKey $RELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tokenIn":  "0xA0b86a33...",
    "tokenOut": "0xC02aaA39...",
    "chain":    "base",
    "title":    "Swap USDC → WETH"
  }'
{
  "success": true,
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Use this format: ApiKey <your_api_key>

Body

application/json

Parameters for generating swap metadata

protocol
string
required

Protocol name

Example:

"lfj"

chainName
string
required

Blockchain name

Example:

"avalanche"

fromToken
string
required

Input token

Example:

"AVAX"

toToken
string
required

Output token

Example:

"JOE"

routerAddress
string
required

KOL Router contract address

Example:

"0x123abc456def789012345678901234567890abcd"

slippageTolerance
number
required

Slippage tolerance (percentage)

Example:

0.5

Response

Swap metadata generated successfully

success
boolean
Example:

true

metadata
object

Generated metadata object containing all swap configuration