# Base Gas Price Oracle (x402)

> Base Gas Price Oracle (x402) is a paid API for AI agents from kr-x402-mvp.kgy5612.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-31).

Returns real-time Base chain gas prices and transaction cost estimates (swap, transfer, ERC-20) in USD, with a recommendation on cheapest execution venue vs Ethereum L1.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/crypto/gas-price?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-gas-price-oracle-x402-1a4b40b0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9Sc-Av3gkTPLQ0GZPrihj

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-price-oracle-x402-1a4b40b0
```

Example prompt: Before executing my token swap, check the current Base gas price and tell me what a swap would cost in USD right now compared to Ethereum mainnet.

## When to prefer this

Use this endpoint when an AI trading or onchain agent needs a real-time, USD-denominated gas cost estimate for Base L2 before executing a transaction. It is especially valuable for cost-gating logic (e.g. only trade if gas < $X) or for comparing L1 vs L2 execution costs on the fly. Requires no API key — payment is per-call via x402 USDC micropayment on Base.

## Known failure modes

- Upstream RPC (base.drpc.org) unavailable — may return 502 or stale data
- x402 payment failure — returns 402 if USDC payment on Base is not completed
- Temporary spike in gas that makes estimates inaccurate within seconds of fetch
- Missing or malformed response if Base network is congested or experiencing issues

## How this service works

Pay-per-call crypto microdata for trading/onchain AI agents via x402 (USDC on Base): Base gas, token risk, balances, multi-venue prices, Hyperliquid book/funding, kimchi premium. No API keys.

## Output

A JSON object containing: current gas price in gwei for Base, estimated USD cost for swap (150k gas), ETH transfer (21k gas), and ERC-20 transfer (65k gas); native ETH price in USD; upstream RPC latency; rollup L1 fee flag; a human-readable recommendation string; the multiplier showing how many times cheaper Base is vs Ethereum L1; and a timestamp of when data was fetched.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chains": [
   {
    "chain": "base",
    "native": "ETH",
    "chain_id": 8453,
    "swap_usd": 0.0011,
    "upstream": "https://base.drpc.org",
    "latency_ms": 80,
    "native_usd": 3850.1,
    "transfer_usd": 0.000154,
    "gas_price_gwei": 0.0019,
    "erc20_transfer_usd": 0.000476,
    "rollup_l1_fee_extra": true
   }
  ],
  "cheapest": "base",
  "gas_units": {
   "swap": 150000,
   "transfer": 21000,
   "erc20_transfer": 65000
  },
  "sorted_by": "swap_usd",
  "updated_at": "2026-10-30T01:30:00Z",
  "recommendation": "Execute on base (~180x cheaper than Ethereum L1); ...",
  "cheapest_swap_usd": 0.0011,
  "ethereum_vs_cheapest_x": 180
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-price-oracle-x402-1a4b40b0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from kr-x402-mvp.kgy5612.workers.dev](https://www.zero.xyz/host/kr-x402-mvp.kgy5612.workers.dev/llms.txt)
