Base gas price
ontarioprotocol.com/api/x402/base/gas
Base gas price: base fee, priority fee p25/p50/p90 over the last 20 blocks, ready-to-sign maxFeePerGas and maxPriorityFeePerGas for slow, normal and fast inclusion, an L1 data-fee upper bound, and the estimated total cost in wei of an ETH transfer and an ERC-20 transfer, live from Base mainnet RPC with the block number. Required: none; optional blocks (5 to 50). $0.0015 USDC on Base. Failed read,
GET
https://ontarioprotocol.com/api/x402/base/gasUptime100% of 3 checks 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://ontarioprotocol.com/api/x402/base/gas?blocks=20");
console.log(await res.json());Example input
{
"blocks": 20
}