Real-time forecasts · x402 v2 · USDC on Base

MOER data for AI agents. Pay-per-request with x402.

GridMix.ai MCP is an MCP server that exposes marginal emissions data and supports on-chain micropayments on Base.

How it works

Simple four-step flow from request to data delivery with on-chain payments.

01

Request

Send a request to any GridMix.ai MCP endpoint for real-time MOER data.

02

402 Response

Server returns HTTP 402 with payment details and expected amount.

03

Pay

Sign and broadcast USDC payment on Base. Include signature in header.

04

Data

Receive emissions data instantly after payment verification.

Features

Everything you need to integrate emissions data into your AI applications.

MCP-Compatible Tools

Three tools for AI agents: current MOER, forecasts, and renewable percentages.

USDC on Base Payments

Pay per request with USDC on Base. Instant settlement, low fees.

Real-Time Grid Data

Access live marginal emissions rates and renewable generation mix.

Hosted & Reliable

Fully managed service running on AWS Lambda. No infrastructure to deploy.

Simple JSON API

Clean REST endpoints with JSON payloads. No SDK or library required.

x402 Protocol

HTTP-native micropayments with automatic 402 Payment Required flow.

API

Three MCP tools for accessing emissions data. All requests require payment via the x402 protocol.

Endpoint

https://api.gridmix.ai

Payment

Price$0.01 / request
NetworkUSDC on Base
AssetUSDC

Quick Start

Install the x402 client library and make authenticated requests:

import { wrapFetch } from 'x402';
import { privateKeyToAccount } from 'viem/accounts';

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetch402 = wrapFetch(fetch, account);

const res = await fetch402('https://api.gridmix.ai/tools/current_moer', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ region: 'CAISO' })
});

console.log(await res.json());

Available Tools

POST/tools/current_moer
Get the current marginal emissions rate for a region

Request

{ "region": "CAISO" }

Response

{
  "text": "Current MOER for CAISO: 372.5 lbs CO2/MWh\nLevel: Low (cleaner grid)\nAs of: 2026-01-20T05:24:00Z",
  "data": {
    "region": "CAISO",
    "moer": 372.5,
    "timestamp": "2026-01-20T05:24:00Z",
    "metadata": {
      "renewable_percent": 41.2
    }
  }
}
POST/tools/forecast_moer
Get MOER forecast for upcoming hours

Request

{ "region": "CAISO", "hours": 24 }

Response

{
  "text": "MOER Forecast for CAISO (next 24 hours)",
  "data": {
    "region": "CAISO",
    "hours": 24,
    "forecast": [
      { "timestamp": "2026-01-20T06:00:00Z", "moer": 410.2 },
      { "timestamp": "2026-01-20T07:00:00Z", "moer": 392.8 }
    ]
  }
}
POST/tools/renewables
Get current renewable generation percentage

Request

{ "region": "CAISO" }

Response

{
  "text": "CAISO Generation Mix\n\nRenewables: 41.2%\n\nGood renewable mix\nAs of: 2026-01-20T05:24:00Z",
  "data": {
    "region": "CAISO",
    "renewable_percent": 41.2,
    "timestamp": "2026-01-20T05:24:00Z"
  }
}

See your grid's emissions in real-time

The GridMix iOS app shows live CO₂ data and a 24-hour forecast for your region. Time your EV charging, laundry, or HVAC to the cleanest hours.

GridMix app showing low emissions - green state

Low emissions

GridMix app showing medium emissions - yellow state

Medium emissions

GridMix app showing high emissions - red state

High emissions

Download on the App Store

Payment Flow

x402 protocol enables pay-per-request with cryptographic proof of payment.

1

Initial Request Returns 402

When you request data without payment, the server responds with HTTP 402 and payment instructions.

HTTP/1.1 402 Payment Required
 X-Payment-Address: 0x1234...abcd
 X-Payment-Amount: 0.01
 X-Payment-Token: USDC
 X-Payment-Network: base
2

Submit Payment with Signature Header

After broadcasting payment on Base, include the transaction signature in subsequent requests.

POST /tools/current_moer HTTP/1.1
Content-Type: application/json
PAYMENT-SIGNATURE: 0xabc123...def456

{"region": "CAISO_NORTH"}
3

Receive Data + Settlement Receipt

Server verifies payment on-chain and returns data along with a settlement receipt.

HTTP/1.1 200 OK
X-Settlement-Tx: 0x789...
X-Settlement-Block: 12345678

{"moer": 0.423, "units": "lbs CO2/MWh", ...}

Frequently Asked Questions

Common questions about GridMix.ai MCP and the x402 payment protocol.