# x402 Demo API – Weather Endpoint

> x402 Demo API – Weather Endpoint is a paid API for AI agents from x402-demo-api-kaya.vercel.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Returns current weather conditions and temperature for a given city, charged at $0.01 USDC per call via the x402 protocol on Base mainnet.

## Facts

- Endpoint: POST https://x402-demo-api-kaya.vercel.app/api/weather
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-demo-api-weather-endpoint-cb46d26c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cIokEJxnbl3K3IbcGsOG5

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 x402-demo-api-weather-endpoint-cb46d26c -d '<json body>'
```

Example prompt: What's the current weather and temperature in Tokyo right now?

## When to prefer this

Use this endpoint when you need quick, per-call weather lookups for individual cities and are operating in an x402-compatible micropayment environment on Base mainnet. Ideal for agents that need lightweight weather data without a subscription, paying only $0.01 USDC per query.

## Known failure modes

- Missing required 'city' field returns a validation error
- Unknown or misspelled city name may return an error or empty result
- Insufficient USDC balance or payment failure via x402 protocol results in a 402 Payment Required response
- Network issues with Base mainnet may delay or block payment processing
- Rate limiting or server errors on the Vercel deployment may cause 500 responses

## How this service works

Paid API demo using x402 protocol on Base mainnet.

## Output

A JSON object containing the city name, a weather condition string (e.g. 'Sunny', 'Cloudy'), the current temperature in Fahrenheit, the temperature unit, and an ISO 8601 timestamp of when the data was recorded.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "city"
 ],
 "properties": {
  "city": {
   "type": "string",
   "description": "City name (e.g. jakarta, tokyo, london)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "city",
  "weather",
  "temperature",
  "unit",
  "timestamp"
 ],
 "properties": {
  "city": {
   "type": "string",
   "description": "City name"
  },
  "unit": {
   "type": "string",
   "description": "Temperature unit"
  },
  "weather": {
   "type": "string",
   "description": "Weather condition"
  },
  "timestamp": {
   "type": "string",
   "format": "date-time",
   "description": "ISO timestamp"
  },
  "temperature": {
   "type": "number",
   "description": "Temperature in fahrenheit"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-demo-api-weather-endpoint-cb46d26c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-demo-api-kaya.vercel.app](https://www.zero.xyz/host/x402-demo-api-kaya.vercel.app/llms.txt)
