# Reliable ETH Price Oracle with Fallback

> Reliable ETH Price Oracle with Fallback 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 the current ETH/USD price with automatic cache-fallback on upstream failures, demonstrating a resilient oracle pattern on Base mainnet via x402 micropayments.

## Facts

- Endpoint: GET https://lab.paidapis.net/api/reliable-eth-price
- 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/reliable-eth-price-oracle-with-fallback-d1dc0e83
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_m6373U3u1KGsGtYhJeUmf

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 reliable-eth-price-oracle-with-fallback-d1dc0e83
```

Example prompt: What's the current ETH/USD price? Use the reliable oracle that falls back to cache if live data fails — go ahead and simulate a 30% failure rate so I can see the fallback in action.

## When to prefer this

Choose this endpoint when you need an ETH/USD price with explicit resilience semantics — it clearly signals whether the price is live or from cache and how stale the cache is. Prefer it over generic price APIs when you need to demonstrate or test oracle fallback patterns, or when building on x402 micropayment infrastructure on Base mainnet. It is not a production-grade price feed but is ideal for x402 integration testing, educational demos, or prototyping DeFi tooling.

## Known failure modes

- Payment not provided or invalid x402 header — returns 402 Payment Required
- simulateFailureRate set to 1.0 causing all upstream attempts to fail — may return error or max-retry cache fallback
- Network timeout to upstream price provider — falls back to cache if available
- Cache not yet populated (cold start) with high simulateFailureRate — may return error with no price data

## How this service works

Reliability: ETH/USD price with retry-with-backoff and last-known-good cache fallback layered on top — sells dependability, not the raw data itself. Optional ?simulateFailureRate=0-1 for demoing the fallback path.

## Output

Returns a JSON object with the ETH/USD price as a number, the data source ('live' or 'cache-fallback'), the number of fetch attempts made, the cache age in seconds (null if live), and the simulated failure rate used. Costs $0.01 USDC per call via x402 on Base mainnet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "simulateFailureRate": {
   "type": "number",
   "description": "0-1, simulates upstream failures to demo the fallback path."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "source": {
   "enum": [
    "live",
    "cache-fallback"
   ],
   "type": "string"
  },
  "attempts": {
   "type": "integer"
  },
  "ethUsdPrice": {
   "type": "number"
  },
  "cacheAgeSeconds": {
   "type": [
    "number",
    "null"
   ]
  },
  "simulateFailureRate": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/reliable-eth-price-oracle-with-fallback-d1dc0e83/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)
