# prices.x402utils Token Price API

> prices.x402utils Token Price API is a paid API for AI agents from prices.x402utils.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Returns live or historical token prices (by CoinGecko ID or chain:contract address) with percentage change over a period, paid per call via x402 (USDC on Base).

## Facts

- Endpoint: GET https://prices.x402utils.workers.dev/v1/price-at?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/prices-x402utils-token-price-api-5dc23c67
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_16LqnF1dmcJlf0I_XBGZp

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 prices-x402utils-token-price-api-5dc23c67
```

Example prompt: What was the price of Ethereum and Bitcoin at unix timestamp 1767225600? Give me their prices in USD using their CoinGecko IDs.

## When to prefer this

Choose this endpoint when you need on-demand token price lookups across any chain using either CoinGecko IDs or raw contract addresses, especially in agentic workflows that require paying per call programmatically via x402/USDC on Base. Prefer it over free tier APIs when you need reliable historical price data or multi-chain contract address resolution without API key setup friction.

## Known failure modes

- Invalid or unrecognized CoinGecko ID returns an error or missing key in prices map
- Malformed chain:contract address format results in lookup failure
- Timestamp out of supported historical range may return empty or error
- Missing required query params (coins or timestamp) returns a 400 error
- Payment failure via x402 (insufficient USDC balance) blocks the request

## How this service works

Live and historical token prices for agents, any chain: coingecko ids or chain:contract addresses, plus % change over a period. Paid per call via x402 (USDC on Base).

## Output

A JSON object containing a prices map keyed by coin identifier (e.g. 'coingecko:ethereum') with each coin's USD price, plus the unix timestamp of the price data. May also include percentage change over a specified period.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "coins",
      "timestamp"
     ],
     "properties": {
      "coins": {
       "type": "string",
       "description": "comma-separated coin ids"
      },
      "timestamp": {
       "type": "string",
       "description": "unix seconds"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "prices": {
   "coingecko:ethereum": {
    "price": 3300.1
   }
  },
  "timestamp": 1767225600
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prices-x402utils-token-price-api-5dc23c67/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from prices.x402utils.workers.dev](https://www.zero.xyz/host/prices.x402utils.workers.dev/llms.txt)
