# 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.001/call, status unknown (last checked 2026-10-31).

Returns current Base network gas prices across slow/standard/fast tiers with estimated USD costs, congestion level, and EIP-1559 fee fields, paid per-call via x402 micropayment.

## Facts

- Endpoint: GET https://kr-x402-mvp.kgy5612.workers.dev/v1/gas?utm_source=zero.xyz
- Price: $0.001/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-466e2d8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_egSbl2dM6v0VkjMbCq6iZ

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-466e2d8c
```

Example prompt: What are the current gas fees on Base right now — give me the slow, standard, and fast tiers with estimated USD costs, and tell me which tier you'd recommend for a standard ETH transfer of 21000 gas units?

## When to prefer this

Use this endpoint when your agent operates on the Base L2 network and needs real-time, tiered gas price data with USD cost estimates before submitting transactions. Prefer it over generic Ethereum gas oracles because it is Base-specific (chain_id 8453), returns EIP-1559 hex fields ready for tx construction, and requires no API key — only a $0.001 USDC micropayment via x402. Best for autonomous trading agents, DeFi bots, or on-chain workflow orchestrators that need to make cost-aware decisions at runtime.

## Known failure modes

- Payment not attached or insufficient USDC → 402 Payment Required with payment instructions
- RPC upstream failure from mainnet.base.org → 502/503 with error message
- gas_limit below 21000 or above 30000000 → 400 validation error
- Network timeout if Base RPC is slow → 504 Gateway Timeout
- Stale data if upstream RPC is lagging — check updated_at field

## 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

JSON object containing: current block number, chain ID (8453), base fee in gwei, gas price in gwei, congestion score (0–1), recommended tier, per-tier breakdown (slow/standard/fast) with max_fee_gwei, max_priority_fee_gwei, and est_cost_usd, plus ready-to-use EIP-1559 tx fields (hex-encoded maxFeePerGas, maxPriorityFeePerGas, gas, type), estimated transfer cost in ETH, data sources, and timestamp.

## 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"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "gas_limit": {
       "type": "integer",
       "maximum": 30000000,
       "minimum": 21000,
       "examples": [
        21000,
        150000
       ],
       "description": "Gas units to price (default 21000)"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "block": 37000000,
  "chain": "base",
  "tiers": {
   "fast": {
    "est_cost_usd": 0.0007,
    "max_fee_gwei": 0.025,
    "max_priority_fee_gwei": 0.01
   },
   "slow": {
    "est_cost_usd": 0.0005,
    "max_fee_gwei": 0.006,
    "max_priority_fee_gwei": 0.001
   },
   "standard": {
    "est_cost_usd": 0.0005,
    "max_fee_gwei": 0.011,
    "max_priority_fee_gwei": 0.001
   }
  },
  "sources": [
   "https://mainnet.base.org"
  ],
  "chain_id": 8453,
  "tx_fields": {
   "gas": "0x5208",
   "type": "0x2",
   "maxFeePerGas": "0xa7d8c0",
   "maxPriorityFeePerGas": "0xf4240"
  },
  "congestion": 0.42,
  "updated_at": "2026-10-29T13:30:00Z",
  "base_fee_gwei": 0.005,
  "gas_price_gwei": 0.006,
  "recommended_tier": "standard",
  "gas_price_wei_hex": "0x5b8d80",
  "est_transfer_cost_eth": 1.26e-7,
  "max_priority_fee_gwei": 0.001,
  "max_priority_fee_wei_hex": "0xf4240"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-gas-price-oracle-x402-466e2d8c/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)
