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

# Create your first quote

> Discover a token pair and request an executable swap quote.

Use the hosted API to find a token pair and create an executable WETH-to-USDC quote
on Ethereum. The catalogue endpoints are public; quote endpoints require an API key.

## Before you start

Create an API key in the [uatu console](/console), then store it in an environment
variable:

```sh theme={null}
export UATU_API_KEY="uatu_live_..."
```

<Warning>
  Keep your API key on the server. Do not commit it or expose it in browser or mobile
  application code.
</Warning>

All requests below use the hosted API at `https://api.uatu.dev`.

## 1. Choose a chain

`GET /blockchains` returns every supported chain and its token definitions. This
endpoint does not require authentication.

```sh theme={null}
curl https://api.uatu.dev/blockchains
```

Every response uses the same envelope: `code` mirrors the HTTP status, `message`
describes the result, and `data` contains the payload. Here is the Ethereum entry,
shortened for clarity:

```json theme={null}
{
  "code": 200,
  "message": "Blockchains fetched successfully",
  "data": [
    {
      "name": "Ethereum",
      "slug": "ethereum",
      "chainId": 1,
      "symbol": "ETH",
      "nativeToken": "ETH",
      "ecosystem": "evm",
      "blockExplorer": "https://etherscan.io"
    }
  ]
}
```

Save the chain's `chainId`. For this Ethereum swap, use `1` for both
`originChainId` and `destinationChainId` in the quote request.

## 2. Choose the tokens

Filter the token catalogue by the selected chain. Omit `chainId` to list tokens on
every chain.

```sh theme={null}
curl "https://api.uatu.dev/blockchains/tokens?chainId=1"
```

The response's `data` field is an array:

```json theme={null}
{
  "code": 200,
  "message": "Tokens fetched successfully",
  "data": [
    {
      "name": "Wrapped Ether",
      "symbol": "WETH",
      "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "decimals": 18,
      "slug": "weth",
      "blockchainId": 1
    },
    {
      "name": "USD Coin",
      "symbol": "USDC",
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "decimals": 6,
      "slug": "usdc",
      "blockchainId": 1
    }
  ]
}
```

You need each token's `address` for the quote. Keep `decimals` as well: raw amounts
in the response use the token's smallest unit.

## 3. Request a quote

`POST /quotes` prices the pair across the available DEX routes and returns the best
route with ready-to-sign transaction data.

Replace `0xYourRecipientAddress` with the address that will receive USDC:

```sh theme={null}
curl -X POST https://api.uatu.dev/quotes \
  -H "Authorization: Bearer ${UATU_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "originChainId": 1,
    "destinationChainId": 1,
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1",
    "recipientAddress": "0xYourRecipientAddress",
    "slippageBps": 50
  }'
```

The first six fields are required. `amount` is a decimal string in the input token's
display units, so `"1"` means 1 WETH—not 1 wei. `slippageBps` is optional; `50`
allows 0.5% slippage. If omitted, the server default applies. See
[Slippage](/concepts/quotes#slippage) for details.

## 4. Read and execute the quote

The response includes the chosen route, the minimum acceptable output, an expiry,
and the transactions your wallet must submit. This representative response is
shortened:

```json theme={null}
{
  "code": 200,
  "message": "Quote created successfully",
  "data": {
    "quoteId": "4d4cb5b4-6d7a-48ed-a7fd-b2e20c556fd8",
    "amountIn": "1000000000000000000",
    "amountOut": "2493777615",
    "amountOutMinimum": "2481308726",
    "amountInFloat": "1",
    "amountOutFloat": "2493.777615",
    "slippageBps": 50,
    "route": {
      "dex": "uniswap",
      "name": "Uniswap",
      "fees": "42207128027132"
    },
    "steps": [
      {
        "message": "Permit2 approval",
        "from": "0x...",
        "to": "0x...",
        "amount": "1000000000000000000",
        "data": "0x...",
        "chainId": 1
      },
      {
        "message": "Swap WETH to USDC",
        "from": "0x...",
        "to": "0x...",
        "amount": "1000000000000000000",
        "data": "0x...",
        "chainId": 1
      }
    ],
    "deadline": 1787624479,
    "status": "pending"
  }
}
```

Before submitting anything:

* Display `amountOutFloat`, but use the integer amount fields for on-chain logic.
* Make sure the current Unix time is earlier than `deadline`; otherwise, request a
  new quote.
* Submit every item in `steps` in order with the wallet in `from`, waiting for each
  transaction to confirm before sending the next.
* Include a step's `value` when present. Native-token swaps use it to carry the
  transaction's native value.

The swap calldata enforces `amountOutMinimum`. If the market moves below that floor,
the transaction reverts instead of filling at a worse price.

<CardGroup cols={2}>
  <Card title="Integrate the API" icon="plug" href="/guides/integration">
    Send quote steps with viem or ethers.js and handle common edge cases.
  </Card>

  <Card title="Full API reference" icon="code" href="/api-reference">
    Review every endpoint, parameter, and response schema.
  </Card>
</CardGroup>


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