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. Zero-value charge lines are omitted; use summary for aggregate totals that may be zero.
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.
Quote expiration as an ISO 8601 UTC string (e.g. 2024-01-20T12:30:00.000Z). Human-readable alternative to deadline.
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.

Supported Chains

Ethereum

ethereum

Base

base

Optimism

optimism

Arbitrum

arbitrum

Solana

solana

Polygon

polygon

Gnosis

gnosis

Bitcoin

bitcoin

HyperEVM

hyperevm

Monad

monad

Fiat

fiat (off-ramp/on-ramp routes)

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