{"slug":"api-chainmarket-api-workers-dev-api-crypto-swap-to-usdc-24733e","title":"Swap any token into USDC to pay x402 prices, on Base, Arbitrum, Polygon (0x) or ","host":"api.chainmarket-api.workers.dev","method":"GET","resource":"https://api.chainmarket-api.workers.dev/api/crypto/swap-to-usdc","category":"market","description":"Swap any token into USDC to pay x402 prices, on Base, Arbitrum, Polygon (0x) or Solana (Jupiter). Default: a ready-to-sign swap for your address (taker) with guaranteed minimum, approve step, fees and expiresAt; you sign it. mode=price: quote only, no taker. mode=wallet: your USDC and gas balances, ","price_listed":0.001,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":8,"reported_payers_30d":3,"networks":["eip155:10","eip155:137","eip155:42161","eip155:42220","eip155:480","eip155:5042","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","stellar:pubnet","xrpl:0"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"method":"GET","queryParams":{"amount":"0.001","chain":"base","sellToken":"ETH","taker":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"},"type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["GET"],"type":"string"},"queryParams":{"properties":{"amount":{"description":"Amount to sell in whole units, e.g. 0.001 (or give sellAmount)","type":"string"},"chain":{"description":"base, arbitrum, polygon or solana (default base)","type":"string"},"compare":{"description":"1 = also show KyberSwap's quote for the same sell (EVM chains)","type":"string"},"invoice":{"description":"mode=pay402: the PAYMENT-REQUIRED header (base64) of an x402 402 answer, or its JSON","type":"string"},"mode":{"description":"swap (default; needs sellToken, amount, taker), price (needs sellToken, amount), wallet (needs taker; optional needUsdc), pay402 (needs taker and invoice or payUrl)","type":"string"},"needUsdc":{"description":"mode=wallet: USDC you need to hold, e.g. 0.005","type":"string"},"payUrl":{"description":"mode=pay402: the https URL that answers 402 (read with a GET)","type":"string"},"sellAmount":{"description":"Amount to sell in the token's base units (wei, lamports), instead of amount","type":"string"},"sellToken":{"description":"Token to sell: contract address (Solana: mint), ETH/POL/SOL/native for the chain's coin, or WETH","type":"string"},"slippageBps":{"description":"Allowed slippage in basis points, 1 to 300 (default 50 = 0.5%)","type":"integer"},"taker":{"description":"Your wallet address that will sign and send the transaction (0x + 40 hex; Solana: base58 public key)","type":"string"}},"required":[],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Swap any token into USDC to pay x402 prices, on Base, Arbitrum, Polygon (0x) or Solana (Jupiter). Default: a ready-to-sign swap for your address (taker) with guaranteed minimum, approve step, fees and expiresAt; you sign it. mode=price: quote only, no taker. mode=wallet: your USDC and gas balances, and with needUsdc the swap that covers the gap. mode=pay402: give a 402 PAYMENT-REQUIRED header (invoice) or payUrl and get the swap for exactly what it asks. compare=1 adds KyberSwap's quote.","last_updated":"2026-11-26T10:41:45.281Z","schemes":["exact"]}