# Base Onchain Tools – Token Price

> Base Onchain Tools – Token Price is a paid API for AI agents from base-onchain-tools.dolerite.workers.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-11).

Returns the current USD price of any ERC-20 token on Base mainnet, sourced from live DEX pool data with a safety verdict and liquidity warnings.

## Facts

- Endpoint: GET https://base-onchain-tools.dolerite.workers.dev/v1/base/token-price?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-onchain-tools-token-price-e5ee8a33
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_934EYz9sPcPDHqxsf0qKA

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-tools-token-price-e5ee8a33
```

Example prompt: What's the current USD price of the AERO token at 0x940181a94A35A4569E4529a3CDfB74e38FD98631 on Base mainnet, and is the price trustworthy given current liquidity?

## When to prefer this

Choose this endpoint when you need a live, DEX-sourced USD price for any ERC-20 token on Base mainnet with built-in liquidity quality signals and manipulation warnings — especially before executing swaps, valuing portfolio holdings, or assessing unfamiliar tokens. It is preferable to raw RPC calls because it aggregates multiple pools, flags disagreements, and provides a safety verdict rather than a bare number. No API key or account is needed; pay $0.006 USDC per successful call via x402.

## Known failure modes

- Invalid or non-ERC-20 contract address returns a 4xx error (not billed)
- Token with no DEX liquidity on Base returns an error rather than a zero price
- Incomplete pool data treated as failure rather than partial result (not billed)
- Upstream RPC outage across all 5 providers returns a 5xx error (not billed)
- Non-Base-mainnet addresses return an error since scope is Base mainnet only

## 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 the token's symbol, current USD price (price_usd), a verdict ('safe', 'caution', or 'warning'), an array of human-readable warnings (e.g. pool disagreement, thin liquidity), the number of pools found and how many are liquid, and the specific pool used as the price source.

## 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",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "description": "ERC-20 token address on Base mainnet"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "symbol": "AERO",
  "verdict": "caution",
  "warnings": [
   "liquid pool prices disagree by 5.5%; thin or manipulated liquidity"
  ],
  "price_usd": 0.4838,
  "pools_found": 8,
  "liquid_pools": 7,
  "price_source": "uniswap-v3 WETH pool @ 0.3% fee"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-onchain-tools-token-price-e5ee8a33/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)
