Skip to content

Carbon Retirement, Built for AI Agents

The first carbon marketplace with a native x402 endpoint: your agent discovers credits, quotes live prices, and retires carbon onchain — returning a public certificate in a single flow.

  • x402 — Carbonmark leverages x402 for powering agentic carbon transactions.
  • Circle — Carbonmark uses Circle's USDC coin to enable instant transaction settlement.
  • Base — Carbonmark's infrastructure is built atop the Base blockchain.
  • Model Context Protocol — MCP enables agentic interactions with Carbonmark's platform.

What is agentic carbon retirement?

Agentic carbon retirement is the process by which an AI agent autonomously purchases and permanently retires carbon credits on a user’s behalf. On Carbonmark, agents use the x402 payment protocol to discover credits, receive live quotes, execute onchain retirement, and return a publicly verifiable certificate — no human browsing required.

The endpoint is its own service, separate from the Carbonmark REST API and its API keys. Every path shown here is on this host:

https://x402.klimalabs.com
  1. Step 1

    Discover

    Available carbon credits

    GET /api/discover
  2. Step 2

    Quote

    Live on-chain prices

    GET /api/quote
  3. Step 3

    Retire

    Credits in a single approved transaction

    GET /api/prepare/retire
  4. Step 4

    Certificate

    A public Carbonmark certificate as permanent proof

    GET /api/certificate

Quickstart: retire 1 kg of carbon over x402

No API key and no account. Discovery, quotes and the prepare step are free and move no funds, so you can run the whole flow up to the signature without spending anything. Only the signed retirement spends USDC.

1. See what is retirable and price it

Two read-only calls. No wallet needed. Each box holds one command, so it runs as copied.

List everything retirable: pooled credit classes and marketplace listings.

List retirable credits
curl -s https://x402.klimalabs.com/api/discover

Get a live price for 1 kg (0.001 tonnes), paying in USDC on Base. The carbonClass value is a carbonClassId from the first response.

Quote 1 kg
curl -s "https://x402.klimalabs.com/api/quote?chainId=8453&inputToken=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&amount=0.001&carbonClass=0x0008f35758a4318942ecb5d5414116ce7b1ede2d"

In Windows PowerShell 5, type curl.exe in place of curl.

From a quote on 17 November 2026 (prices are live and will differ):

Example quote response
"humanSummary": "0.001 tonnes @ 0.000041 USDC + 0.01 USDC fee = 0.010041 USDC (max 0.010442 USDC with 4% slippage)"

2. Retire it with one signature

A complete Node.js script for the gasless path: it picks a credit, prices it, signs one USDC authorization and prints the certificate URL. The wallet needs USDC on Base and no ETH. Set DRY_RUN=1 to stop before signing.

retire.mjs
// retire.mjs: retire 1 kg of carbon over Carbonmark's x402 endpoint (gasless relay).
// Setup:  npm i viem
// Run:    DRY_RUN=1 PRIVATE_KEY=0x... node retire.mjs   (prices it and stops; nothing is spent)
//         PRIVATE_KEY=0x... node retire.mjs             (retires for real; irreversible)
// Windows PowerShell sets variables differently:
//         $env:PRIVATE_KEY="0x..."; $env:DRY_RUN="1"; node retire.mjs   (dry run)
//         $env:DRY_RUN=$null; node retire.mjs                           (retires for real; irreversible)
import { privateKeyToAccount } from "viem/accounts";

const API = "https://x402.klimalabs.com/api";
const USDC = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"; // USDC on Base mainnet
const account = privateKeyToAccount(process.env.PRIVATE_KEY); // wallet holding USDC on Base; no ETH needed

const post = async (body) => {
  const res = await fetch(API, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify(body),
  });
  const json = await res.json();
  if (!res.ok) throw new Error(`${json.error}: ${json.message}`);
  return json;
};

// 1. Discover (free): take the cheapest pooled credit class that retires from 1 kg.
const { carbonClasses } = await (await fetch(`${API}/discover`)).json();
const carbonClass = carbonClasses
  .filter((c) => c.minRetirementTonnesFormatted === "0.001")
  .sort((a, b) => Number(a.priceUsdcPerTonne) - Number(b.priceUsdcPerTonne))[0];

