Skip to main content
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

Quick Comparison

FeatureEOASmart AccountEIP-7702
Wallet supportAll walletsSmart accounts onlyEmbedded wallets
fundingTokensRequiredNot neededNot needed
Signatures1 per tokenAlways 1Always 1
Gas paymentSame-chain onlyAny chainAny chain
First-time setupNoneAccount deployAuthorization

Basic Structure

All quote requests share this structure:
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:
Token swaps (same-chain or cross-chain):
{
  type: '/instructions/intent-simple',
  data: {
    srcChainId: 8453,
    dstChainId: 10,
    srcToken: '0x833589...',
    dstToken: '0x94b008...',
    amount: '100000000',
    slippage: 0.01
  }
}

Response Structure

{
  "ownerAddress": "0x...",
  "fee": {
    "amount": "50000",
    "token": "0x...",
    "chainId": 8453
  },
  "quoteType": "simple",
  "payloadToSign": [{ /* sign this */ }],
  "returnedData": [{
    "outputAmount": "99500000",
    "minOutputAmount": "98505000",
    "route": { "summary": "lifi => across" }
  }]
}
FieldDescription
feeGas cost in the specified token
quoteTypeHow to sign: simple, permit, or onchain
payloadToSignData user needs to sign
returnedDataExpected outputs and routing info

Validate Before Signing

Always check the quote before asking user to sign:
// 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