1gateway
Use when an agent needs a token's USD price without a third-party price feed. Input: tokens (up to 10, base:0x… or sol:<mint>). Output: per token priceUsd, confidence, the pool used (Uniswap v3 / Aerodrome on Base, Orca Whirlpool on Solana; fee tier, depth in USD), path (direct USDC or via WETH/SOL), warnings; no price below $1,000 depth. Spot, not TWAP. Example: ?tokens=base:0x940181a94A35A4569E4
- Price per call
- $0.003
- Chain
- Base
- Method
- GET
- Paid calls · 30 days
- 2
Call it from code
This API is run by its own provider and paid directly through x402. We list it so you can find it; we don't route or hold the payment.
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
const client = new x402Client();
registerExactEvmScheme(client, { signer: agentAccount });
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://1gateway.dev/v1/onchain/prices", { method: "GET" });
console.log(await res.json());https://1gateway.dev/v1/onchain/prices