Skip to content

Proposal

AI companies and developers have no easy way to measure or offset the carbon footprint of their inference workloads. Provider dashboards show token counts but not emissions. Carbon credit markets exist but are inaccessible to individual developers. There's a gap between knowing AI has a footprint and being able to do anything about it - and regulatory pressure (CSRD, SEC climate disclosure) is making it urgent.

What Changes

  • Introduce a new FastAPI backend service that connects to AI provider accounts (OpenAI, Anthropic, OpenRouter) and automatically meters inference usage
  • Add an emissions calculation engine that converts token usage to CO2 estimates using versioned carbon factors
  • Build a Stripe-integrated billing system with free (analytics-only) and paid (credit retirement) tiers
  • Generate cryptographically signed carbon receipts with branded PDFs that anyone can verify independently
  • Provide a REST API consumed by a Next.js dashboard for usage analytics, per-model breakdowns, and cached vs. uncached token visibility
  • Add background job infrastructure (ARQ on Redis) for hourly polling, daily reconciliation, billing close, and audit pack generation

Capabilities

New Capabilities

Capability Description
Provider Connections Connect and manage AI provider API keys with encryption via AWS Secrets Manager, key validation, and status tracking
Telemetry Ingestion Poll provider usage APIs hourly with cursor-based retrieval, idempotency-based deduplication, and T+24h trailing reconciliation
Emissions Engine Calculate carbon emissions from token usage using versioned factors (tokens → energy → CO2) with uncertainty bounds and model-tier mapping
Billing & Subscriptions Stripe-integrated billing with Free / Starter / Growth / Scale / Enterprise tiers, subscription lifecycle, and webhook handling
Carbon Receipts Retire carbon credits at billing period close and generate Ed25519-signed receipts with branded PDFs and public verification endpoint
Project Organization Organize connections into projects with per-project analytics, workload routing, and CSV/JSON export
Audit & Compliance Generate monthly audit packs (zip) with receipts, calculation breakdowns, and methodology version for CSRD reporting
Health & Observability System health endpoint checking database, Redis, and polling recency, plus structured logging with correlation IDs

Greenfield project

No existing capabilities are modified - this is a new service.

Impact

  • New API service: FastAPI application with ~20 REST endpoints across connections, telemetry, receipts, billing, projects, export, and health
  • Database: 11 new PostgreSQL tables (Organization, Project, ProviderConnection, Workload, TelemetryEvent, CarbonCalculation, BillingPeriod, CarbonReceipt, CarbonFactors, AuditPack, PriorPeriodAdjustment)
  • External integrations: OpenAI / Anthropic / OpenRouter usage APIs, Stripe (subscriptions + webhooks), AWS Secrets Manager, AWS S3 (PDFs/zips), Clerk (JWT auth)
  • Infrastructure: ECS Fargate deployment with separate API and worker containers, PostgreSQL 16 (Supabase), Redis 7
  • Background jobs: 4 recurring jobs (hourly poll, daily reconciliation, T+48h billing close, monthly audit pack) via ARQ