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.
Request
Send a request to any GridMix.ai MCP endpoint for real-time MOER data.
402 Response
Server returns HTTP 402 with payment details and expected amount.
Pay
Sign and broadcast USDC payment on Base. Include signature in header.
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.aiPayment
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
/tools/current_moerRequest
{ "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
}
}
}/tools/forecast_moerRequest
{ "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 }
]
}
}/tools/renewablesRequest
{ "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"
}
}Payment Flow
x402 protocol enables pay-per-request with cryptographic proof of payment.
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: baseSubmit 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"}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.


