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.

Body

application/json

The body of POST /v1/price: what a swap would give now. It creates nothing.

fromChain
string
required

The source chain's slug.

Example:

"base"

fromAsset
string
required

The token sold: an address, or native for an EVM chain's native coin.

Example:

"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"

fromAmount
string
required

How much is sold, in the token's base units, base 10.

Pattern: ^[0-9]+$
Example:

"1000000"

toChain
string
required

The destination chain's slug: the source chain's for a same-chain swap.

Example:

"starknet"

toAsset
string
required

The token bought: an address, or native.

Example:

"0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8"

sender
string

The account that would send: sourceGas then counts only the approvals it still needs.

Example:

"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

slippageBps
integer<int32>

How far under the expected output the user accepts, in basis points. The server picks a default without it.

Required range: x >= 0
Example:

50

privacy
string

shielded: a private swap on Starknet, from the user's shielded balance. It names no sender.

Allowed value: "shielded"

Response

The best price

POST /v1/price: what a swap gives now, and what it costs. A price only: it commits no one.

from
object
required

What is sold.

to
object
required

What the best solver or route delivers.

expiresAt
integer<int64>
required

Unix seconds the price is good until.

Required range: x >= 0
Example:

1793084230

route

How a quote settles.

Allowed value: "escrow"
fees
object

The fees, when known.

priceImpactBps
integer<int64>

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

Required range: x >= 0
Example:

2

costBps
integer<int64>

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
Example:

13

etaSecs
integer<int64>

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

Required range: x >= 0
Example:

40

sourceGas
object

What the sender's wallet pays in gas on the source chain, when known. With a sender it 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.