██╗ ██╗██╗ ██╗ ██████╗ ██████╗ █████╗ ██████╗ ██╗ ╚██╗██╔╝██║ ██║██╔═══██╗╚════██╗ ██╔══██╗██╔══██╗██║ ╚███╔╝ ███████║██║ ██║ █████╔╝ ─── ███████║██████╔╝██║ ██╔██╗ ╚════██║██║ ██║██╔═══╝ ██╔══██║██╔═══╝ ██║ ██╔╝ ██╗ ██║╚██████╔╝███████╗ ██║ ██║██║ ██║ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
| Method | Endpoint | Price | Description | Data |
|---|---|---|---|---|
| GET | /api/price-feed | 0.001 USDC | BTC, ETH, SOL prices + top 5 movers/losers by 24h change. 60s server cache. | LIVE ✓ |
| GET | /api/gas-tracker | 0.001 USDC | Gas prices on Ethereum, Base, Polygon, Arbitrum — slow/normal/fast tiers + USD cost estimates. | LIVE ✓ |
| GET | /api/dex-quotes | 0.002 USDC | One live ParaSwap aggregate route. No independent venue comparison. ?from=ETH&to=USDC&amount=1 |
LIVE ✓ |
| GET | /api/token-scanner | 0.003 USDC | GoPlus ERC-20 flags and a disclosed heuristic score; missing fields are null. ?token=PEPE |
LIVE ✓ |
| GET | /api/whale-tracker | 0.005 USDC | GoPlus top-holder sample and reported supply share. Full distribution and transfers unavailable. ?token=ETH |
LIVE ✓ |
| GET | /api/yield-scanner | 0.005 USDC | DefiLlama pool APYs and TVL. Filter by chain, asset, TVL; no safety rating. | LIVE ✓ |
| GET | /api/funding-rates | 0.008 USDC | Hyperliquid and dYdX hourly rates with indicative spreads; fees and basis risk excluded. | LIVE ✓ |
| GET | /api/wallet-profiler | 0.008 USDC | Blockscout priced wallet balances or limited public RPC fallback; partial coverage disclosed. ?address=0x… |
LIVE ✓ |
| GET | /health | FREE | Server health check · returns status, uptime, pay-to address | FREE |
Use the included MCP client for Base USDC EIP-3009 payment with a 0.01 USDC default per-call cap. This server uses a JSON x402 v1 challenge; check other SDK versions before mainnet use.
# Install the MCP client and signing dependency npm install -g @x402-api/mcp-server viem # Set a dedicated Base wallet key with USDC export X402_WALLET_PRIVATE_KEY=0xYOUR_PRIVATE_KEY # Start MCP; default payment cap is 0.01 USDC per call x402-api-mcp # In your MCP-capable agent, call get_crypto_prices, scan_yields, etc. # The API must advertise EIP-3009 settlement.
# Step 1: Probe — get payment requirements (returns 402) curl -s https://x402-api.fly.dev/api/price-feed | jq . # Response: 402 Payment Required { "x402Version": 1, "error": "Payment Required", "accepts": [{ "scheme": "exact", "network": "base", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "payTo": "0x60264c480b67adb557efEd22Cf0e7ceA792DefB7", "maxAmountRequired": "1000" }] } # Step 2: Pay on-chain or sign EIP-3009 transferWithAuthorization # use a compatible client; do not submit raw txHash unless legacy proof is enabled # Step 3: Retry with X-Payment header (base64 JSON payload) curl -s https://x402-api.fly.dev/api/price-feed \ -H "X-Payment: <base64-encoded-payment-payload>" | jq .data.core # Response: 200 OK — live crypto prices [ { "id": "bitcoin", "price_usd": 98000, "change_24h_pct": 2.1 }, { "id": "ethereum", "price_usd": 2750, "change_24h_pct": -0.8 }, { "id": "solana", "price_usd": 185, "change_24h_pct": 4.2 } ]
import { x402ApiRequest } from '@x402-api/elizaos-plugin'; const config = { walletPrivateKey: process.env.X402_WALLET_PRIVATE_KEY }; const funding = await x402ApiRequest<{ arb_opportunities: Array<{ spread_bps: number }> }>('/api/funding-rates', { asset: 'ETH' }, config); const gas = await x402ApiRequest<{ data: Record<string, { gas_price_gwei: { normal: number | null } }> }>('/api/gas-tracker', {}, config); console.log('Indicative spread:', funding.arb_opportunities[0]?.spread_bps ?? 'none'); console.log('Arbitrum gas:', gas.data.arbitrum?.gas_price_gwei.normal ?? 'unavailable'); // Fees and basis risk are excluded. Total API charge: 0.009 USDC.
{
"x402Version": 1,
"error": "Payment Required",
"accepts": [{
"scheme": "exact",
"network": "base",
"asset": "0x833589fC...",
"payTo": "0x60264c48...",
"maxAmountRequired": "1000",
"extra": { "chainId": 8453 }
}]
}
{
"timestamp": "2026-02-22T09:35:00Z",
"source": "CoinGecko",
"payment": {
"verified": true,
"amount": "1000"
},
"data": {
"core": [
{ "id": "bitcoin",
"price_usd": 98000,
"change_24h_pct": 2.1 }
]
}
}