Agent quick start
REST base: https://cleantech-agent-demand.old-rain-22ad.workers.dev/v1
MCP endpoint: https://cleantech-agent-demand.old-rain-22ad.workers.dev/mcp
1. Get a trial token
POST to /v1/keys/free. No request body or wallet is required. Store the returned api_key securely. Repeated issuance from the same public IP returns the same allocation; agents sharing an IP share the five-call allowance.
2. Request one reference rate
curl -X POST 'https://cleantech-agent-demand.old-rain-22ad.workers.dev/v1/keys/free?src=docs' curl 'https://cleantech-agent-demand.old-rain-22ad.workers.dev/v1/tariffs/cap?region=GB&fuel=electricity&payment_method=direct_debit&period=2026-09-07&src=docs' \ -H 'Authorization: Bearer YOUR_TRIAL_TOKEN' \ -H 'Idempotency-Key: YOUR_NEW_UUID'
Replace the token and UUID. Set period to the date you need; supported dates depend on the published dataset. Retain the exact query and UUID for retries. Replaying a saved result uses no additional allowance and returns the original dated response.
Inputs and responses
region: A, B, C, D, E, F, G, H, J, K, L, M, N, P or GB. GB explicitly requests the national average. fuel: electricity or gas. payment_method: direct_debit, standard_credit or prepayment. period: YYYY-MM-DD.
Responses contain one row in data, with unit_rate_pence, standing_charge_pence_per_day, source and dates. meta explains units, scope and attribution. The quoted energy rates include VAT where applicable; that is separate from our own non-VAT-registered service.
Do not retry a rejected or stale query in a tight loop. An eligible paid request without a payment credential returns a 402 payment offer. Register the business first and supply its customer token. Unregistered or ineligible requests may be refused before any offer.
MCP
Connect using Streamable HTTP at the endpoint above and pass the trial token as an Authorization Bearer header. Call get_ofgem_price_cap with the same query fields and a UUID in request metadata idempotency-key. get_data_freshness is free. recover_saved_lookup retrieves an existing response without starting a purchase.
Paid business registration
Read /v1/customers/requirements. Prepare the business profile and payer at POST /v1/customers/prepare, sign the returned message, and submit it to POST /v1/customers. Use the returned customer token for paid requests from that wallet. Registration is open to the listed business territories, subject to the remaining regional and global capacity. Use the business establishment receiving the service, not the agent server location.
Paid territories: UK; US CA, TX, MA, WA, WI, MN; Canada AB, BC, NB, NL, NS, NT, NU, ON, PE, QC, YT. All other paid territories remain unavailable. Free access does not require this paid registration.
OpenAPI · Agent discovery file · Freshness status
Pay for a lookup
Read the paid terms and privacy notice before registration. For REST, send the customer token in x-customer-token. An x402-capable client reads the 402 challenge, checks exact amount 10000 atomic USDC units (0.01 USDC), Base network eip155:8453 and the recipient, then signs the EIP-3009 authorisation and retries with payment-signature. Keep the customer token header on the paid request. The signature authorises one lookup, not a subscription. Never send funds directly expecting API credit.
For MCP, call get_ofgem_price_cap with _meta[customer-token]. Payment-aware clients read _meta[x402/error] and supply the signed payload in _meta[x402/payment]. MCP connection alone does not mean your client supports payments.
Recover without paying again
Save the original signed credential and exact dated query before sending. On timeout or uncertainty, reuse that credential and query; never sign a replacement automatically. REST can replay the original request. MCP can call recover_saved_lookup with kind: cap, the original query fields and original _meta[x402/payment]. Recovery needs no new payment or customer token, and returns the original saved response. Paid responses remain recoverable for at least 90 days after recorded settlement.