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

> ## Agent Instructions
> To quote bridges and swaps, look up chains and tokens, or track Relay transactions from an agent, use the Relay MCP server: `npx -y @relayprotocol/relay-mcp`. It is read-only and does not sign or broadcast transactions. Setup: https://docs.relay.link/resources/developing-with-ai.md
> For Relay Protocol's trust model, security architecture, and audits, see https://docs.relay.link/references/protocol/security.md. For address screening, see https://docs.relay.link/security/transaction-screening.md.

# Migrating to Quote v3

> What changed in POST /quote/v3 and how to upgrade from /quote, /quote/v2, /price, and /execute/permits.

[`POST /quote/v3`](https://docs.relay.link/references/api/get-quote-v3) is the latest version of the Quote API. It takes the same request as `/quote/v2` and returns a flatter, stricter response: one step per action, the same fee structure as [`GET /requests/v3`](https://docs.relay.link/references/api/get-requests), and one error shape with a code on every error. This guide covers every change and how to upgrade.

`/quote/v3` replaces `POST /quote`, `POST /quote/v2`, and `POST /price`. Its signature steps post to `POST /execute/permits/v2`, which replaces `POST /execute/permits`. The old endpoints keep working during a deprecation window (see the [sunset timeline](#sunset-timeline) below).

The `v3` endpoint suffix is a platform API version. It does not mean a request uses a particular version of [Relay Protocol](https://docs.relay.link/references/protocol/overview.md).

> [!WARNING]
>
> `/quote/v3` requires authentication. Send an `x-api-key` header, or an [access token](https://docs.relay.link/references/api/api_guides/access-tokens.md) as `Authorization: Bearer <token>` from a browser or mobile client. Requests without either return `401` with `errorCode: "UNAUTHORIZED_QUOTE"`. See [API Keys](https://docs.relay.link/references/api/api-keys.md).

## Endpoints and successors

| Retiring endpoint | Successor | Notes |
| - | - | - |
| `POST /quote` | `POST /quote/v3` | Same request. Steps check status on `/intents/status/v3` instead of `/intents/status`. |
| `POST /quote/v2` | `POST /quote/v3` | Same request, minus the [removed parameters](#request-changes). |
| `POST /price` | `POST /quote/v3` with `indicativeQuote: true` | Returns no steps and saves no request, like `/price`. Requires an API key or access token. |
| `POST /execute/permits` | [`POST /execute/permits/v2`](https://docs.relay.link/references/api/execute-permits-v2) | Same request. Returns flat steps. `/quote/v3` signature steps already point to it. |
| `GET /intents/status` | [`GET /intents/status/v3`](https://docs.relay.link/references/api/get-intents-status-v3) | No API key needed. |
| `GET /intents/status/v2` | [`GET /intents/status/v3`](https://docs.relay.link/references/api/get-intents-status-v3) | No API key needed. |

## Sunset timeline

The endpoints above are **deprecated as of November 25, 2026**. They keep working, but migrate before they're fully retired on **February 23, 2027**. All six endpoints retire together.

| Date | What changes |
| - | - |
| **Nov 25, 2026** | The retiring endpoints are deprecated; `/quote/v3`, `/execute/permits/v2`, and `/intents/status/v3` are the recommended versions. The old endpoints keep working. |
| **Jan 9, 2027 onward** | Relay reduces the rate limits of the retiring endpoints in stages; requests over the limit receive `429`. The successors are not affected. |
| **Feb 23, 2027** | The retiring endpoints are fully retired — all traffic must be on the successors. |

## Detecting deprecation programmatically

Every response from a retiring endpoint carries in-band deprecation signals, so clients can surface or log the sunset timeline without hard-coding dates.

* **`Deprecation`** header — RFC 9745 date, e.g. `@1795564800`.
* **`Sunset`** header — HTTP-date, e.g. `Tue, 23 Feb 2027 00:00:00 GMT`.
* **`Link`** header — three lines with `rel="deprecation"`, `rel="sunset"`, and `rel="successor-version"`, pointing to this guide and to the endpoint's successor.

For `POST /quote/v2`, the headers look like this:

```http theme={null}
Deprecation: @1795564800
Sunset: Tue, 23 Feb 2027 00:00:00 GMT
Link: <https://docs.relay.link/references/api/api_guides/migrating-to-quote-v3>; rel="deprecation"; type="text/html"
Link: <https://docs.relay.link/references/api/api_guides/migrating-to-quote-v3>; rel="sunset"; type="text/html"
Link: <https://api.relay.link/quote/v3>; rel="successor-version"
```

These headers are attached to every response from a retiring endpoint (`2xx`, `4xx`, and `5xx`) and are listed in `Access-Control-Expose-Headers`, so browser clients using `fetch` or `XMLHttpRequest` can read them cross-origin:

```javascript theme={null}
const res = await fetch("https://api.relay.link/quote/v2", { method: "POST", body })
const sunset = res.headers.get("sunset")
const deprecation = res.headers.get("deprecation")
```

Successful (`200`) responses also include a top-level `deprecation` object:

```json theme={null}
"deprecation": {
  "message": "POST /quote/v2 is deprecated. Migrate to POST /quote/v3. Relay reduces the POST /quote/v2 rate limit in stages from January 9, 2027. Relay retires POST /quote/v2 on February 23, 2027.",
  "deprecatedAt": "2026-11-25T00:00:00Z",
  "throttledFrom": "2027-01-09T00:00:00Z",
  "sunsetAt": "2027-02-23T00:00:00Z",
  "successor": "https://api.relay.link/quote/v3",
  "migrationGuide": "https://docs.relay.link/references/api/api_guides/migrating-to-quote-v3"
}
```

Once rate limits are reduced, `429` responses from a retiring endpoint return a route-specific body with the same `successor` and `migrationGuide` links. For guidance on reducing your request volume, see [Handling Rate Limits](https://docs.relay.link/references/api/api_core_concepts/handling-rate-limits.md).

## Migration checklist

1. Send `x-api-key` (server) or an access token (client) on every `/quote/v3` call.
2. Stop sending `useExternalLiquidity`, `useFallbacks`, `protocolVersion`, `useRebalancer`, and `userOperationGasOverhead`. `/quote/v3` rejects them.
3. Send `"platform"` instead of `"relay"` in `sponsoredFeeComponents`, and include `fee` in every `appFees` item.
4. Read `status`, `data`, and `check` from the step itself instead of from `step.items[]`.
5. Match step ids `approve` and `authorize` instead of `approval`, `authorize1`, and `authorize2`.
6. Read fees from the new `fees` object and origin gas from `originGas`, and allow `amountUsd` to be `null`.
7. Read `step.depositAddress` as an object.
8. Handle errors by `errorCode`, and check `warnings` when you send `fixedRate`.
9. Poll status on `/intents/status/v3` and post signatures to `/execute/permits/v2`, following the endpoints in each step.

## Request changes

> [accordion] Authentication
>
> ```bash theme={null}
> POST /quote/v3
> Headers:
> x-api-key: <your-api-key>        # required, or Authorization: Bearer <access-token> [!code ++]
> ```
>
> `/quote/v2` accepted keyless requests. `/quote/v3` checks authentication before it validates the body, so a request without a key or token returns `401` with `errorCode: "UNAUTHORIZED_QUOTE"` whatever its body.

> [accordion] Removed parameters
>
> `/quote/v3` rejects parameters it does not know, where `/quote/v2` ignored them. Sending any of these returns `400` with `errorCode: "INVALID_REQUEST_PARAMS"`, so remove them before you switch:
>
> * `useExternalLiquidity` and `useFallbacks` — deprecated routing flags.
> * `protocolVersion` — obsolete. `/quote/v2` accepts it but no longer uses it.
> * `useRebalancer` and `userOperationGasOverhead` — not part of the public request.
>
> Misspelled parameters, and any other field `/quote/v2` silently ignored, such as `source`, fail the same way.
>
> **Array items.** Each item in `txs` must include `to`, `data`, and `value`; `originalTxValue` stays optional. Each item in `appFees` must include `fee`.
>
> Every other `/quote/v2` parameter is still accepted, including `indicativeQuote`, `usePermit`, `useDepositAddress`, `subsidizeFees`, `sponsoredFeeComponents`, `preferredSolverFillCurrency`, and `preferredSolverDepositCurrency`. As in v2, values that convert to the right type are accepted, such as `"8453"` for `originChainId`.
>
> Validation errors name the field, including nested paths, e.g. `body/usePermit should be boolean`.
>
> Send the body as JSON with `Content-Type: application/json`. A request with an unsupported content type returns `415` with `errorCode: "INVALID_REQUEST_PARAMS"`.

> [accordion] Sponsorship parameters
>
> `/quote/v3` validates the [Fee Sponsorship](https://docs.relay.link/features/fee-sponsorship.md) parameters before quoting:
>
> * `maxSubsidizationAmount` must be a nonnegative integer string, such as `"0"` or `"5000000"`. Other values return `400` with `errorCode: "INVALID_REQUEST_PARAMS"`.
> * `sponsoredFeeComponents` takes `execution`, `swap`, `platform`, `app`, and `rent`. Use `platform` for the Relay fee: the legacy name `relay` returns `400` with `errorCode: "INVALID_REQUEST_PARAMS"`. When omitted, it defaults to `execution`, `swap`, `platform`, and `app`.
> * `maxSubsidizationAmount` and `subsidizeRent: true` now require `subsidizeFees: true`, like `subsidizationBps` and `sponsoredFeeComponents`. `/quote/v2` ignored them without it; `/quote/v3` returns `400` with `errorCode: "INVALID_REQUEST_PARAMS"`. `subsidizeRent: false` is still allowed.
>
> Sponsorship stays best effort. When a requested sponsorship can't apply, for example when the sponsor wallet is underfunded, the quote still returns `200` with user-paid fees. Check `fees.sponsored` and `feeSponsorship` to see what was sponsored.

## Response shape

The same bridge quote in v2 and v3, plus a focused diff of what moved. Values are abbreviated.

> [tab] v2
>
> ```json expandable theme={null}
> {
>   "requestId": "0x92b9...",
>   "steps": [
>     {
>       "id": "deposit",
>       "action": "Confirm transaction in your wallet",
>       "description": "Depositing funds to the relayer to execute the swap for ETH",
>       "kind": "transaction",
>       "requestId": "0x92b9...",
>       "items": [
>         {
>           "status": "incomplete",
>           "data": { "from": "0x0350...", "to": "0xa5f5...", "data": "0x...", "value": "1000000000000000000", "chainId": 8453 },
>           "check": { "endpoint": "/intents/status/v3?requestId=0x92b9...", "method": "GET" }
>         }
>       ]
>     }
>   ],
>   "fees": {
>     "gas": { "currency": { "chainId": 8453, "symbol": "ETH", "decimals": 18 }, "amount": "21000000000", "amountFormatted": "0.000000021", "amountUsd": "0.00007" },
>     "relayer": { "currency": { "chainId": 8453, "symbol": "ETH", "decimals": 18 }, "amount": "15000000000000", "amountUsd": "0.05" },
>     "relayerGas": { "amount": "5000000000000", "amountUsd": "0.02" },
>     "relayerService": { "amount": "10000000000000", "amountUsd": "0.03" },
>     "app": { "amount": "0", "amountUsd": "0" },
>     "subsidized": { "amount": "0", "amountUsd": "0" }
>   },
>   "details": {
>     "operation": "bridge",
>     "sender": "0x0350...",
>     "recipient": "0x0350...",
>     "currencyIn": { "currency": { "chainId": 8453, "symbol": "ETH", "decimals": 18 }, "amount": "1000000000000000000", "amountFormatted": "1.0", "amountUsd": "3300.00" },
>     "currencyOut": { "currency": { "chainId": 10, "symbol": "ETH", "decimals": 18 }, "amount": "999985000000000000", "amountFormatted": "0.999985", "amountUsd": "3299.95" },
>     "totalImpact": { "usd": "-0.05", "percent": "-0.00" },
>     "swapImpact": { "usd": "0", "percent": "0" },
>     "expandedPriceImpact": {
>       "swap": { "usd": "0" },
>       "execution": { "usd": "-0.02" },
>       "relay": { "usd": "-0.03" },
>       "app": { "usd": "0" },
>       "sponsored": { "usd": "0" }
>     },
>     "rate": "0.999985",
>     "timeEstimate": 2,
>     "userBalance": "5000000000000000000"
>   }
> }
> ```

> [tab] v3
>
> ```json expandable theme={null}
> {
>   "requestId": "0x92b9...",
>   "steps": [
>     {
>       "id": "deposit",
>       "action": "Confirm transaction in your wallet",
>       "description": "Depositing funds to the relayer to execute the swap for ETH",
>       "kind": "transaction",
>       "status": "incomplete",
>       "data": { "from": "0x0350...", "to": "0xa5f5...", "data": "0x...", "value": "1000000000000000000", "chainId": 8453 },
>       "check": { "endpoint": "/intents/status/v3?requestId=0x92b9...", "method": "GET" }
>     }
>   ],
>   "fees": {
>     "execution": { "usd": "-0.02", "amount": "5000000000000", "amountFormatted": "0.000005" },
>     "swap": { "usd": "0", "amount": "0", "amountFormatted": "0" },
>     "platform": { "usd": "-0.03", "amount": "10000000000000", "amountFormatted": "0.00001" },
>     "app": { "usd": "0", "amount": "0", "amountFormatted": "0" },
>     "sponsored": { "usd": "0", "amount": "0", "amountFormatted": "0" },
>     "currency": { "chainId": 8453, "address": "0x0000000000000000000000000000000000000000", "symbol": "ETH", "name": "Ether", "decimals": 18 }
>   },
>   "originGas": { "currency": { "chainId": 8453, "symbol": "ETH", "decimals": 18 }, "amount": "21000000000", "amountFormatted": "0.000000021", "amountUsd": "0.00007" },
>   "details": {
>     "operation": "bridge",
>     "sender": "0x0350...",
>     "recipient": "0x0350...",
>     "currencyIn": { "currency": { "chainId": 8453, "symbol": "ETH", "decimals": 18 }, "amount": "1000000000000000000", "amountFormatted": "1.0", "amountUsd": "3300.00" },
>     "currencyOut": { "currency": { "chainId": 10, "symbol": "ETH", "decimals": 18 }, "amount": "999985000000000000", "amountFormatted": "0.999985", "amountUsd": "3299.95" },
>     "totalImpact": { "usd": "-0.05", "percent": "-0.00" },
>     "swapImpact": { "usd": "0", "percent": "0" },
>     "rate": "0.999985",
>     "timeEstimate": 2,
>     "userBalance": "5000000000000000000"
>   }
> }
> ```

> [tab] Difference
>
> ```jsonc expandable theme={null}
> {
>   "requestId": "0x92b9...",                   // now always present
>   "steps": [
>     {
>       "id": "deposit",
>       "kind": "transaction",
>       "requestId": "0x92b9...",               // [!code --] use the top-level requestId
>       "items": [ { "status": "…", "data": {}, "check": {} } ], // [!code --]
>       "status": "incomplete",                 // [!code ++] moved up from items[]
>       "data": { },                            // [!code ++] moved up from items[]
>       "check": { "endpoint": "/intents/status/v3?requestId=0x92b9...", "method": "GET" } // [!code ++]
>     }
>   ],
>   "fees": { "gas": {}, "relayer": {}, "relayerGas": {}, "relayerService": {}, "app": {}, "subsidized": {} }, // [!code --]
>   "fees": {                                   // [!code ++] was details.expandedPriceImpact
>     "execution": {}, "swap": {}, "platform": {}, "app": {}, "sponsored": {}, // [!code ++]
>     "currency": { "symbol": "ETH", "decimals": 18 } // [!code ++]
>   },                                          // [!code ++]
>   "originGas": { "amount": "21000000000" },   // [!code ++] was fees.gas
>   "details": {
>     "expandedPriceImpact": { "relay": { "usd": "-0.03" } } // [!code --] moved to fees, relay renamed platform
>   }
> }
> ```

> [!NOTE]
>
> The full OpenAPI schema lives at [api.relay.link/documentation/json](https://api.relay.link/documentation/json).

> [!WARNING]
>
> **`fees` has changed meaning.** The key `fees` is reused for a different shape. In v2, `fees` held `gas`, `relayer`, `relayerGas`, `relayerService`, `app`, and `subsidized`. In v3, `fees` holds the breakdown v2 returned as `details.expandedPriceImpact`. Code reading `fees.relayer` or `fees.gas` will break.

## What changed

Every response change, in the order you are likely to hit it.

> [accordion] Steps are flat
>
> Each step carries `status`, `data`, and `check` directly. There is no `items` array: every v2 item becomes its own step, in the same order. Execute steps in array order.
>
> Steps no longer carry `requestId`. Use the top-level `requestId`.
>
> Step `id`s can repeat. For example, a quote that needs a pre-approval returns two `approve` steps, and the EIP-3009 permit flow returns two `authorize` steps.

> [accordion] Step ids
>
> | v2 `id` | v3 `id` |
> | - | - |
> | `approval` | `approve` |
> | `authorize1`, `authorize2` | `authorize` |
> | `deposit`, `approve`, `authorize`, `swap`, `send` | unchanged |
>
> Tell two steps with the same id apart by their position and `kind`, not by id.

> [accordion] Status checks and permit submission
>
> `check` is `{ endpoint, method: "GET" }`, and `endpoint` is `/intents/status/v3?requestId=<requestId>`. `/quote/v2` already pointed here; `/quote` pointed to `/intents/status`.
>
> Signature steps that post to `/execute/permits` in v2 post to `/execute/permits/v2` in v3 (`step.data.post.endpoint`). Other `post` endpoints are unchanged. See [Submitting permits](#submitting-permits).

> [accordion] Fees
>
> `fees` has the same structure as `data.fees.quoted` on [`GET /requests/v3`](https://docs.relay.link/references/api/get-requests). The values can differ for the same request: fees accumulated when the order is solved are not in the quote, and zero values are formatted differently. See [Fees in the API](https://docs.relay.link/references/api/api_core_concepts/fees.md#fees-in-the-api).
>
> | v3 field | v2 equivalent |
> | - | - |
> | `fees.execution` | `details.expandedPriceImpact.execution` |
> | `fees.swap` | `details.expandedPriceImpact.swap` |
> | `fees.platform` | `details.expandedPriceImpact.relay` |
> | `fees.app` | `details.expandedPriceImpact.app` (also replaces the legacy `fees.app`) |
> | `fees.sponsored` | `details.expandedPriceImpact.sponsored` |
> | `fees.currency` | none — the currency of every `amount` above |
> | `originGas` | `fees.gas` |
> | removed | `fees.relayer`, `fees.relayerGas`, `fees.relayerService`, `fees.subsidized` |
>
> Each component is `{ usd, amount, amountFormatted }`, and all five are always present, as `"0"` when there is no fee. Costs have a negative `usd`; `sponsored` is positive.
>
> For a same-chain swap the wallet executes itself, no solver executes anything, so `fees.execution` is `"0"` and sponsorship never covers execution.

> [accordion] Origin gas
>
> `originGas` is the estimated gas the wallet pays on the origin chain, including required approvals. It is a currency amount: `{ currency, amount, amountFormatted, amountUsd }`. Like every currency amount in v3, `amountUsd` is `null` when Relay has no USD price for the currency.
>
> It is not part of `fees.execution`, because the user pays it to the network. `originGas` is omitted when it is zero, and when the solver pays origin gas through execution fees, as in [gasless execution](https://docs.relay.link/features/gasless-execution.md).

> [accordion] Fee sponsorship
>
> `feeSponsorship` now uses the [`GET /requests/v3`](https://docs.relay.link/references/api/get-requests) shape:
>
> * The `relay` component is named `platform`, in both `selectedComponents` and `components`.
> * The currency moves to one `feeSponsorship.currency`. Amounts inside `components`, `sponsoredTotal`, and `userPaysTotal` no longer repeat it.
>
> The request parameter `sponsoredFeeComponents` uses the same name: send `"platform"`, because `"relay"` returns `400`. See [Sponsorship parameters](#request-changes) and [Fee Sponsorship](https://docs.relay.link/features/fee-sponsorship.md).

> [accordion] Deposit addresses
>
> With `useDepositAddress: true`, `step.depositAddress` is an object instead of a string:
>
> ```json theme={null}
> "depositAddress": {
>   "address": "0x...",
>   "type": "open",
>   "depositor": null,
>   "depositTxHash": null,
>   "recoveryAddress": null
> }
> ```
>
> `type` is `strict` or `open`. This is the same object `GET /requests/v3` returns. See [Deposit Addresses](https://docs.relay.link/features/deposit-addresses.md).

> [accordion] Required fields
>
> `requestId`, `steps`, `fees`, and `details` are always present on a `200`. Each step always has `id`, `action`, `description`, `kind`, and `status`.
>
> `details` keeps every v2 field except `expandedPriceImpact`. `details.rate` and `details.userBalance` are always strings, and EVM addresses in `details.sender` and `details.recipient` are lowercase.
>
> `amountUsd` can be `null` in `details.currencyIn`, `details.currencyOut`, `details.refundCurrency`, `details.currencyGasTopup`, the `details.route` currencies, and `originGas`, when Relay has no USD price for the currency. Treat it as unknown rather than zero.

> [accordion] Warnings
>
> A successful quote can include a top-level `warnings` array of `{ code, message }` objects. It is omitted when there is nothing to report.
>
> ```json theme={null}
> "warnings": [
>   {
>     "code": "FIXED_RATE_NOT_APPLIED",
>     "message": "fixedRate was not applied to this quote."
>   }
> ]
> ```
>
> The only code today is `FIXED_RATE_NOT_APPLIED`: you sent `fixedRate` (as `input:output`, e.g. `"1:0.9996"`), but the quote is not priced at that rate. The quote still succeeds, and `details.isFixedRate` does not tell you whether your rate was applied, so check `warnings`. More codes may be added; ignore codes you don't recognize. `/quote/v2` returns the same field.

> [accordion] Errors
>
> Every error, on every status code (`400`, `401`, `403`, `415`, `429`, `500`, `503`), has one shape:
>
> ```json theme={null}
> { "message": "…", "errorCode": "INVALID_REQUEST_PARAMS", "requestId": "0x…" }
> ```
>
> `errorCode` is always set. `requestId` is set when the error happened after a request id was assigned. When no specific code applies, `401` returns `UNAUTHORIZED_QUOTE`, `403` returns `FORBIDDEN`, `429` returns `RATE_LIMITED`, `503` returns `SERVICE_UNAVAILABLE`, other `4xx` return `INVALID_REQUEST_PARAMS`, and other `5xx` return `UNKNOWN_ERROR`. `5xx` errors carry a generic `message`, so rely on `errorCode`.
>
> The `400` fields `errorData`, `approxSimulatedBlock`, and `failedCallData` are no longer returned. See [Handling Errors](https://docs.relay.link/references/api/api_core_concepts/handling-errors.md).

## Executing v3 steps

The loop is the same as before, one level shallower: read each step's `kind` and `data`, act on it, and follow the endpoints the step gives you. Steps already marked `complete` need no action. The example below uses viem with a browser wallet. It stops on any error response, switches the wallet to each transaction step's chain, and reads the receipt from that chain.

```typescript expandable theme={null}
import { createPublicClient, createWalletClient, custom, http } from "viem"
import * as chains from "viem/chains"

const chainById = (id) => Object.values(chains).find((chain) => chain.id === id)

// Calls the Relay API and stops on an error response, such as a rejected quote or permit
async function relay(path, body) {
  const res = await fetch(`https://api.relay.link${path}`, {
    method: "POST",
    // In the browser, authenticate with an access token minted by your backend
    headers: { "content-type": "application/json", authorization: `Bearer ${ACCESS_TOKEN}` },
    body: JSON.stringify(body),
  })
  const json = await res.json()
  if (!res.ok) throw new Error(`${json.errorCode}: ${json.message}`)
  return json
}

const [account] = await window.ethereum.request({ method: "eth_requestAccounts" })
const walletClient = createWalletClient({ account, transport: custom(window.ethereum) })

const quote = await relay("/quote/v3", {
  user: account,
  recipient: account,
  originChainId: 8453,
  destinationChainId: 10,
  originCurrency: "0x0000000000000000000000000000000000000000",
  destinationCurrency: "0x0000000000000000000000000000000000000000",
  amount: "1000000000000000000",
  tradeType: "EXACT_INPUT",
})

const steps = [...quote.steps]
for (let i = 0; i < steps.length; i++) {
  const step = steps[i]
  if (step.status === "complete") continue

  if (step.kind === "signature") {
    // 1. Sign, then post the signature where the step says
    const { sign, post } = step.data
    const signature =
      sign.signatureKind === "eip191"
        ? await walletClient.signMessage({ message: sign.message })
        : await walletClient.signTypedData({
            domain: sign.domain,
            types: sign.types,
            primaryType: sign.primaryType,
            message: sign.value,
          })
    const result = await relay(`${post.endpoint}?signature=${signature}`, post.body)
    // 2. Run any steps the permit returns next, before the remaining quote steps
    if (result.steps) steps.splice(i + 1, 0, ...result.steps)
  } else {
    // 3. Send the transaction on the step's chain and wait for it to confirm
    const { to, data, value, gas, chainId } = step.data
    const chain = chainById(chainId)
    if ((await walletClient.getChainId()) !== chainId) {
      await walletClient.switchChain({ id: chainId })
    }
    const hash = await walletClient.sendTransaction({
      chain,
      to,
      data,
      value: BigInt(value),
      gas: gas ? BigInt(gas) : undefined,
    })
    const publicClient = createPublicClient({ chain, transport: http() })
    const receipt = await publicClient.waitForTransactionReceipt({ hash })
    if (receipt.status !== "success") throw new Error(`Step ${step.id} reverted`)
  }
}

// 4. Poll status
const status = await fetch(
  `https://api.relay.link/intents/status/v3?requestId=${quote.requestId}`
).then((res) => res.json())
```

For the full lifecycle, including polling intervals and terminal states, see [Step Execution](https://docs.relay.link/references/api/api_core_concepts/step-execution.md).

## Migrating from `/price`

Send the same request to `/quote/v3` with `indicativeQuote: true`. Like `/price`, an indicative quote returns no executable steps and saves no request.

```json theme={null}
{
  "user": "0x0350...",
  "originChainId": 8453,
  "destinationChainId": 10,
  "originCurrency": "0x0000000000000000000000000000000000000000",
  "destinationCurrency": "0x0000000000000000000000000000000000000000",
  "amount": "1000000000000000000",
  "tradeType": "EXACT_INPUT",
  "indicativeQuote": true
}
```

The response has `steps: []`, no `protocol` object, and the v3 `fees`, `originGas`, and `details` described above. It includes a `requestId`, but the request is not saved, so you cannot execute or track it. Request an executable quote when the user is ready to proceed.

`/price` accepted keyless requests. `/quote/v3` needs an API key on your server, or an [access token](https://docs.relay.link/references/api/api_guides/access-tokens.md) from a browser or mobile client.

## Submitting permits

[`POST /execute/permits/v2`](https://docs.relay.link/references/api/execute-permits-v2) takes the same request as `/execute/permits`: the `kind`, `requestId`, and `api` from the signature step's `post.body`, and the signature in the `signature` query parameter. You do not build this call yourself: `/quote/v3` signature steps already point to it.

The response is `{ message, steps? }`. When the permit starts a transaction the wallet must send, such as the swap in a same-chain permit swap, `steps` holds that step in the v3 flat shape. Its `data` includes `gas` and either `maxFeePerGas` and `maxPriorityFeePerGas` or `gasPrice`, and its `check` points to `/intents/status/v3`. Run it before the remaining quote steps.

`api` is required when `kind` is `permit2` or `eip3009`; the step's `post.body` already includes it. A signature that can't be verified returns `400` with `errorCode: "INVALID_SIGNATURE"`.

Errors follow the v3 shape. `4xx` errors can include an `errorData` object, such as the `required` and `available` amounts for an allowance or balance error.

`/quote` and `/quote/v2` steps keep posting to `/execute/permits` until those endpoints retire.

## Status polling

Poll [`GET /intents/status/v3`](https://docs.relay.link/references/api/get-intents-status-v3) with the quote's `requestId`. It needs no API key, so browser clients can poll it directly.

If you call `/quote` today, your steps point to `GET /intents/status`. If you call `/intents/status` or `/intents/status/v2` yourself, switch to `/intents/status/v3`; both are retiring (see the [sunset timeline](#sunset-timeline)).

## Upgrading RelayKit

RelayKit quotes with `/quote/v3` starting with these releases, published on November 24, 2026. Earlier versions call `/quote/v2`, so upgrade before it retires.

| Package | Version |
| - | - |
| `@relayprotocol/relay-sdk` | 9.0.0 |
| `@relayprotocol/relay-kit-hooks` | 7.0.0 |
| `@relayprotocol/relay-kit-ui` | 13.0.0 |

`executeSteps` in `@relayprotocol/relay-sdk` 8.1.0 and later already runs flat v3 steps, so step execution keeps working if you fetch `/quote/v3` yourself before upgrading.

### Authentication

`/quote/v3` requires an API key, so every RelayKit setup needs one:

* **Server side:** pass `apiKey` to `createClient`. `getQuote` and `useQuote` send it when `baseApiUrl` is the Relay API.
* **Browser:** point `baseApiUrl` at a proxy on your backend that adds `x-api-key`, as the UI kit already requires for `GET /requests/v3`. Make sure the proxy forwards `/quote/v3` and `/execute/permits/v2`.

Without a key, quotes fail with `401` and `errorCode: "UNAUTHORIZED_QUOTE"`. The SDK's `APIError.statusCode` now reports that `401`.

### SDK

* `getQuote` returns a `Quote` with flat steps. Read `quote.steps[i].data` instead of `quote.steps[i].items[0].data`, and `quote.requestId` instead of `steps[0].requestId`.
* `execute` and `executeGaslessBatch` take a `Quote`. `onProgress` and the result of `execute` still report steps with `items`. To convert a quote's steps to that shape yourself, call `normalizeSteps(quote.steps, quote.requestId)`.
* `QuoteBody` follows the [request changes](#request-changes): remove `useExternalLiquidity`, `useFallbacks`, and any other extra field such as `source`, and use `platform` in `sponsoredFeeComponents`.
* `Execute` follows the [response changes](#what-changed): `fees` is the v3 breakdown, `originGas` replaces `fees.gas`, `depositAddress` is an object, `QuoteStepId` uses `approve` and `authorize`, and `warnings` and `protocol` are added.

### Hooks

`useQuote` and `queryQuote` call `/quote/v3`, and `QuoteResponse` is now `Quote`, with the flat steps described above. `executeQuote` works as before. The other hooks are unchanged.

### UI kit

* **SwapWidget:** existing props keep working. `onSwapValidating`, `onSwapSuccess`, and `onSwapError` still receive an `Execute` with `items` steps, but its `fees`, `originGas`, `depositAddress`, and `warnings` follow v3. Update any callback code that reads `fees.relayer`, `fees.gas`, or `depositAddress` as a string.
* **OnrampWidget:** `onSuccess` and `onError` now receive a `Quote` instead of an `Execute`.
* **`refundTo` prop:** `SwapWidget` and `OnrampWidget` accept an optional `refundTo` address, which they pass to `/quote/v3`. Set it if you support deposit-address routes that need a destination swap; without it, those quotes fail with `refundTo is required for deposit addresses that require a destination swap`.
* **RelayKitProvider:** set `baseApiUrl` to your proxy, as described in [Authentication](#authentication). The provider warns when `baseApiUrl` points directly at the Relay API.


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