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

# Step 1: Get a Quote

> Request an execution quote for your transaction

The `/v1/quote` endpoint analyzes your transaction, finds optimal routes, calculates fees, and returns a payload for signing. The first step is choosing the right **mode** for your users.

## Choose Your Mode

<CardGroup cols={3}>
  <Card title="EOA" icon="wallet" href="/overview/supertransaction-api/quote-eoa">
    **MetaMask, Rabby, Trust**

    For standard wallets. Requires `fundingTokens`.
  </Card>

  <Card title="Smart Account" icon="shield-check" href="/overview/supertransaction-api/quote-smart-account">
    **Nexus, ERC-4337**

    Simplest setup. Native gas abstraction.
  </Card>

  <Card title="EIP-7702" icon="wand-magic-sparkles" href="/overview/supertransaction-api/quote-7702">
    **Privy, Dynamic, Turnkey**

    For embedded wallets with 7702 support.
  </Card>
</CardGroup>

## Quick Comparison

| Feature          | EOA             | Smart Account       | EIP-7702         |
| ---------------- | --------------- | ------------------- | ---------------- |
| Wallet support   | All wallets     | Smart accounts only | Embedded wallets |
| `fundingTokens`  | Required        | Not needed          | Not needed       |
| Signatures       | 1 per token     | Always 1            | Always 1         |
| Gas payment      | Same-chain only | Any chain           | Any chain        |
| First-time setup | None            | Account deploy      | Authorization    |

## Basic Structure

All quote requests share this structure:

```typescript theme={null}
const quote = await fetch('https://api.biconomy.io/v1/quote', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    mode: 'smart-account',        // or 'eoa', 'eoa-7702'
    ownerAddress: '0x...',
    composeFlows: [{              // Your operations
      type: '/instructions/intent-simple',
      data: { /* swap params */ }
    }],
    feeToken: { /* optional */ }  // Omit for sponsored (gasless)
  })
}).then(r => r.json());
```

## Understanding composeFlows

The `composeFlows` array defines what you want to do:

<Tabs>
  <Tab title="intent-simple">
    **Token swaps** (same-chain or cross-chain):

    ```typescript theme={null}
    {
      type: '/instructions/intent-simple',
      data: {
        srcChainId: 8453,
        dstChainId: 10,
        srcToken: '0x833589...',
        dstToken: '0x94b008...',
        amount: '100000000',
        slippage: 0.01
      }
    }
    ```
  </Tab>

  <Tab title="build">
    **Custom contract calls**:

    ```typescript theme={null}
    {
      type: '/instructions/build',
      data: {
        chainId: 8453,
        to: '0xContractAddress',
        functionSignature: 'function deposit(uint256 amount)',
        args: ['1000000000']
      }
    }
    ```
  </Tab>

  <Tab title="intent">
    **Complex multi-token operations**:

    ```typescript theme={null}
    {
      type: '/instructions/intent',
      data: {
        slippage: 0.01,
        inputPositions: [{ chainToken: {...}, amount: '...' }],
        targetPositions: [{ chainToken: {...}, weight: 1.0 }]
      }
    }
    ```
  </Tab>
</Tabs>

## Response Structure

```json theme={null}
{
  "ownerAddress": "0x...",
  "fee": {
    "amount": "50000",
    "token": "0x...",
    "chainId": 8453
  },
  "quoteType": "simple",
  "payloadToSign": [{ /* sign this */ }],
  "returnedData": [{
    "outputAmount": "99500000",
    "minOutputAmount": "98505000",
    "route": { "summary": "lifi => across" }
  }]
}
```

| Field           | Description                                   |
| --------------- | --------------------------------------------- |
| `fee`           | Gas cost in the specified token               |
| `quoteType`     | How to sign: `simple`, `permit`, or `onchain` |
| `payloadToSign` | Data user needs to sign                       |
| `returnedData`  | Expected outputs and routing info             |

## Validate Before Signing

Always check the quote before asking user to sign:

```typescript theme={null}
// Check fee is reasonable
const feeUsd = Number(quote.fee.amount) / 1e6;
if (feeUsd > 1.00) {
  throw new Error(`Fee too high: $${feeUsd}`);
}

// Check output meets minimum
const minOutput = quote.returnedData[0]?.minOutputAmount;
console.log(`User will receive at least ${minOutput}`);
```

## Next Steps

<CardGroup cols={2}>
  <Card title="EOA Mode" icon="wallet" href="/overview/supertransaction-api/quote-eoa">
    For MetaMask, Rabby, Trust users
  </Card>

  <Card title="Smart Account Mode" icon="shield-check" href="/overview/supertransaction-api/quote-smart-account">
    For Nexus smart account users
  </Card>

  <Card title="EIP-7702 Mode" icon="wand-magic-sparkles" href="/overview/supertransaction-api/quote-7702">
    For Privy, Dynamic, Turnkey users
  </Card>

  <Card title="Sign Payload →" icon="signature" href="/overview/supertransaction-api/sign-payload">
    After getting your quote
  </Card>
</CardGroup>
