Skip to content
Fourohtwo

api.chainmarket-api.workers.dev/api/crypto/swap-to-usdc

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 (inv

BaseSolanaArcPolygonArbitrumWorld Chain+1Answering
GEThttps://api.chainmarket-api.workers.dev/api/crypto/swap-to-usdc

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://api.chainmarket-api.workers.dev/api/crypto/swap-to-usdc?amount=0.001&chain=base&sellToken=ETH&taker=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
console.log(await res.json());

Example input

{
  "amount": "0.001",
  "chain": "base",
  "sellToken": "ETH",
  "taker": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}

More from SiteCheck Crypto & FinanceProvider status