Quote endpoints
The Exchange API exposes four quote endpoints. They all wrap Kumbaya's smart-order-router and all require a partner API key. They differ in which tokens they cover and the request/response shape.
/api/v1/quote
GET
Partner key (x-api-key)
Off
One-shot quote with calldata and full route details
/api/v1/quote
POST
Partner key (x-api-key)
Enforced
Partner integrations, transaction-ready response
/api/v1/quote/open
POST
Partner key (x-api-key)
Off
Quotes for any token pair (allowlist off)
/api/v1/quote/tokens
GET
Partner key (x-api-key)
-
Returns the partner allowlist
All quote endpoints are partner-gated. Every one requires a valid
x-api-key; without it they return401 { "error": "Invalid API key" }. "Open" refers to the token allowlist being off, not authentication. To get a key, see Authentication or email support@kumbaya.xyz.
GET /api/v1/quote
Quote with full route details. Returned calldata targets the chosen router. Requires an x-api-key header.
Query parameters
chainId
string
yes
e.g. 4326
tokenInAddress
address
yes
tokenInDecimals
int
no, default 18
tokenOutAddress
address
yes
tokenOutDecimals
int
no, default 18
amount
string
yes
Base units of the input token (or output if type=exactOut)
type
string
no, default exactIn
exactIn or exactOut
slippageBps
string
no, default 50
basis points (50 = 0.5%)
recipient
address
yes
Where the swap output should land
routerType
enum
no, default swap-router-02
swap-router-02 or universal
Response (GetQuoteResponse)
The methodParameters block is ready to submit as a transaction.
POST /api/v1/quote
Partner endpoint. Enforces a per-chain token allowlist; an off-list token returns HTTP 400 with { "error": "Token not permitted by allowlist", "details": { "addresses": [...] } }. Pull the live allowlist via GET /api/v1/quote/tokens?chainId=….
Request body (QuoteRequest)
slippagehere is a decimal fraction (e.g.0.005for 0.5%) - not basis points like the GET endpoint.useRouterBalance: trueis for aggregator integrations that pre-fundedUniversalRouterand want it to swap from its own balance instead of pulling frommsg.sendervia Permit2.
Header
Response (PartnerQuoteResponse)
⚠️ The transaction object uses
callData(capital D) here, while the GET response usescalldatainsidemethodParameters. They're different schemas; don't mix them up.
POST /api/v1/quote/open
Same body and response shape as POST /api/v1/quote, and the same x-api-key requirement, but with the token allowlist off - it quotes any pair and returns meta.allowlistApplied: false.
GET /api/v1/quote/tokens
Returns the partner allowlist for a chain.
Query
chainId
yes
e.g. 4326
Response (TokensResponse)
x-api-key header required.
Error codes
All quote endpoints share a QuoteErrorReason enum:
reason
HTTP
Meaning
NO_ROUTE
404
No liquidity pools connect the pair
INSUFFICIENT_LIQUIDITY
500
Route exists but insufficient liquidity for this size
NO_POOLS_AVAILABLE
500
No pools connect the input/output
ROUTE_MISSING_METHOD_PARAMETERS
500
Route found but couldn't generate calldata
INVALID_TOKEN_ADDRESS
400
Malformed address
TOKEN_NOT_FOUND
500
Address isn't a deployed ERC-20
TOKEN_DECIMALS_FETCH_FAILED
500
Couldn't read decimals()
INVALID_AMOUNT
400
Malformed amount
AMOUNT_TOO_SMALL
400
Below minimum trade threshold
CHAIN_NOT_CONFIGURED
400
Valid chain ID but not enabled on this server
CHAIN_NOT_SUPPORTED
400
Unrecognized chain ID
RPC_ERROR
500
Network/RPC issue
QUOTE_TIMEOUT
500
Request timed out
ROUTE_BUILD_FAILED
500
Unexpected route-build error
Error response shape:
Picking GET vs POST
Both require a partner key. The difference is shape and allowlist:
GET
/api/v1/quote- query params,slippageBps(basis points), returns fullroutedetails plus amethodParametersblock (calldata, lowercase). No allowlist. Good for a one-shot quote where you want the route.POST
/api/v1/quote- JSON body,slippageas a decimal fraction, enforced allowlist, returns a transaction-readytransactionobject (callData, capital D). The production path for partner integrations.POST
/api/v1/quote/open- same as POST but with the allowlist off (any pair).
Last updated