# Base Gas and Transaction Cost

> Base Gas and Transaction Cost is a paid API for AI agents from apexfaucet.xyz, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-03).

Returns real-time gas price on Base including actual USD costs (L2 + L1 fee) for ETH transfers, USDC transfers, and Uniswap swaps, read from live block receipts.

## Facts

- Endpoint: GET https://apexfaucet.xyz/api/x402/base-gas?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-gas-and-transaction-cost-b44ebf13
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rlNWwxUlVG2sHuRvUL-3w

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability base-gas-and-transaction-cost-b44ebf13
```

Example prompt: What does a Uniswap swap actually cost on Base right now in dollars, including the L1 data fee — not just the L2 gas?

## When to prefer this

Choose this endpoint when you need accurate, receipt-based USD transaction costs on Base that include the often-ignored L1 data fee. Unlike standard gas trackers that show only L2 gas estimates, this endpoint reads from real transaction receipts so the numbers reflect what users actually paid. Ideal for DeFi agents, cost estimation before executing transactions, gas alerting systems, or any application needing true all-in Base transaction costs.

## Known failure modes

- Base RPC node unavailable or rate-limited — may return 503 or stale data
- No recent blocks available to read receipts from — may return null or empty cost fields
- Network congestion causing response delay
- Payment of $0.001 USDC not confirmed — returns 402 Payment Required

## How this service works

Base gas price now: what an ETH transfer, a USDC transfer and a Uniswap swap cost in USD, L1 fee included. What a transaction on Base costs right now, in dollars, including the L1 data fee most gas trackers leave out. Read from real receipts in the latest Base blocks: the median a plain ETH transfer, a USDC transfer and a Uniswap swap actually paid (L2 fee + L1 fee), what the same gas costs at the current base fee and median tip, and the tip spread over 20 blocks.

## Output

Returns current Base gas price, median transaction costs in USD for ETH transfers, USDC transfers, and Uniswap swaps (each broken down into L2 + L1 data fee components), estimated costs at the current base fee and median tip, and the miner tip spread observed over the last 20 blocks — all sourced from real transaction receipts in recent Base blocks.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    }
   }
  },
  "output": {
   "type": "object"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-and-transaction-cost-b44ebf13/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from apexfaucet.xyz](https://www.zero.xyz/host/apexfaucet.xyz/llms.txt)
