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.
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.
MIT — Crbon Labs Inc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fdac6908e46eb28a56c38725ae1356ec5907bce6d72a7ed4dbe2bdfc691e7ec
|
|
| MD5 |
50e1b8505d49acb6ee47cd817aad82a9
|
|
| BLAKE2b-256 |
552ef7a223544be5b574c8cc7f132bf9c738a45eb4f8a22e978882d793470460
|
Provenance
The following attestation bundles were made for crbonfree-0.1.0.tar.gz:
Publisher:
publish.yml on Crbon-Labs-Inc/crbonfree-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crbonfree-0.1.0.tar.gz -
Subject digest:
9fdac6908e46eb28a56c38725ae1356ec5907bce6d72a7ed4dbe2bdfc691e7ec - Sigstore transparency entry: 1661983101
- Sigstore integration time:
-
Permalink:
Crbon-Labs-Inc/crbonfree-python-sdk@c654d17dee39aba3c73d72fbc6a783357c63220d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Crbon-Labs-Inc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c654d17dee39aba3c73d72fbc6a783357c63220d -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0e415a40bbdd49360bfc3eadb04eef10ccf56d3d9109e68d759c2b646af91b8
|
|
| MD5 |
fa49b0c23b639fa048d50e0f93e5ba55
|
|
| BLAKE2b-256 |
c1f8b9072a188974b9c8aabffe24f766fb43bfb648883ad2b73a9910c4535356
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crbonfree-0.1.0-py3-none-any.whl -
Subject digest:
c0e415a40bbdd49360bfc3eadb04eef10ccf56d3d9109e68d759c2b646af91b8 - Sigstore transparency entry: 1661983152
- Sigstore integration time:
-
Permalink:
Crbon-Labs-Inc/crbonfree-python-sdk@c654d17dee39aba3c73d72fbc6a783357c63220d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Crbon-Labs-Inc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c654d17dee39aba3c73d72fbc6a783357c63220d -
Trigger Event:
push
-
Statement type: