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

# Get a quote

> Returns an indicative quote for a deposit/settle token pair. Set `amountIsDeposit=true` to quote from a deposit amount, or `false` to quote from the settle amount you want to receive, in which case the API computes the required deposit.

Authenticate with the tenant API key, or with a JWT access token if you have one.

<Warning>Quotes do not enforce swap limits. An amount far outside the range returned by `GET /v1/tokens/swap-limits` still returns `200 OK`, with significant order-book slippage included in `exchangeRate`. Check swap limits first and treat out-of-range quotes as unusable.</Warning>


## OpenAPI

````yaml /openapi.json get /v1/tokens/quote
openapi: 3.1.0
info:
  title: Vane API
  version: 1.0.0
  summary: Cross-chain and same-chain swaps filled by an open network of solvers.
  description: >-
    Vane turns a swap into an intent: you declare what you want to receive, the
    API returns a per-order deposit address, and a solver fills the order
    against the escrowed deposit ([how solvers fill
    orders](/features/solver-auctions)).


    **Authentication.** Most endpoints accept a tenant API key sent as the
    `x-tenant-api-key` header (accountless integration). The key pre-filled in
    the API playground is a shared public key for evaluating the API. Production
    integrations use their own tenant key, requested from support
    (help@vane.xyz) and kept server-side. A JWT access token from SIWX
    wallet-signature auth also satisfies these endpoints and attributes orders
    to a user account, which adds order history (`GET /v1/orders`) and points.


    **Error behavior.** Errors use the envelope `{statusCode, message, error}`.
    Field order varies and some errors omit `error`. Most business validation
    failures (an unknown token id, a malformed address, an invalid amount, an
    unknown order UUID) return HTTP `500` with a descriptive message, while
    `400` appears only for malformed query parameters. Match on the message text
    for programmatic handling, not just the status codes.


    **The fields `exchange` and `tradePath`** describe how a quote is priced and
    routed across order-book legs. They say nothing about settlement, which
    solvers perform separately.
  contact:
    name: Vane support
    email: help@vane.xyz
    url: https://vane.xyz
  termsOfService: https://vane.xyz/terms-and-conditions
servers:
  - url: https://api.vane.xyz/api
    description: Production
security:
  - tenantApiKey: []
tags:
  - name: Tokens
    description: The token catalog, swap limits, and quotes.
  - name: Orders
    description: Create swap orders and track them to a terminal state.
  - name: Auth
    description: >-
      Optional SIWX wallet-signature authentication. Adds order history and
      points.
