Skip to content

Get Quote

POST /api/v1/pay/quote

Quote endpoint — after the user selects a chain and token, check how much they need to pay.

  • Direct chain (same chain, same token): 1:1, no cross-chain quote needed
  • Cross-chain: fetches real-time exchange rate via CyberPay cross-chain routing

Request

{
  "pay_blockchain": "eth",
  "pay_token": "ETH",
  "settle_chain": "eip155:8453",
  "settle_token": "USDC",
  "settle_amount": "10000000"
}
FieldTypeDescription
pay_blockchainstringPayment chain (e.g. eth, base, ton)
pay_tokenstringPayment token symbol
settle_chainstringSettlement chain (CAIP-2, e.g. eip155:8453)
settle_tokenstringSettlement token
settle_amountstringSettlement amount (smallest unit)

Response — Direct

{
  "method": "Direct",
  "pay_amount": "10000000",
  "pay_amount_formatted": null,
  "pay_amount_usd": null,
  "receive_amount": "10000000",
  "receive_amount_formatted": null,
  "receive_amount_usd": null,
  "estimated_time": 5,
  "exchange_rate": "1",
  "slippage_bps": 0,
  "expires_at": "2026-03-23T12:30:00Z"
}

Response — CrossChain

{
  "method": "CrossChain",
  "pay_amount": "4200000000000000",
  "pay_amount_formatted": "0.0042",
  "pay_amount_usd": "10.50",
  "receive_amount": "10000000",
  "receive_amount_formatted": "10.00",
  "receive_amount_usd": "10.00",
  "estimated_time": 120,
  "exchange_rate": "2500.00",
  "slippage_bps": 50,
  "expires_at": "2026-03-23T12:30:00Z"
}
FieldTypeDescription
method"Direct" | "CrossChain"Routing method
pay_amountstring?Amount to pay (smallest unit)
pay_amount_formattedstring?Human-readable amount (available for cross-chain)
estimated_timeu32?Estimated settlement time in seconds
exchange_ratestring?Exchange rate
slippage_bpsu32Slippage (basis points, 50 = 0.5%)
expires_atstringQuote expiration time (ISO 8601)

Errors

{ "error": "Quote failed: insufficient liquidity" }

HTTP 502 — Cross-chain quote failed (route unavailable or insufficient liquidity).