Skip to main content
In this section, you’ll learn how to request quotes for swapping between tokens using the Pods API.

Prerequisites

API Key

Get your API key for authentication at Pods

Token Addresses

Contract addresses for the tokens you want to swap

Chain IDs

Chain IDs for source and destination chains

Authentication

Include your API key in the x-api-key header

Overview

The Pods API supports both same-chain and cross-chain token swaps. The system automatically detects the swap type based on the chain IDs provided and routes to the appropriate provider.
Same-chain Swap: When originChain equals destinationChain Cross-chain Swap: When originChain differs from destinationChain

Getting a Quote

Endpoint

This is a v2 endpoint. Always use /v2/swap/quote for new integrations — it saves quotes to the database and returns a quoteId required by POST /v2/swap/bytecode.

Required Parameters

Optional Parameters

Either amountIn OR amountOut is required (not both). Use amountOut for exact output swaps (“I want to receive exactly X tokens”).
Provide either named chains (originChain + destinationChain) or numeric IDs (chainIdIn + chainIdOut). Responses always include canonical chainIdIn / chainIdOut on the quote when the API can resolve them; prefer these for storage and UI over string names or legacy fromChainId / toChainId.

Example Requests

Same-Chain Swap (Ethereum USDT to USDC)

Cross-Chain Swap (Ethereum to Polygon)

Same route using chain IDs

Cross-chain with a preferred provider

When several providers can quote the same route, pass preferredProvider to persist and return that provider’s quote (for example, to keep routing consistent with your UI or compliance rules):

Multi-route aggregation

For routes supported by more than one provider, the API requests quotes in parallel, ranks them by tokenOut.expectedAmountOut, and returns a single quote object — the best route by default, or the preferredProvider when set.
  • Only that quote is saved to the database. Use the quote quoteId (or the quote object’s id when present) with POST /v2/swap/bytecode.
  • Fixed-quote Pods bridge routes (pods provider) still use a single provider; preferredProvider must be pods or omitted on those paths.

Response Format

The API returns a JSON object with one persisted quote. When both originAddress and destinationAddress are supplied, the response also includes transaction bytecode fields (id, chainId, transactionData) — equivalent to calling POST /v2/swap/bytecode separately. The quote always includes a feeBreakdown object that itemizes platform fees (Pods fee, customer markup fee) and the estimated bridge/slippage impact:
Fee breakdown (feeBreakdown) is the canonical source for all quote fees on every route — platform fees (Pods, customer markup) and bridge/spread impact. It is returned on GET /v2/swap/quote only (not on GET /v2/swap/status/:id). Charge labels are in English; localize in your UI. The bridgeAndSlippage charge is signed — a negative amountRaw means favorable price impact vs spot. Platform fees (pods, customer) are deducted from tokenIn before the provider quote.

Response Fields

Unique identifier for this quote. Use this when executing the swap.
Canonical numeric chain IDs for the swap route (source → destination). Prefer these for new code; string originChain / destinationChain and legacy fromChainId / toChainId remain for compatibility.
Source and destination chain names (e.g., ethereum, polygon, arbitrum). These remain supported; numeric chainIdIn / chainIdOut are preferred for new integrations.
Complete token information including contract address, symbol, decimals, amount, and chain ID. tokenOut.expectedAmountOut and tokenOut.minAmountOut are the provider guarantees after platform fees are taken from the input.
Itemized costs: Pods fee, Customer fee, and Bridge fee + slippage (combined, signed on tokenOut). reference explains the spot baseline used for the bridge charge (source: spotUsdAtQuoteTime or unavailable). Zero fees use amountRaw "0" and amountInUSD 0.
Name of the swap provider used (e.g., 1inch, Jupiter, TeleSwap, Mayan, relay, lifi)
Quote expiration as a Unix timestamp in seconds. Execute the swap before this time.
Provider-specific quote data (stringified JSON). Some bridge providers require this for bytecode generation. This field is omitted from the response when null — only pass it to the bytecode endpoint when present.
Itemized cost breakdown for the swap. Always present on quote responses.
  • chargeableAmountInRaw — Full input amount subject to fees (string, smallest unit).
  • amountInAfterPlatformFeesRaw — Input amount after Pods + customer fees are deducted (string, smallest unit).
  • charges — Array of individual fee lines, each with kind (pods | customer | bridgeAndSlippage), label, amountRaw, decimals, symbol, asset (tokenIn | tokenOut), and amountInUSD.