paths:
  /v1/tokens/quote:
    get:
      tags:
        - Tokens
      summary: Get a quote
      description: >-
        Returns an indicative quote for a deposit/settle token pair. Set
        `amountIsDeposit=true` to quote from a deposit amount, or `false` to
        quote from the settle amount you want to receive, in which case the API
        computes the required deposit.


        Authenticate with the tenant API key, or with a JWT access token if you
        have one.
      operationId: getQuote
      parameters:
        - $ref: '#/components/parameters/DepositTokenId'
        - $ref: '#/components/parameters/SettleTokenId'
        - name: amount
          in: query
          required: true
          description: >-
            Amount to quote. Interpreted as the deposit amount when
            `amountIsDeposit=true`, or as the desired settle amount when
            `false`. The API does not enforce it: a missing or non-numeric value
            still returns `200` with `depositAmount: null`, `settleAmount: 0`,
            and `exchangeRate: 0`, so validate it client-side.
          schema:
            type: number
          example: 0.005
        - name: amountIsDeposit
          in: query
          required: true
          description: >-
            `true` if `amount` is the deposit amount, `false` if it is the
            settle amount you want to receive.
          schema:
            type: boolean
          example: true
      responses:
        '200':
          description: >-
            Indicative quote for the pair. Returned even for amounts outside the
            swap limits, with order-book slippage included in `exchangeRate`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Quote'
              example:
                depositToken: BTC
                depositAmount: 0.005
                settleToken: USDT
                settleAmount: 316.2963
                exchangeRate: 63259.26069931
                depositTokenUsdValue: 316.98
                settleTokenUsdValue: 316.27
                exchange: CEX
                tradePath:
                  - symbol: BTCUSDT
                    side: SELL
                    inputToken: BTC
                    outputToken: USDT
        '400':
          description: >-
            Malformed query parameters (for example, a missing or non-boolean
            `amountIsDeposit`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Validation failed (boolean string is expected)
                error: Bad Request
                statusCode: 400
        '401':
          $ref: '#/components/responses/UnauthorizedTenant'
        '500':
          description: >-
            Invalid input, such as an unknown token id or an invalid amount,
            returns `500` with a descriptive message. The message text
            identifies the cause.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidTokenId:
                  summary: Invalid token id
                  value:
                    message: 'Invalid deposit token id provided: 999999'
                    error: Internal Server Error
                    statusCode: 500
                invalidAmount:
                  summary: Invalid amount
                  value:
                    message: 'Invalid amount: 0'
                    error: Internal Server Error
                    statusCode: 500
components:
  parameters:
    DepositTokenId:
      name: depositTokenId
      in: query
      required: true
      description: >-
        Numeric id of the token being deposited. Ids are chain-specific: BTC is
        `158` on Bitcoin, `159` on Ethereum (ERC20), and `157` on BNB Smart
        Chain. Look ids up with `GET /v1/tokens`.
      schema:
        type: integer
      example: 158
    SettleTokenId:
      name: settleTokenId
      in: query
      required: true
      description: >-
        Numeric id of the token to receive. Pick the id on the chain you want to
        receive on; the catalog at `GET /v1/tokens` lists them all.
      schema:
        type: integer
      example: 231
  schemas:
    Quote:
      type: object
      description: >-
        An indicative quote. Quotes do not enforce swap limits; out-of-range
        amounts return a quote with order-book slippage included in
        `exchangeRate`.
      properties:
        depositToken:
          type: string
          description: Symbol of the deposit token.
        depositAmount:
          type:
            - number
            - 'null'
          description: >-
            Deposit amount. Computed by the API when `amountIsDeposit=false`.
            `null` when `amount` was missing or not numeric; the quote is
            unusable in that case.
        settleToken:
          type: string
          description: Symbol of the settle token.
        settleAmount:
          type: number
          description: >-
            Estimated settle amount. Computed by the API when
            `amountIsDeposit=true`. `0` when `amount` was missing or not
            numeric.
        exchangeRate:
          type: number
          description: >-
            Effective rate between deposit and settle tokens. For amounts
            outside the swap limits, order-book slippage is included here, which
            is why you check swap limits first. `0` when `amount` was missing or
            not numeric.
        depositTokenUsdValue:
          type:
            - number
            - 'null'
          description: >-
            USD value of `depositAmount` at quote time, for display. `null` when
            `depositAmount` is `null`.
        settleTokenUsdValue:
          type: number
          description: USD value of `settleAmount` at quote time, for display.
        exchange:
          type: string
          description: >-
            Pricing source label for the quote (for example `CEX`). It describes
            pricing only; solvers settle the order through intent matching.
        tradePath:
          type: array
          description: >-
            Order-book legs used to price the quote. Routing for the price,
            never for settlement.
          items:
            $ref: '#/components/schemas/TradePathLeg'
      required:
        - depositToken
        - depositAmount
        - settleToken
        - settleAmount
        - exchangeRate
        - depositTokenUsdValue
        - settleTokenUsdValue
        - exchange
        - tradePath
    Error:
      type: object
      description: >-
        Canonical error envelope. Field order varies and `error` is sometimes
        omitted (the unknown-order `500` returns only `statusCode` and
        `message`); message casing varies too (`Internal Server Error` vs
        `Internal server error`). Most business validation failures return `500`
        with a descriptive message, so match on `message` for programmatic
        handling.
      properties:
        statusCode:
          type: integer
          description: HTTP status code.
        message:
          type: string
          description: >-
            Error description. The most reliable field for distinguishing
            causes.
        error:
          type: string
          description: >-
            HTTP status text, for example `Bad Request`, `Unauthorized`.
            Sometimes absent.
      required:
        - statusCode
        - message
    TradePathLeg:
      type: object
      description: >-
        One order-book leg used to price a quote. This is pricing and routing
        information only; solvers perform settlement through intent matching.
        Cross pairs may have multiple legs, and `inputToken`/`outputToken`
        casing may vary across legs in multi-leg responses (for example
        lowercase `sol`, `eth`), so match symbols without regard to case.
      properties:
        symbol:
          type: string
          description: Order-book pair symbol, for example `BTCUSDT`.
        side:
          type: string
          enum:
            - SELL
            - BUY
          description: Side of the order-book leg.
        inputToken:
          type: string
          description: Input token symbol for this leg.
        outputToken:
          type: string
          description: Output token symbol for this leg.
      required:
        - symbol
        - side
        - inputToken
        - outputToken
  responses:
    UnauthorizedTenant:
      description: >-
        Missing or invalid tenant API key. The message says "access token" but
        refers to the `x-tenant-api-key` header (a valid JWT access token also
        satisfies this endpoint).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: Valid access token required.
            error: Unauthorized
            statusCode: 401
  securitySchemes:
    tenantApiKey:
      type: apiKey
      in: header
      name: x-tenant-api-key
      x-default: c7eccc0aaed64932a85d35658fa55a4fb2d60cd3d2c529cfd643dc676ee82e82
      description: >-
        Vane's shared tenant key. Contact support for a dedicated key if you
        need custom parameters or separate order tracking.

````