# code402 Gateway Weather Forecast

> code402 Gateway Weather Forecast is a paid API for AI agents from gateway.code402.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Returns weather forecast data for a given location via a machine-payable x402 micropayment API costing $0.005 USDC per call

## Facts

- Endpoint: GET https://gateway.code402.dev/api/forecast
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code402-gateway-weather-forecast-d024dbf5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uLELvKNrqWvDjT--Db0yb

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 code402-gateway-weather-forecast-d024dbf5
```

Example prompt: Can you pull up the weather forecast for San Francisco for the next 5 days so I know what conditions to expect?

## When to prefer this

Choose this endpoint when you need weather forecast data on a true pay-per-use basis with no subscription required, especially in agent or M2M (machine-to-machine) workflows that support the x402 payment protocol with USDC. Ideal for low-volume or sporadic forecast lookups where a recurring API subscription would be wasteful, or when building autonomous agents that need to self-fund API calls non-custodially.

## Known failure modes

- Insufficient USDC balance or failed payment — endpoint returns HTTP 402 with payment details
- Invalid or unrecognized location parameter — may return an error or empty result
- Network timeout or gateway unavailability — standard HTTP 5xx error
- Malformed query parameters — HTTP 400 bad request
- Payment confirmation delay on-chain — request may not proceed until payment is confirmed

## How this service works

Machine-payable APIs over x402 (HTTP 402 + USDC) on the open M2M/1 protocol. Non-custodial: payments settle direct to seller wallets.

## Output

A structured weather forecast response including temperature, precipitation probability, and general weather conditions for the requested location and time period, delivered after a $0.005 USDC micropayment settles on-chain via the x402 protocol.

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code402-gateway-weather-forecast-d024dbf5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.code402.dev](https://www.zero.xyz/host/gateway.code402.dev/llms.txt)
