POST

Authorizations

x-api-key
string
header
required

A partner's API key. Optional: without it a request is anonymous. An invalid key is 401 unauthorized.

Headers

Idempotency-Key
string | null

Firm quotes: repeats with the same key and body get the first response; 1 to 255 visible ASCII characters

Body

application/json

The body of POST /v1/quote. Across chains, executionCondition asks for a firm quote, which needs sender and recipient. On one chain the quote is a swap through a DEX aggregator: firm with sender and recipient, and it takes no executionCondition. A private swap (privacy: "shielded", Starknet only) takes neither: it is indicative, and firm with firm: true.

from
object
required

What the user pays.

to
object
required

What the user receives; the solver names the amount.

executionCondition
string | null

SHA-256 of the client's 32-byte fulfillment, in hex. Never reuse one.

firm
boolean

Private swaps: true asks for the firm quote, with the actions for the wallet to prove. Other quotes are firm by what they carry (executionCondition, recipient) and take no firm.

privacy
enum<string> | null

shielded: a private swap on Starknet, from the user's shielded balance in the privacy pool (STRK20) to a new shielded note, sent by Tern's relayer. Same chain only; the request names no sender or recipient.

Available options:
shielded
recipient
string | null

The user's address on the destination chain.

sender
string | null

The user's refund address on the source chain.

slippageBps
integer<int32> | null

How far under the expected output the user accepts, in basis points: a swap reverts below it, and a cross-chain solver commits to the expected amount less it. The server picks a default without it.

Required range: x >= 0
Example:

50

Response

An indicative or firm quote

POST /v1/quote's answer.

execute
object
required

How to fund a firm quote's source escrow, or send its swap.

expiresAt
integer<int64>
required

Escrows: the deposit deadline. Swaps: the time to send by (the route goes stale). Unix seconds.

Required range: x >= 0
from
object
required

One leg with its amount.

id
string
required
Example:

"q_01JB8Z5W3F6V9Q2X4K7M1N0P8R"

to
object
required

Escrows: to.amount is what the solver committed to deliver, the minimum to check before revealing. Swaps: to.amount is the route's expected output and to.minAmount the least it delivers.

costBps
integer<int64> | null

The fees' total in basis points of from.usd: from.usd − to.usd, plus the sender's own gas on the source chain when network includes it. Everything the user gives up, when known.

Required range: x >= 0
etaSecs
integer<int64> | null

Seconds from the deposit (or the swap) being seen until the recipient is paid, as estimated at quote time.

Required range: x >= 0
fees
object | null

The fees at quote time, when known.

priceImpactBps
integer<int64> | null

What the route loses against market price, router fees included, in basis points of from.usd, when known.

Required range: x >= 0
route
enum<string>

How a quote settles.

Available options:
escrow,
swap
sourceGas
object | null

What the sender's wallet pays in gas on the source chain, when known. An indicative quote with a sender counts only the approvals that sender still needs; without one it counts the approval a token needs at most. A private swap's is the relayer's fee in STRK, which the shielded balance pays instead of a wallet.