Note: Some bridge routes may include a legacy top-level fees object in the API response for backward compatibility. Do not rely on it in new integrations — use feeBreakdown only.
  • reference — Spot-price reference output used to calculate bridge/slippage impact: amountOutRaw, source (spotUsdAtQuoteTime | unavailable), pricedAt (ISO 8601), tokenInPriceInUSD, tokenOutPriceInUSD, amountInAfterPlatformFeesRaw.
  • summary — Aggregated totals: platformFeesTotalInRaw, platformFeesTotalInUSD, bridgeAndSlippageImpactOutRaw, bridgeAndSlippageImpactOutUSD.

Supported Chains

Ethereum

ethereum
https://mintcdn.com/pods-322144f0/VaCfstjR8UDukAyQ/images/networks/base.svg?fit=max&auto=format&n=VaCfstjR8UDukAyQ&q=85&s=756b940eb5231e1cc1e73f57ce2404f2

Base

base
https://mintcdn.com/pods-322144f0/VaCfstjR8UDukAyQ/images/networks/optimism.svg?fit=max&auto=format&n=VaCfstjR8UDukAyQ&q=85&s=ebc2c01e20f0ea367f9f3a01ff78d388

Optimism

optimism
https://mintcdn.com/pods-322144f0/VaCfstjR8UDukAyQ/images/networks/arbitrum.svg?fit=max&auto=format&n=VaCfstjR8UDukAyQ&q=85&s=64fe30eadfd3165f4cf0a26a65a3983c

Arbitrum

arbitrum
https://mintcdn.com/pods-322144f0/Gg0nLDDM2P07rs2j/images/networks/solana.svg?fit=max&auto=format&n=Gg0nLDDM2P07rs2j&q=85&s=6877e57fdb7a0750b73dfd45cd0a20d2

Solana

solana
https://mintcdn.com/pods-322144f0/VaCfstjR8UDukAyQ/images/networks/polygon.svg?fit=max&auto=format&n=VaCfstjR8UDukAyQ&q=85&s=f07eb2cb5771381174b2457ccc35f430

Polygon

polygon
https://mintcdn.com/pods-322144f0/VaCfstjR8UDukAyQ/images/networks/gnosis.svg?fit=max&auto=format&n=VaCfstjR8UDukAyQ&q=85&s=1d3db921f11b6e2fcc8abf98a3f60539

Gnosis

gnosis
https://mintcdn.com/pods-322144f0/Gg0nLDDM2P07rs2j/images/networks/bitcoin.svg?fit=max&auto=format&n=Gg0nLDDM2P07rs2j&q=85&s=a99da267f35c620d61f14be441ddec86

Bitcoin

bitcoin
https://mintlify.s3.us-west-1.amazonaws.com/pods-322144f0/images/networks/hyperevm.svg

HyperEVM

hyperevm

Error Handling

The API returns appropriate error messages for:
  • Missing required parameters
  • Invalid chain names or token addresses
  • No available swap provider for the requested route
  • Invalid or ineligible preferredProvider (see Error Codes)
  • Provider-specific errors during quote generation
Example Error Response:
Quotes have an expiration time (typically 5 minutes). Make sure to execute the swap before the deadline timestamp.

Next Steps

Execute Swap

Use the quote to generate bytecode and execute the swap

API Reference

View detailed API documentation