Turn gas into money exactly (wei-precise)
agents.204-168-199-108.sslip.io/v1/chain/gas-cost
Turn gas into money exactly (wei-precise): give gas units or an action preset (eth_transfer, erc20_transfer, erc20_approve, uniswap_v2_swap, uniswap_v3_swap, nft_mint, nft_transfer, safe_multisig_exec, contract_deploy_small), base fee and priority fee in gwei, optional max fee, optional L2 L1-data fee and native token price → fee in wei/gwei/native/USD, burned vs tip, worst-case cost at max fee an
GET
https://agents.204-168-199-108.sslip.io/v1/chain/gas-costUptime100% of 1 check 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://agents.204-168-199-108.sslip.io/v1/chain/gas-cost?action=erc20_transfer&base_fee_gwei=0.012&l1_fee_eth=0.0000004&native_price_usd=3000&priority_fee_gwei=0.001");
console.log(await res.json());Example input
{
"action": "erc20_transfer",
"base_fee_gwei": "0.012",
"l1_fee_eth": "0.0000004",
"native_price_usd": "3000",
"priority_fee_gwei": "0.001"
}