Climatebrain / Grid402

Endpoints

Base URL: https://grid402.climatebrain.xyz/api

All routes return JSON. Paid routes return 402 until x402-signed.

Hierarchy — the mix endpoints are the primary product. Emissions are computed from the mix using IPCC AR6 lifecycle factors. Spot price is bundled alongside as a commodity signal. Combined packs all three into a single HTTP round-trip — the natural unit for an agent making a carbon-aware load-shift decision.

Mix — generation breakdown + carbon intensity (primary)

The crown-jewel signal. Sub-hourly fuel mix per ISO region, with self-computed gCO₂/kWh embedded.

RouteISOGranularityCost
GET /mix/CAISO/liveCalifornia, USA5 min$0.002
GET /mix/ERCOT/liveTexas, USA5 min$0.002
GET /mix/GB/liveGreat Britain (NESO)30 min$0.002
GET /mix/KPX/liveKorea5–60 min$0.003
GET /mix/AEMO/live?region=:rAustralia (NEM)5 min$0.002

:r for AEMO is one of NSW1, QLD1, SA1, TAS1, VIC1. Each NEM region is dispatched independently and has a distinct CI profile (TAS1 is hydro-clean, QLD1 is coal-heavy).

GB uses the NESO Carbon Intensity API — no key required, real upstream.

History (for time-series scrubbing)

RouteDescription
GET /mix/{ISO}/history?hours=24&step=30Time-series, 30-min slots over the last 24 hours

Returns { iso, source, step_minutes, series: [{ ts, ci_g_per_kwh, generation_mw, pct }] }.

Emissions — self-computed gCO₂/kWh (derived from mix)

RouteMethod
GET /emissions/CAISO/liveΣ (fuel_MW × IPCC AR6 lifecycle factor) / total_MW
GET /emissions/ERCOT/livesame
GET /emissions/GB/livesame (with NESO’s published intensity as override when available)
GET /emissions/KPX/livesame
GET /emissions/AEMO/live?region=:rsame

Every response includes factor_source (URL to the IPCC AR6 WG3 Annex III table) and method: "self_computed" so auditors can trace the assumption. We do not redistribute Electricity Maps’ carbon-intensity numbers — every figure is independently derivable.

Spot price — wholesale clearing price (bundled)

RouteCurrencyGranularity
GET /spot/CAISO/:zone/liveUSD/MWh (LMP)5–15 min
GET /spot/ERCOT/:hub/liveUSD/MWh (LMP)5–15 min
GET /spot/GB/:zone/liveGBP + USD/MWh30 min
GET /spot/KPX/:zone/liveKRW + USD/MWh (SMP)hourly
GET /spot/AEMO/:region/liveAUD + USD/MWh (RRP)5 min

Native-currency price + USD-converted price both returned, with the FX rate cited.

RouteCost
GET /combined/CAISO/:zone/live$0.005
GET /combined/ERCOT/:hub/live$0.005
GET /combined/GB/:zone/live$0.005
GET /combined/KPX/:zone/live$0.006
GET /combined/AEMO/:region/live$0.005

One HTTP request → one USDC tx → mix + emissions + spot. Cheaper than three separate calls. Use this for dashboards, carbon-aware schedulers, and any agent that’s making a decision per tick.

Free routes (no payment)

  • GET / — service info + endpoint catalog
  • GET /health{ ok: true, ts }
  • GET /schema/:iso — JSON schema for that ISO’s responses

Demo tier vs production tier

The endpoints under https://grid402.climatebrain.xyz/api are the free demo tier — unmetered, rate-limited at the CDN edge, and deployed as Cloudflare Pages Functions. They exist so the live map and this documentation work without forcing first-time visitors through a wallet handshake.

The x402-gated production API (the prices in the tables above) lives in api/ of the repo and runs locally / on Railway / on Cloudflare Workers. Same data, real billing, real on-chain settlement. Production deploy URL is being staged.