# Gas Metrics Oracle — x402 Experiments (lab.paidapis.net)

> Gas Metrics Oracle — x402 Experiments (lab.paidapis.net) is a paid API for AI agents from lab.paidapis.net, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns real-time and statistical gas price metrics (current, average, min, max, stdDev, trend) for a configurable recent time window on Base mainnet.

## Facts

- Endpoint: GET https://lab.paidapis.net/api/gas-metrics
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gas-metrics-oracle-x402-experiments-lab-paidapis-net-bb81aba4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Un5CYX1TCVaJs3du-vbGn

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 gas-metrics-oracle-x402-experiments-lab-paidapis-net-bb81aba4
```

Example prompt: What are the current gas price stats on Base mainnet for the last 15 minutes — give me the average, min, max, and whether prices are trending up or down?

## When to prefer this

Use this endpoint when you need statistical gas price intelligence on Base mainnet — not just a single current reading — including trend direction, volatility (stdDev), and min/max over a configurable recent window. Prefer this over generic gas APIs when you specifically need Base mainnet data with trend analysis and are willing to pay micro-fees via x402 USDC.

## Known failure modes

- Insufficient data returns null for all numeric fields and trend set to 'insufficient-data' when the window has too few samples
- Invalid windowMinutes value (e.g. negative or non-numeric) may result in a 400 error
- Payment failure or missing x402 payment header returns HTTP 402
- Service unavailability returns 5xx errors

## How this service works

Derived metrics: Ethereum gas price sampled continuously in the background and turned into rolling average, min/max, volatility, and trend direction over a window (?windowMinutes=, default 10) — none of which exist in the raw upstream feed's single instantaneous value.

## Output

Returns a JSON object with current gas price, average, min, max, standard deviation, trend direction (up/down/flat/insufficient-data), number of samples observed, and the requested window size in minutes. All numeric fields may be null if insufficient data exists.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "windowMinutes": {
   "type": "number",
   "description": "Window size in minutes (default 10)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max": {
   "type": [
    "number",
    "null"
   ]
  },
  "min": {
   "type": [
    "number",
    "null"
   ]
  },
  "trend": {
   "enum": [
    "up",
    "down",
    "flat",
    "insufficient-data"
   ],
   "type": "string"
  },
  "stdDev": {
   "type": [
    "number",
    "null"
   ]
  },
  "average": {
   "type": [
    "number",
    "null"
   ]
  },
  "current": {
   "type": [
    "number",
    "null"
   ]
  },
  "sampleCount": {
   "type": "integer"
  },
  "windowMinutes": {
   "type": "integer"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gas-metrics-oracle-x402-experiments-lab-paidapis-net-bb81aba4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lab.paidapis.net](https://www.zero.xyz/host/lab.paidapis.net/llms.txt)
