← Cookbook

✅ runnablePython ✓TypeScript ✓

Recipe 01 — Get a price quote (1-chain)

Status: ✅ runnable SDK surface: client.swap.quote(...) Server endpoint: POST /v1/swap/quote TZ reference: TZ-1 §13.2 (EVM adapter), TZ-3 §3.4 (fee recipient)

What this recipe does

Fetches a price quote for swapping 1 USDC → USDT on Ethereum mainnet using the 1inch v6 aggregator. No transaction is broadcast; this is a read-only estimate suitable for displaying in UI before the user commits to execute.

Prerequisites

Run

# Python
PYTHONPATH=packages/sdk-py/src python cookbook/recipes/01-price-quote/python_example.py

# TypeScript
npx tsx cookbook/recipes/01-price-quote/typescript_example.ts

Expected output

quote.intent_id      = q_01HZ...
quote.estimated_out  = 0.9995 USDT
quote.fee_bps        = 15
quote.expires_at     = 2026-05-12T00:00:30Z

The quote expires 30 seconds after issuance (Phase 4-G quote_ttl_s=30 in adapters/bridge.py). Pass quote.intent_id to client.swap.execute(...) (see recipe 02) before that deadline to commit the swap.

What to read next

Source: cookbook/recipes/01-price-quote/README.md