> ## Documentation Index
> Fetch the complete documentation index at: https://docs.starkfi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quote overview

> Get spot market quotes for any asset pair — direct exchange pairs or cross rates via USDT.

The Quote service returns live market prices from Binance and Bybit. Use it to convert between any supported assets without hard-coding exchange symbols: send `from` and `to`, and StarkFi resolves the pair (including cross rates through USDT when no direct market exists).

<Info>
  All Quote routes require your API key in the `x-api-key` header. See [Authentication](/authentication).
</Info>

## Endpoint

| Method | Path            | Description                                               |
| ------ | --------------- | --------------------------------------------------------- |
| `GET`  | `/quote/market` | Market quote — any-to-any by `from`/`to` or legacy `pair` |

## Any-to-any market quote

Preferred integration: pass the assets you care about. StarkFi tries both spot orientations (`BASEQUOTE` and `QUOTEBASE`), then falls back to a **via USDT** synthetic cross when needed.

```bash theme={null}
curl --request GET \
  --url 'https://api.starkfi.io/quote/market?from=ETH&to=BTC' \
  --header 'x-api-key: <api_key>'
```

### Response highlights

* `data.price` — ticker price for the resolved symbol (when applicable)
* `data.source` — `binance`, `bybit`, or combined sources for cross routes
* `data.requested` — explicit `from` → `to` rate when you sent `from` and `to`
* `data.rates` — both directions of the conversion
* `data.route` — present for cross quotes (`type: "via_usdt"`) with leg details

## Legacy `pair` format

You can still pass an exchange symbol or fiat-oriented pair query params (used by older StarkPay integrations):

| Query shape           | Example                            |
| --------------------- | ---------------------------------- |
| String symbol         | `?pair=BTCUSDT`                    |
| Try both orientations | `?try_one=USDTETH&try_two=ETHUSDT` |

When possible, prefer `from` + `to` for clearer `requested` rates in the response.

## Errors

| Status | `status`          | When                                          |
| ------ | ----------------- | --------------------------------------------- |
| `400`  | `params_mismatch` | Missing or invalid `pair` / `from` / `to`     |
| `400`  | `pair_not_found`  | No Binance/Bybit ticker and no USDT cross leg |
| `403`  | —                 | Missing or invalid API key                    |
| `500`  | `server_failed`   | Upstream or internal error                    |

<Card title="API reference" icon="code" href="/quote-market">
  Request fields, response schema, and copy-paste examples for `GET /quote/market`
</Card>
