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

# Get Quote

> Get pricing information for swaps and transfers with optional privacy protection

Get real-time pricing for token swaps and transfers. Quotes include price impact, fees, and slippage protection.

## Parameters

<ParamField query="inputAsset" type="string" required>
  Input asset symbol. Supported: `SOL`, `USDC`, `USDT`
</ParamField>

<ParamField query="outputAsset" type="string" required>
  Output asset symbol. Supported: `SOL`, `USDC`, `USDT`
</ParamField>

<ParamField query="amount" type="number" required>
  Input amount. Minimum: 0.001
</ParamField>

<ParamField query="mode" type="string" default="wallet">
  Execution mode: `wallet` (direct) or `private` (privacy-enhanced)
</ParamField>

<ParamField query="slippageBps" type="integer" default="100">
  Slippage tolerance in basis points (1-5000). 100 = 1%
</ParamField>

## Response

<ResponseField name="quoteId" type="string">
  Unique quote identifier for transaction submission
</ResponseField>

<ResponseField name="inputAsset" type="string">
  Input asset symbol
</ResponseField>

<ResponseField name="outputAsset" type="string">
  Output asset symbol
</ResponseField>

<ResponseField name="inputAmount" type="string">
  Input amount as string to preserve precision
</ResponseField>

<ResponseField name="outputAmount" type="string">
  Expected output amount
</ResponseField>

<ResponseField name="minOutputAmount" type="string">
  Minimum output amount after slippage protection
</ResponseField>

<ResponseField name="priceImpact" type="number">
  Price impact percentage (0.1 = 0.1%)
</ResponseField>

<ResponseField name="fee" type="string">
  Total fees (network + routing if applicable)
</ResponseField>

<ResponseField name="mode" type="string">
  Execution mode: `wallet` or `private`
</ResponseField>

<ResponseField name="expiresAt" type="string">
  Quote expiration timestamp (ISO 8601)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -G "https://api.unipay.com/v1/quote" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -d "inputAsset=SOL" \
    -d "outputAsset=USDC" \
    -d "amount=10" \
    -d "mode=private" \
    -d "slippageBps=100"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.unipay.com/v1/quote?' + new URLSearchParams({
    inputAsset: 'SOL',
    outputAsset: 'USDC', 
    amount: '10',
    mode: 'private',
    slippageBps: '100'
  }), {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const quote = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get('https://api.unipay.com/v1/quote', 
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
      'inputAsset': 'SOL',
      'outputAsset': 'USDC',
      'amount': 10,
      'mode': 'private',
      'slippageBps': 100
    }
  )

  quote = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "quoteId": "quote_1234567890abcdef",
    "inputAsset": "SOL",
    "outputAsset": "USDC", 
    "inputAmount": "10.0",
    "outputAmount": "1847.25",
    "minOutputAmount": "1828.78",
    "priceImpact": 0.15,
    "fee": "0.92",
    "mode": "private",
    "expiresAt": "2026-04-22T12:15:00Z"
  }
  ```
</ResponseExample>

## Quote Expiration

Quotes expire to protect against price volatility:

| Mode        | Expiration |
| ----------- | ---------- |
| **Wallet**  | 30 seconds |
| **Private** | 60 seconds |

## Price Impact

Large swaps may experience price impact:

| Swap Size    | Typical Impact |
| ------------ | -------------- |
| \< 10 SOL    | \< 0.1%        |
| 10-100 SOL   | 0.1-0.5%       |
| 100-1000 SOL | 0.5-2%         |
| > 1000 SOL   | > 2%           |

## Error Responses

<ResponseField name="error.code" type="string">
  Error code identifier
</ResponseField>

<ResponseField name="error.message" type="string">
  Human-readable error message
</ResponseField>

<ResponseField name="error.details" type="object">
  Additional error context
</ResponseField>

### Common Errors

| Code                     | Description                   |
| ------------------------ | ----------------------------- |
| `INVALID_ASSET`          | Unsupported asset symbol      |
| `AMOUNT_TOO_SMALL`       | Below minimum amount          |
| `INSUFFICIENT_LIQUIDITY` | Not enough liquidity for swap |
| `RATE_LIMIT_EXCEEDED`    | Too many requests             |
