---
title: "Price a same-network asset swap"
method: POST
path: "/swap/quote"
tags: ["Swap"]
---

# Price a same-network asset swap

`POST /swap/quote`

## Request

- Base URL: `https://developers.ozav.io/v2`
- URL: `https://developers.ozav.io/v2/swap/quote`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Prices a swap between two assets on the same network, comparing the
sources available and returning the best net rate.

Read-only. It is a POST because it carries a body (the pair, the amount,
the tolerance), not because it writes. Nothing leaves any wallet.

The quote does not execute, and `executable` says so rather than leaving
it to be assumed. There is no route that accepts a quote: moving value
needs an execution gate that no source currently passes. The absence of
that route is the gate, not an omission.

The wallet that receives the outgoing asset is derived from the
authenticated client. The body carries the pair and the amount, never a
destination: accepting one would let a caller price, and later execute, a
swap whose proceeds land somewhere else.

`slippage_bps` is required and has no silent default. A hidden default
would decide, on the client's behalf, how much they accept losing.

`min_amount_out` travels beside `amount_out`, never instead of it. Showing
only the expected output would make the tolerance disappear from the
answer, and the client would compare an optimistic figure against an
already-discounted one elsewhere.

Not every network carries a pair. A swap needs both assets settled on
the same network, and some networks carry only one of them. A pair no
source serves answers a named error, never a zero or an empty quote, so a
pair that cannot be served stays distinguishable from a bad price.

`quotes_compared` and `sources_unavailable` are counts, never lists. That a
comparison happened is worth knowing (the best of three is a different
answer from the only one that replied), and the number says it without
naming who.

## Request body

- object
  - `chain` string, required
  - `asset_in` string, required
  - `asset_out` string, required
  - `amount_in` string, required: Decimal integer string, smallest unit of `asset_in`. Never a float.
  - `slippage_bps` integer, required: Tolerance in basis points. 50 is 0.50%. Required.

## Response `200`

The swap priced.

- object
  - `quote` object
    - `chain` string
    - `asset_in` string
    - `asset_out` string
    - `amount_in` string
    - `amount_out` string
    - `min_amount_out` string: The floor an execution would have to honour, after tolerance.
    - `expires_at` string, date-time
    - `executable` false: Always false. This surface prices; it does not execute.
  - `quotes_compared` integer
  - `sources_unavailable` integer: How many sources did not answer. Never silenced: a quote chosen from one of three is a different answer from one chosen from three of three.

## Other responses

- `401`: Missing or invalid API key.

---

[API](https://skmtc.dev/ozav/apis/ozav-api.md) - [All operations](https://skmtc.dev/ozav/apis/ozav-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ozav/apis/ozav-api/revisions/4133dc2109d7?raw)
