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

# Quote

> A maker-signed order with ready calldata, pinned to one taker, valid about 30 seconds. Requires an API key.



## OpenAPI

````yaml openapi.json GET /v1/quote
openapi: 3.1.0
info:
  title: Aile Quote API
  version: v1-2026-11
  description: >-
    Get a price, send one transaction, receive the exact amount.


    **How it works**


    1. `GET /config` gives you the chain, the order protocol address
    (`contracts.lop`) and the tokens with their decimals.

    2. `GET /quote` gives you a price for a pair and an amount. Pass as `taker`
    the address that will send the transaction.

    3. From that address, approve `fill.allowanceTarget` for the token you sell.

    4. Send `fill.to`, `fill.data` and `fill.value` from that address before
    `expiresAt`.

    5. Read the receipt. The transaction delivers exactly `buyAmount` or
    reverts.


    **What a quote is**


    A quote is an order signed by the market maker. It is valid for about 30
    seconds, only the `taker` can use it, and it can be used once. `maxFirmSize`
    is the largest amount you can get right now at this rate, in both tokens.


    **What you can rely on**


    - Fields, routes and enumeration values are only ever added, never removed
    or changed in type.

    - Send `fill.to`, `fill.data` and `fill.value` exactly as returned.

    - `order`, `signature`, `maker` and the other `fill` fields are there for
    your information. Do not hard-code the maker address: it changes.

    - `maker.kind`, `signature.type`, `fill.method` and the problem `reason` can
    gain new values. Treat a `reason` you do not know as "no quote".


    **Access**


    Aile issues your API key. Send it as `Authorization: Bearer <key>` and keep
    it on your backend. `GET /quote` requires it. The other routes work without
    it; with it, their calls count against your own budget and are attributed to
    you instead of sharing the anonymous per-address limit. Over budget you get
    429 `key-rate-limit` with `Retry-After`. Use **Authorize** to try the routes
    on this page; the page forgets the key on reload.


    **Scope**


    Base mainnet, real assets. The pairs come from the market makers' books,
    between the tokens `GET /config` lists; a pair nobody quotes answers 400
    `bad-pair`.
servers:
  - url: https://staging.app.aile.tech/api/base
    description: Base
security: []
tags:
  - name: Service
    description: Discover the chain, the order protocol and the tokens
  - name: Quotes
    description: Receive a signed order and ready calldata
  - name: Orders
    description: Track a fill by its order hash
paths:
  /v1/quote:
    get:
      tags:
        - Quotes
      summary: 'Quote: a signed order ready to fill'
      description: >-
        Prices `sellToken`→`buyToken` for exactly one of `sellAmount` (exact-in)
        or `buyAmount` (exact-out) and answers a signed order with ready
        calldata: approve `fill.allowanceTarget` for the sold token, then send
        `fill.to`, `fill.data` and `fill.value` from `taker` before `expiresAt`.
        The fill delivers exactly `buyAmount` or reverts. `taker` is the address
        that will send the fill and receive the bought token (for a contract
        that calls the order protocol, that contract); `recipient` is not
        accepted (400 `invalid-request`). The pairs are the ones the market
        makers' books quote, between the descriptor's `tokens` and `bookTokens`.


        Problems: 400 `bad-pair`, `amount-too-small` (the detail names the
        minimum) or `over-size` (the detail names the maximum); 503 `no-maker`,
        `maker-unavailable`, `no-price`, `maker-underfunded` or
        `maker-allowance`; 503 `kill-switch` while trading is paused; 403
        `address-refused` when `taker` may not be quoted, 503
        `screening-unavailable` while that check cannot run; 401 without a key;
        429 `key-rate-limit` with `Retry-After`. An unknown `reason` means no
        quote. `GET /levels` shows the largest size and its price before you
        ask. (The Aile web app reaches this route from its own pages without a
        key, on a limited path that is not for integrators; its refusals
        `rate-limited`, `firm-taker-limit`, `firm-hold-limit`, `firm-rate-limit`
        and `site-key-unavailable` never answer a keyed call.)
      operationId: firmQuote
      parameters:
        - schema:
            type: string
            pattern: ^[A-Za-z][A-Za-z0-9]{1,11}$
          in: query
          name: sellToken
          required: true
          description: >-
            Symbol of the token you pay. Case-insensitive. Any token the
            descriptor lists (`tokens` or `bookTokens`); the pairs quoted are
            the market makers' books'.
        - schema:
            type: string
            pattern: ^[A-Za-z][A-Za-z0-9]{1,11}$
          in: query
          name: buyToken
          required: true
          description: >-
            Symbol of the token you receive. Case-insensitive. Any token the
            descriptor lists (`tokens` or `bookTokens`).
        - schema:
            type: string
            pattern: ^[1-9]\d{0,77}$
          in: query
          name: sellAmount
          required: false
          description: >-
            Exact-in: base units you pay. Give exactly one of sellAmount /
            buyAmount.
        - schema:
            type: string
            pattern: ^[1-9]\d{0,77}$
          in: query
          name: buyAmount
          required: false
          description: >-
            Exact-out: base units you receive. Give exactly one of sellAmount /
            buyAmount.
        - schema:
            type: string
            pattern: ^0x[0-9a-fA-F]{40}$
          in: query
          name: taker
          required: true
          description: >-
            The address that will send the fill and receive the bought token.
            The order is pinned to it: a fill sent from another address reverts.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedQuote'
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
        '503':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - apiKey: []
