Skip to main content

Python SDK for the CrbonFree carbon-offset API

Project description

crbonfree

Measure and offset the carbon footprint of your AI workloads.
One SDK. Every major provider. Verified retirement receipts.

PyPI MIT Python CrbonFree


pip install crbonfree

What is CrbonFree?

CrbonFree meters the carbon emissions of your AI inference and turns them into verifiable offsets. Connect your provider accounts, and we measure the inference, give you the emissions data, and issue signed carbon retirement receipts you can hand to auditors.

Works with OpenAI, Anthropic, OpenRouter, AWS Bedrock, and growing.

Quickstart

Authenticate with an API key

Pass your key directly to the client:

from crbonfree import CrbonFree

crbon = CrbonFree(api_key="ck_live_...")

summary = crbon.telemetry.get_summary()
print(f"{summary.data.total_co2_kg} kg CO2 from your AI usage")

Or read it from the environment

Keep the key out of your source by reading it from CRBONFREE_API_KEY:

export CRBONFREE_API_KEY="ck_live_..."
import os
from crbonfree import CrbonFree

crbon = CrbonFree(api_key=os.environ["CRBONFREE_API_KEY"])

summary = crbon.telemetry.get_summary()
print(f"{summary.data.total_co2_kg} kg CO2 from your AI usage")

The API key is sent on every request as the X-API-Key header.

Async

An async client ships alongside the sync one:

import asyncio
from crbonfree import AsyncCrbonFree

async def main():
    crbon = AsyncCrbonFree(api_key="ck_live_...")
    summary = await crbon.telemetry.get_summary()
    print(f"{summary.data.total_co2_kg} kg CO2 from your AI usage")

asyncio.run(main())

What you can do

Method What it returns
Measure crbon.telemetry.get_summary() Total CO2, per-model rollups, daily chart
Analyze crbon.usage.get_breakdown() Which models cost the most carbon
Organize crbon.projects.list() Track emissions by project / team
Prove crbon.billing.list_receipts() Signed carbon retirement receipts
Audit crbon.billing.list_audit_packs() CSRD-ready compliance artifacts
Manage crbon.apikeys.create() Programmatic API key management

Pagination

Listing endpoints accept page and limit parameters directly:

receipts = crbon.billing.list_receipts(page=1, limit=20)
for receipt in receipts.data:
    print(receipt.serial_number)

What's next

Ergonomic auto-pagination helpers and a crbonfree login CLI for zero-config, browser-based authentication are coming in a fast-follow release.


Dashboard  ·  Issues  ·  Website

MIT — Crbon Labs Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crbonfree-0.1.0.tar.gz (95.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crbonfree-0.1.0-py3-none-any.whl (169.0 kB view details)

Uploaded Python 3

File details

Details for the file crbonfree-0.1.0.tar.gz.

File metadata

  • Download URL: crbonfree-0.1.0.tar.gz
  • Upload date:
  • Size: 95.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crbonfree-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9fdac6908e46eb28a56c38725ae1356ec5907bce6d72a7ed4dbe2bdfc691e7ec
MD5 50e1b8505d49acb6ee47cd817aad82a9
BLAKE2b-256 552ef7a223544be5b574c8cc7f132bf9c738a45eb4f8a22e978882d793470460

See more details on using hashes here.

Provenance

The following attestation bundles were made for crbonfree-0.1.0.tar.gz:

Publisher: publish.yml on Crbon-Labs-Inc/crbonfree-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crbonfree-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crbonfree-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 169.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crbonfree-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0e415a40bbdd49360bfc3eadb04eef10ccf56d3d9109e68d759c2b646af91b8
MD5 fa49b0c23b639fa048d50e0f93e5ba55
BLAKE2b-256 c1f8b9072a188974b9c8aabffe24f766fb43bfb648883ad2b73a9910c4535356

See more details on using hashes here.

Provenance

The following attestation bundles were made for crbonfree-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Crbon-Labs-Inc/crbonfree-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page