Crypto Price Feed
A pay-per-call API that returns the current USD spot price for a crypto ticker. Payments are settled on Base mainnet via the x402 protocol using the PayAI facilitator.
Endpoint
GET https://v0-x402-endpoint.vercel.app/api/price?symbol=BTC- Price
- $0.005 USDC
- Network
- base (mainnet)
- Facilitator
- facilitator.payai.network
How a buyer agent calls it
First request returns 402 Payment Required with the payment requirements. The buyer signs a payment, retries with the X-PAYMENT header, the facilitator settles, and the response is returned.
// Using x402-fetch in a buyer agent
import { wrapFetchWithPayment } from "x402-fetch"
import { privateKeyToAccount } from "viem/accounts"
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)
const fetchWithPay = wrapFetchWithPayment(fetch, account)
const res = await fetchWithPay(
"https://v0-x402-endpoint.vercel.app/api/price?symbol=ETH",
{ method: "GET" }
)
const data = await res.json()
console.log(data)
// { symbol: "ETH", price_usd: 3421.55, timestamp: "...", source: "coinbase-spot" }Response shape
{
"symbol": "BTC",
"price_usd": 67890.12,
"timestamp": "2026-05-25T12:34:56.000Z",
"source": "coinbase-spot"
}