Skip to content
Fourohtwo

Gas estimate before you send, on Ethereum, Base, Arc or BNB Chain

apexfaucet.xyz/api/x402/evm-gas-estimate

Gas estimate before you send, on Ethereum, Base, Arc or BNB Chain: pass ?to=&from=&data=&value= and get the gas units, the gas price and the fee in the native coin, or the revert reason if the transaction would fail. Nothing is signed or sent.

BaseArcSolanaBNB ChainRobinhood ChainAnswering
GEThttps://apexfaucet.xyz/api/x402/evm-gas-estimate

Uptime100% of 5 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://apexfaucet.xyz/api/x402/evm-gas-estimate?to=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&data=0x&from=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chain=base&value=1000");
console.log(await res.json());

Example input

{
  "to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "data": "0x",
  "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "chain": "base",
  "value": "1000"
}