# Base Onchain Token Price Feed

> Base Onchain Token Price Feed is a paid API for AI agents from base-onchain-tools.dolerite.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Fetches live token prices (e.g. ETH/USD) from Chainlink on-chain oracles on Base mainnet

## Facts

- Endpoint: GET https://base-onchain-tools.dolerite.workers.dev/v1/base/price
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-onchain-token-price-feed-f475ad3f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_HEH4XGhshbd_P12_EuNXM

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-onchain-token-price-feed-f475ad3f
```

Example prompt: What's the current on-chain price of ETH in USD right now, pulled live from Chainlink on Base mainnet?

## When to prefer this

Choose this endpoint when you need a trustworthy, on-chain price sourced directly from Chainlink oracles on Base mainnet, especially when you need a staleness guarantee and want pay-per-call with no API key or account setup. Prefer it over exchange-based price APIs when on-chain oracle provenance matters (e.g. DeFi logic, smart contract inputs, or auditability). It is read-only and covers Base mainnet only.

## Known failure modes

- Upstream RPC outage across all five providers returns an error rather than a zero/stale value — call is not billed
- Malformed or unsupported token pair parameter returns a 4xx error — call is not billed
- Network timeout or Cloudflare Worker failure returns 5xx — call is not billed
- Requesting a token not supported by Chainlink on Base mainnet returns an error

## How this service works

Eleven read-only endpoints answering questions about Base mainnet that are tedious to assemble from raw RPC: what an unverified contract is actually able to do, whether a token transfer will revert and for what reason, what an arbitrary token is worth, and whether an address is safe to pay. Priced $0.001-$0.04 per call in USDC over x402. No account, no API key, no signup, no minimum, no rate limit to negotiate — the payTo address in the 402 response is the whole integration. Failed calls are not billed. The payment middleware cancels settlement on any 4xx or 5xx, so a malformed parameter or an upstream outage costs nothing. Answers are read live from Base mainnet at request time, with failover across five independent RPC providers. A batch that comes back incomplete is treated as a failure rather than returned with the missing entries as zeros, because a confident wrong answer costs a caller more than an error does. Scope is deliberately narrow: Base mainnet only, reads only, no keys held, nothing stored between requests.

## Output

A JSON object containing a prices map keyed by trading pair (e.g. 'ETH/USD'), each entry including the current numeric price and a boolean 'stale' flag indicating whether the oracle data is fresh, plus a 'source' field identifying the oracle (e.g. 'chainlink-onchain').

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "prices": {
   "ETH/USD": {
    "price": 2401.43,
    "stale": false
   }
  },
  "source": "chainlink-onchain"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-onchain-token-price-feed-f475ad3f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-onchain-tools.dolerite.workers.dev](https://www.zero.xyz/host/base-onchain-tools.dolerite.workers.dev/llms.txt)