// 2. Prepare (free, moves no funds): live price plus the one authorization to sign.
const prep = await post({
  action: "prepare-auth",
  chainId: 8453,
  from: account.address,
  inputToken: USDC,
  carbonClass: carbonClass.carbonClassId,
  amount: "0.001", // tonnes, so this is 1 kg
  beneficiaryIsPayer: true,
  details: { beneficiaryString: "My AI agent", retirementMessage: "Retired over x402" },
});
console.log(`${carbonClass.name}: ${prep.quote.humanSummary}`);
console.log(`Authorizing up to ${prep.authValueFormatted} USDC (price + fee + relay gas)`);
if (process.env.DRY_RUN) process.exit(0);

// 3. Sign the USDC authorization and submit. From here it spends funds and cannot be undone.
const signature = await account.signTypedData(prep.typedData);
const request = prep.actionsRetireRequest;
const result = await post({ ...request, authPayload: { ...request.authPayload, signature } });

// 4. Certificate: public, permanent proof. Poll while the indexer catches up.
let retirements = result.retirements ?? [];
for (let i = 0; retirements.length === 0 && i < 10; i++) {
  await new Promise((r) => setTimeout(r, 3000));
  const res = await fetch(`${API}/certificate?txHash=${result.transactionHash}`);
  if (res.ok) retirements = (await res.json()).retirements ?? [];
}
console.log(retirements[0]?.certificateUrl ?? `Pending: tx ${result.transactionHash}`);

Retirement is irreversible, and the beneficiary name and message appear on the public certificate permanently. The full walkthrough, the error codes and the self-submit path are in the gasless retirement guide.

Two integration paths

Free GET/POST endpoints; your agent submits the transaction from its own Base wallet

Best for: wallet-connected agents (Base MCP, custom stacks)

Sign one authorization — our executor submits onchain and covers gas

Best for: any agent or wallet, no ETH required

AI Speed. Onchain Proof.

Every agent-executed retirement is recorded on Base and resolves to a public Carbonmark certificate — showing the project, vintage, tonnage, and beneficiary.

Autonomous doesn’t mean unaccountable: anyone can verify what your agent did, forever.

Retirement Certificate

Verified onchain
Project
Harvey Manning Park ExpansionRegen Registry · REGEN-C02004
Vintage
2021
Tonnage
0.090071 tCO₂e
Beneficiary
Automated Carbon Retirement Bot
Retired
August 2026

GET /api/certificate

View the live certificate

Humans in the loop

Building an agentic integration?

Our Solutions team helps you scope, test, and go live.

Talk to Solutions

Key facts

  • Carbonmark lets AI agents and HTTP clients retire carbon credits autonomously in four steps on https://x402.klimalabs.com, a service separate from the Carbonmark REST API: GET /api/discover (list retirable credits), GET /api/quote (live onchain price incl. fees), GET /api/prepare/retire (single approved transaction), GET /api/certificate (public onchain proof).
  • Payments use the x402 payment protocol; a machine-readable manifest is published at /.well-known/x402.json and an OpenAPI spec at /openapi.json for agent discovery.
  • No API key or account is needed. The endpoint runs on Base mainnet (chainId 8453) and takes payment in USDC.
  • Most credit classes retire from 0.001 tonnes (1 kg); some retire in whole tonnes only. The discover call returns each class's minimum.
  • There is no testnet. Discover, quote and prepare-auth are free and move no funds, so an integration can be exercised up to the signature at no cost.
  • Two integration paths: free GET/POST endpoints where the agent submits from its own Base wallet, or one signed authorization where Carbonmark's executor submits onchain and covers gas (no ETH required).
  • Every agent-executed retirement resolves to a public Carbonmark certificate on Base — verifiable onchain, permanently.
  • A plugin for Base MCP is available for wallet-connected agent frameworks.

Frequently asked questions

Carbonmark x402 & MCP FAQ

Can AI agents buy carbon credits?

Yes. On Carbonmark, AI agents can autonomously purchase and retire verified carbon credits through our x402 endpoint — a machine-payable API built for agentic transactions. The agent discovers available credits, requests a live quote, executes the retirement onchain, and receives a public Carbonmark certificate as proof, all without a human clicking through a checkout flow. Any agent framework that can make HTTP requests can integrate, and wallet-connected agents can transact directly through our Base MCP integration.

What is Carbonmark's x402 endpoint?

Carbonmark's x402 endpoint is an API that lets AI agents and other HTTP clients retire tokenized carbon credits on the Base blockchain using the x402 payment protocol. It exposes a simple four-step flow — discover, quote, retire, certificate — and publishes a machine-readable manifest at /.well-known/x402.json, so agent crawlers and registries can find and index the service automatically. Discovery and quote calls are free; payment only occurs when a retirement is executed.

