x402 · USDC on Base or Solana

x402-weather-guard

Hourly forecasts and go/no-go verdicts for real plans. An agent sends a point and a time window, pays $0.002 in USDC, and gets back go, risky, or no-go — with the exact threshold breaches that produced it and alternative windows that would clear the same bar. Global, keyless, live.

git clone https://github.com/nirholas/x402-weather-guard
cd x402-weather-guard && npm install
npm run dev

Pricing

RoutePriceReturns
GET /forecast$0.001 Hour-by-hour temperature, feels-like, precipitation probability and amount, wind, gusts, cloud, visibility, and plain-English conditions, with any active NWS alerts
POST /decision$0.002 A verdict, the threshold breaches behind it, the worst hour, active alerts, and up to five non-overlapping alternative windows that would clear the same bar
GET /, GET /health, GET /.well-known/x402 freeService info, liveness, discovery manifest

Every paid route returns the purchased artifact in the 200 response body.

Two rails, one price

The 402 challenge advertises both. Your client picks whichever it can sign.

USDC on Base

network base-sepolia · base on mainnet
0x40252CFDF8B20Ed757D61ff157719F33Ec332402

USDC on Solana

network solana · solana-devnet on devnet
WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW

How a paid call works

1 · 402 2 · Sign 3 · Settle 4 · 200 Server quotes both rails Client signs Base or Solana Facilitator verifies on-chain Artifact in the body + receipt

Quickstart (agent side)

import { wrapFetchWithPayment, createSigner } from "x402-fetch";

const signer = await createSigner("base-sepolia", process.env.PRIVATE_KEY!);
const payFetch = wrapFetchWithPayment(fetch, signer);

const res = await payFetch(
  "http://localhost:4024/forecast?lat=47.6062&lon=-122.3321&hours=6"
);
const artifact = await res.json(); // purchased artifact, in-response

Links