components:
  schemas:
    SignedQuote:
      type: object
      properties:
        quoteId:
          type: string
          description: Stable id for this quote.
        sellAmount:
          type: string
          description: Base units the taker pays.
        buyAmount:
          type: string
          description: Base units the taker receives.
        expiresAt:
          type: integer
          description: Unix second when the order expires. About 30 seconds after signing.
        maxFirmSize:
          type: object
          properties:
            sellAmount:
              type: string
              description: In base units of the token the taker pays.
            buyAmount:
              type: string
              description: In base units of the token the taker receives.
          required:
            - sellAmount
            - buyAmount
          additionalProperties: true
          description: >-
            The largest quote the maker can pay now, in both tokens at the
            quoted rate.
        extension:
          type: string
          description: Order extension. 0x while the order has no fee leg.
        fees:
          type: object
          properties:
            bps:
              type: string
              description: Fee in basis points. 0 today.
            amount:
              type: string
              description: Fee amount in base units. 0 today.
            recipient:
              type: string
              description: Fee recipient. The zero address while there is no fee.
          required:
            - bps
            - amount
            - recipient
          additionalProperties: true
        alternatives:
          type: array
          items: {}
          description: Other makers' quotes. Empty while one maker quotes.
        maker:
          type: object
          properties:
            kind:
              type: string
              enum:
                - wallet
                - contract
              description: >-
                wallet when the maker signs with a key, contract when the maker
                is a contract. Open: new values may be added.
            address:
              type: string
              description: >-
                The maker. Informational: do not pin it, it may change between
                quotes.
          required:
            - kind
            - address
          additionalProperties: true
        signature:
          type: object
          properties:
            type:
              type: string
              enum:
                - eip2098
                - erc1271
              description: >-
                eip2098 for a wallet maker, erc1271 for a contract maker. Open:
                new values may be added.
            r:
              type: string
              description: EIP-2098 r, or empty when type is erc1271.
            vs:
              type: string
              description: EIP-2098 vs, or the contract signature when type is erc1271.
          required:
            - type
            - r
            - vs
          additionalProperties: true
        order:
          type: object
          properties:
            salt:
              type: string
            maker:
              type: string
            receiver:
              type: string
            makerAsset:
              type: string
            takerAsset:
              type: string
            makingAmount:
              type: string
            takingAmount:
              type: string
            makerTraits:
              type: string
          required:
            - salt
            - maker
            - receiver
            - makerAsset
            - takerAsset
            - makingAmount
            - takingAmount
            - makerTraits
          additionalProperties: true
          description: >-
            Aile order. Amounts and traits are decimal strings. Addresses are
            0x-prefixed. Informational.
        fill:
          type: object
          properties:
            method:
              type: string
              enum:
                - fillOrder
                - fillContractOrder
                - fillOrderArgs
                - fillContractOrderArgs
              description: >-
                The order protocol method fill.data calls. fillOrder today.
                Open: new values may be added.
            to:
              type: string
              description: Aile order protocol. Send the transaction here.
            data:
              type: string
              description: Calldata. Send it unchanged.
            value:
              type: string
              description: Native value to send. 0.
            allowanceTarget:
              type: string
              description: >-
                Spender the taker must approve for the sold token. The order
                protocol.
            amount:
              type: string
              description: Making amount passed to the fill, in base units.
            takerTraits:
              type: string
              description: >-
                Taker traits word. Bit 255 is set and the low bits are the
                taking amount.
          required:
            - method
            - to
            - data
            - value
            - allowanceTarget
            - amount
            - takerTraits
          additionalProperties: true
        referenceRate:
          type: string
          description: Mid rate the quote was priced from, in human units.
      required:
        - quoteId
        - sellAmount
        - buyAmount
        - expiresAt
        - maxFirmSize
        - extension
        - fees
        - alternatives
        - maker
        - signature
        - order
        - fill
        - referenceRate
      additionalProperties: true
      description: >-
        A quote: an order signed by the maker, with the calldata that fills it.
        Approve fill.allowanceTarget, then send fill.to, fill.data and
        fill.value from taker before expiresAt.
    Problem:
      type: object
      properties:
        type:
          type: string
          description: >-
            Problem type identifier; about:blank unless a machine-readable
            problem type is defined.
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        instance:
          type: string
        reason:
          description: Machine-readable cause, where the route defines one
          type: string
      required:
        - type
        - title
        - status
      additionalProperties: true
      description: RFC 7807 problem details
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        API key issued by Aile. Authorization: Bearer <key>. Required for
        quotes. Optional on the other routes: without it they share the
        anonymous per-address limit, with it the calls are attributed to you and
        charged to your own budget.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.