Can my agent pay for carbon credits over x402?

Yes. An agent that already pays for APIs over x402 can retire carbon the same way: it signs one standard USDC authorization on Base (EIP-3009, the same thing any x402 payment signs), and Carbonmark's executor submits the retirement onchain. No API key, account or subscription is involved. The endpoint runs on Base mainnet and takes USDC; pooled protocol supply also accepts kVCM.

What is the minimum amount of carbon an agent can retire?

Most credit classes on the x402 endpoint retire from 0.001 tonnes of CO2e, which is 1 kilogram. Some classes retire in whole tonnes only, and a marketplace listing can carry its own minimum set by the seller. The discover call returns the minimum for every class and listing, so an agent can check before it quotes.

How do I retire less than 1 kg per transaction, such as 50 grams?

Batch it. Record each transaction's amount in your own ledger and retire the running total each time it reaches 1 kg or more. One retirement then covers many small transactions, and its public certificate is the proof for all of them. Batching also keeps the cost sensible, because every retirement carries a small fixed minimum fee that would outweigh the credit itself on a 50-gram purchase.

Is there a sandbox or test mode for the x402 endpoint?

There is no testnet: the x402 endpoint runs on Base mainnet only. You can still test without spending anything, because discover, quote and prepare-auth are free and move no funds, so the whole flow can be run up to the signature. The smallest real retirement, 1 kg, costs a few US cents. If you want a sandbox with test keys and retirements that are never billed, the Carbonmark REST API has one; see carbonmark.com/api-and-integrations.

Does my AI agent need a crypto wallet or ETH to retire carbon?

No wallet with ETH is required. Carbonmark supports a gasless relay path: the user or agent signs a single EIP-712 authorization for the payment amount, and an executor submits the transaction onchain and covers the gas. This means agents can retire carbon with USDC alone — no Base account setup, no gas management, no bridging. Agents that do control their own funded wallet (for example, via Base MCP) can skip the relay and submit transactions directly.

How do I verify a retirement my AI agent made?

Every retirement — human- or agent-initiated — resolves to a public Carbonmark certificate URL showing the project, vintage, tonnage, retirement date, and named beneficiary. The underlying transaction is recorded on the Base blockchain, so the retirement can be independently verified onchain by anyone, at any time. Additionally, for enabled carbon registries, retirement events occurring onchain are also linked to retirement events in the credit's host registry on a one-to-one basis. Autonomous doesn't mean unaccountable: your agent returns a link, and that link is permanent, public proof.

What does agentic carbon retirement cost?

Calling the API is free — discovery, quotes, and integration carry no charge and no subscription. You pay only when a retirement executes: the quoted price includes the market price of the selected carbon credits plus the x402 fee, with no hidden costs added after the quote. Because quotes reflect live onchain pricing, your agent always knows the exact total before it commits. As a reference point, on 17 November 2026 retiring 1 kg of a wind-energy credit quoted 0.010041 USDC in total, of which 0.01 USDC was the fee; the gasless relay added about 0.017 USDC to reimburse the executor's gas.

How do I offset my AI app's usage and show public proof?

Estimate the emissions of your app's inference, keep a running total, and retire that amount on a schedule or each time the total passes 1 kg, naming your app as the beneficiary. Every retirement returns a public Carbonmark certificate URL showing the project, vintage, tonnage and beneficiary, backed by a transaction on Base that anyone can verify. Link those certificates from your site as the proof. Describe what you did in those terms, as tonnes of credits retired with the certificate to show for it, since rules on carbon-neutral claims differ by market.

Is an agent-initiated carbon retirement reversible?

No. Retirement permanently removes a carbon credit from circulation — the credit is burned onchain and can never be resold or reused, which is precisely what makes it a credible climate claim. That's also why the flow is quote-first: your agent receives the exact price, project, and tonnage before any payment is authorized, so nothing irreversible happens without an explicit, informed approval step. We recommend agents surface the quote to their user (or check it against configured limits, like a maximum price per tonne) before executing.

Which AI frameworks work with Carbonmark?

Any framework that can send HTTP requests can use the x402 endpoint directly. For deeper integrations, Carbonmark provides a plugin for Base MCP, allowing tools like Claude Code and other MCP-enabled agents to retire carbon from a plain-language instruction — for example, 'Retire 2 tonnes of carbon under $15 per tonne for Acme Corp.' See the integration docs for setup guides.