# Request a quote

## POST /api/quote/{apiKey}

> Request a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.

```json
{"openapi":"3.0.3","info":{"title":"@aurora-is-near/intents-fee-service","version":"0.0.1"},"servers":[{"url":"https://intents-api.aurora.dev"}],"security":[],"paths":{"/api/quote/{apiKey}":{"post":{"tags":["quote"],"description":"Request a swap quote based on input parameters such as the assets, amount, slippage tolerance, and recipient/refund information.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dry":{"type":"boolean","description":"Flag indicating whether this is a dry run request.\n\nIf `true`, the response will NOT contain the following fields:\n\n- `depositAddress`\n\n- `timeWhenInactive`\n\n- `deadline`"},"swapType":{"type":"string","enum":["EXACT_INPUT","EXACT_OUTPUT","FLEX_INPUT","ANY_INPUT"],"description":"How to interpret `amount` (and refunds) when performing the swap:\n\n- `EXACT_INPUT` — requests the output amount for an exact input.\n\n  - If deposit is less than `amountIn`, the deposit is refunded by deadline.\n\n  - If deposit is above than `amountIn`, the swap is processed and the excess is refunded to refundTo address after swap is complete.\n\n- `EXACT_OUTPUT` — requests the input amount for an exact output.\n\n  - The quote response includes `minAmountIn` and `maxAmountIn`.\n\n  - If the input is above `maxAmountIn`, the swap is processed and the excess is refunded to `refundTo` after the swap is complete.\n\n  - If the input is below `minAmountIn`, the deposit is refunded by deadline.\n\n- `FLEX_INPUT` — a flexible input amount that allows for partial deposits and variable amounts.\n\n  - `slippage` applies both to `amountOut` and `amountIn` and defines an acceptable range (`minAmountIn` and `minAmountOut`).\n\n  - Any amount higher than `minAmountIn` is accepted and converted to the output asset as long as `minAmountOut` is met.\n\n  - `amountIn` can be less, as long as the 'slippage + 1%' constraint is met. If the total received by the deadline is below the lower bound, the deposit is refunded.\n\n  - If deposits exceed the upper bound, the swap is still processed."},"depositType":{"type":"string","enum":["ORIGIN_CHAIN","INTENTS"],"description":"Type of deposit address:\n\n- `ORIGIN_CHAIN` - deposit address on the origin chain.\n\n- `INTENTS` - the account ID within NEAR Intents to which you should transfer assets."},"depositMode":{"description":"What deposit address mode you will get in the response.\n\nMost chains support only `SIMPLE`, and some (for example `stellar`) only `MEMO`:\n\n- `SIMPLE` - usual deposit with only a deposit address.\n\n- `MEMO` - some chains require the `memo` together with `depositAddress` for the swap to work.","type":"string","enum":["SIMPLE","MEMO"]},"quoteWaitingTimeMs":{"description":"Time in milliseconds the user is willing to wait for a quote from the relay.\n\nUse `0` to request the fastest available quote.","type":"number"},"sessionId":{"description":"Unique client session identifier.","type":"string"},"amount":{"type":"string","description":"Amount to swap as the base amount, in the smallest unit of the currency. It is interpreted as input or output based on `swapType`."},"originAsset":{"type":"string","description":"ID of the origin asset."},"destinationAsset":{"type":"string","description":"ID of the destination asset."},"slippageTolerance":{"type":"number","description":"Slippage tolerance for the swap in basis points (1/100th of a percent), e.g. 100 for 1%."},"refundTo":{"type":"string","description":"Address used for refunds."},"refundType":{"type":"string","enum":["ORIGIN_CHAIN","INTENTS"],"description":"Type of refund address:\n\n- `ORIGIN_CHAIN` - assets are refunded to the `refundTo` address on the origin chain.\n\n- `INTENTS` - assets are refunded to the `refundTo` Intents account."},"recipient":{"type":"string","description":"Recipient address. The format must match `recipientType`."},"recipientType":{"type":"string","enum":["DESTINATION_CHAIN","INTENTS"],"description":"Type of recipient address:\n\n- `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`.\n\n- `INTENTS` - assets are transferred to an account inside Intents."},"virtualChainRecipient":{"description":"EVM address of a transfer recipient in a virtual chain","type":"string"},"virtualChainRefundRecipient":{"description":"EVM address of a refund recipient in a virtual chain","type":"string"},"deadline":{"description":"Timestamp in ISO format indicating when refunds begin if the swap is not completed by then. If omitted, a default deadline is applied.","type":"string"},"connectedWallets":{"description":"Addresses of connected wallets.","type":"array","items":{"type":"string"}}},"required":["dry","swapType","depositType","amount","originAsset","destinationAsset","slippageTolerance","refundTo","refundType","recipient","recipientType"]}}},"required":true},"parameters":[{"schema":{"type":"string"},"in":"path","name":"apiKey","required":true,"description":"API key generated at [https://studio.aurora.dev](https://studio.aurora.dev)"}],"responses":{"200":{"description":"Quote successfully generated","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","description":"Timestamp in ISO format used to derive the deposit address for this quote."},"signature":{"type":"string","description":"1Click service signature confirming the quote for the specific deposit address."},"correlationId":{"type":"string","description":"Unique identifier for request tracing and debugging."},"quoteRequest":{"type":"object","properties":{"dry":{"type":"boolean","description":"Flag indicating whether this is a dry run request.\n\nIf `true`, the response will NOT contain the following fields:\n\n- `depositAddress`\n\n- `timeWhenInactive`\n\n- `deadline`"},"swapType":{"type":"string","enum":["EXACT_INPUT","EXACT_OUTPUT","FLEX_INPUT","ANY_INPUT"],"description":"How to interpret `amount` (and refunds) when performing the swap:\n\n- `EXACT_INPUT` — requests the output amount for an exact input.\n\n  - If deposit is less than `amountIn`, the deposit is refunded by deadline.\n\n  - If deposit is above than `amountIn`, the swap is processed and the excess is refunded to refundTo address after swap is complete.\n\n- `EXACT_OUTPUT` — requests the input amount for an exact output.\n\n  - The quote response includes `minAmountIn` and `maxAmountIn`.\n\n  - If the input is above `maxAmountIn`, the swap is processed and the excess is refunded to `refundTo` after the swap is complete.\n\n  - If the input is below `minAmountIn`, the deposit is refunded by deadline.\n\n- `FLEX_INPUT` — a flexible input amount that allows for partial deposits and variable amounts.\n\n  - `slippage` applies both to `amountOut` and `amountIn` and defines an acceptable range (`minAmountIn` and `minAmountOut`).\n\n  - Any amount higher than `minAmountIn` is accepted and converted to the output asset as long as `minAmountOut` is met.\n\n  - `amountIn` can be less, as long as the 'slippage + 1%' constraint is met. If the total received by the deadline is below the lower bound, the deposit is refunded.\n\n  - If deposits exceed the upper bound, the swap is still processed."},"depositType":{"type":"string","enum":["ORIGIN_CHAIN","INTENTS"],"description":"Type of deposit address:\n\n- `ORIGIN_CHAIN` - deposit address on the origin chain.\n\n- `INTENTS` - the account ID within NEAR Intents to which you should transfer assets."},"depositMode":{"description":"What deposit address mode you will get in the response.\n\nMost chains support only `SIMPLE`, and some (for example `stellar`) only `MEMO`:\n\n- `SIMPLE` - usual deposit with only a deposit address.\n\n- `MEMO` - some chains require the `memo` together with `depositAddress` for the swap to work.","type":"string","enum":["SIMPLE","MEMO"]},"quoteWaitingTimeMs":{"description":"Time in milliseconds the user is willing to wait for a quote from the relay.\n\nUse `0` to request the fastest available quote.","type":"number"},"sessionId":{"description":"Unique client session identifier.","type":"string"},"amount":{"type":"string","description":"Amount to swap as the base amount, in the smallest unit of the currency. It is interpreted as input or output based on `swapType`."},"originAsset":{"type":"string","description":"ID of the origin asset."},"destinationAsset":{"type":"string","description":"ID of the destination asset."},"slippageTolerance":{"type":"number","description":"Slippage tolerance for the swap in basis points (1/100th of a percent), e.g. 100 for 1%."},"refundTo":{"type":"string","description":"Address used for refunds."},"refundType":{"type":"string","enum":["ORIGIN_CHAIN","INTENTS"],"description":"Type of refund address:\n\n- `ORIGIN_CHAIN` - assets are refunded to the `refundTo` address on the origin chain.\n\n- `INTENTS` - assets are refunded to the `refundTo` Intents account."},"recipient":{"type":"string","description":"Recipient address. The format must match `recipientType`."},"recipientType":{"type":"string","enum":["DESTINATION_CHAIN","INTENTS"],"description":"Type of recipient address:\n\n- `DESTINATION_CHAIN` - assets are transferred to the chain of `destinationAsset`.\n\n- `INTENTS` - assets are transferred to an account inside Intents."},"virtualChainRecipient":{"description":"EVM address of a transfer recipient in a virtual chain.","type":"string"},"virtualChainRefundRecipient":{"description":"EVM address of a refund recipient in a virtual chain.","type":"string"},"deadline":{"type":"string","description":"Timestamp in ISO format indicating when refunds begin if the swap is not completed by then."},"connectedWallets":{"description":"Addresses of connected wallets.","type":"array","items":{"type":"string"}},"referral":{"description":"Referral identifier (lowercase only). It is reflected in on-chain data and public analytics platforms.","type":"string"},"appFees":{"description":"List of recipients and their fees.","type":"array","items":{"type":"object","properties":{"recipient":{"type":"string","description":"Fee recipient identifier or address."},"fee":{"type":"number","description":"Fee amount in basis points (1/100th of a percent)."}},"required":["recipient","fee"],"additionalProperties":false}},"customRecipientMsg":{"description":"HIGHLY EXPERIMENTAL: message to pass to `ft_transfer_call` when withdrawing assets to NEAR.\n\nOtherwise, `ft_transfer` will be used.\n\nWARNING: Funds can be lost if used with non NEP-141 tokens, with insufficient `storage_deposit`, or if the recipient does not implement `ft_on_transfer`.","type":"string"}},"required":["dry","swapType","depositType","amount","originAsset","destinationAsset","slippageTolerance","refundTo","refundType","recipient","recipientType","deadline"],"additionalProperties":false,"description":"User request payload."},"quote":{"type":"object","properties":{"timeEstimate":{"type":"number","description":"Estimated swap completion time in seconds."},"deadline":{"description":"Timestamp in ISO format indicating when the quote becomes inactive and refunds may begin.","type":"string"},"timeWhenInactive":{"description":"Timestamp in ISO format indicating when the deposit address becomes inactive.","type":"string"},"depositAddress":{"description":"Unique deposit address to which the origin asset must be transferred to initiate the swap.","type":"string"},"depositMemo":{"description":"Additional memo required together with `depositAddress` for memo-based deposit chains.","type":"string"},"amountIn":{"type":"string","description":"Input amount in the smallest unit of the origin asset."},"amountInFormatted":{"type":"string","description":"Human-readable formatted input amount."},"amountInUsd":{"type":"string","description":"Estimated USD value of the input amount."},"minAmountIn":{"type":"string","description":"Minimum accepted input amount for the quote."},"maxAmountIn":{"description":"Maximum accepted input amount for the quote, when applicable.","type":"string"},"amountOut":{"type":"string","description":"Expected output amount in the smallest unit of the destination asset."},"amountOutFormatted":{"type":"string","description":"Human-readable formatted output amount."},"amountOutUsd":{"type":"string","description":"Estimated USD value of the output amount."},"minAmountOut":{"type":"string","description":"Minimum guaranteed output amount for the quote."},"virtualChainRecipient":{"description":"EVM address of a transfer recipient in a virtual chain.","type":"string"},"virtualChainRefundRecipient":{"description":"EVM address of a refund recipient in a virtual chain.","type":"string"},"customRecipientMsg":{"description":"HIGHLY EXPERIMENTAL: message passed to `ft_transfer_call` when withdrawing assets to NEAR. Otherwise, `ft_transfer` is used.","type":"string"}},"required":["timeEstimate","amountIn","amountInFormatted","amountInUsd","minAmountIn","amountOut","amountOutFormatted","amountOutUsd","minAmountOut"],"additionalProperties":false,"description":"Quote details, including deposit instructions and expected swap amounts."}},"required":["timestamp","signature","correlationId","quoteRequest","quote"],"additionalProperties":false,"description":"Quote successfully generated"}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"message":{"type":"string","description":"Error message returned by the upstream quote API."},"correlationId":{"type":"string","description":"Unique identifier for request tracing and debugging."},"timestamp":{"type":"string","description":"Timestamp in ISO format when the error response was generated."},"path":{"type":"string","description":"API path associated with the failed request."}},"required":["message","correlationId","timestamp","path"],"additionalProperties":false,"description":"API error or fee configuration is invalid"},{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"statusCode":{"type":"number"}},"required":["message","statusCode"],"additionalProperties":false}]}}}},"404":{"description":"Application key is not assigned","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"statusCode":{"type":"number","enum":[404]}},"required":["message","statusCode"],"additionalProperties":false,"description":"Application key is not assigned"}}}},"500":{"description":"Internal Server Error - Failed to get a quote service or missing deposit address","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"error":{"type":"string"},"data":{"type":"object","additionalProperties":{}},"statusCode":{"type":"number","enum":[500]}},"required":["message","statusCode"],"additionalProperties":false,"description":"Internal Server Error - Failed to get a quote service or missing deposit address"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intents.aurora.dev/intents-deposits/api-reference/request-a-quote.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
