Loading...
Loading...
Monitor energy usage, carbon footprint, and compute costs across your entire AI fleet. Set budgets, track emissions by region and provider, and offset your impact.
import { DRD } from '@drd/sdk';
const drd = new DRD({ token: 'drd_live_sk_...' });
await drd.carbon.recordUsage({
agentId: 'agent_abc123',
provider: 'aws',
region: 'us-east-1',
computeType: 'gpu',
durationMs: 45000,
energyKwh: 0.15,
carbonGrams: 42.5,
cost: 0.23,
});Set monthly carbon limits with alert thresholds to stay within sustainability targets.
{
"name": "Production Fleet Budget",
"monthlyLimitKg": 500,
"alertThresholdPercent": 80,
"period": "2026-02",
"offsetCredits": 50.0
}Get aggregated views of your carbon footprint broken down by compute type and provider.
{
"totalRecords": 1247,
"totalCarbonGrams": 125430.5,
"totalEnergyKwh": 412.7,
"totalCost": 892.45,
"carbonByType": {
"gpu": 89200,
"inference": 28100,
"training": 8130
},
"carbonByProvider": {
"aws": 72000,
"gcp": 38430,
"azure": 15000
}
}DRD collects metrics at multiple granularity levels from individual API calls to workspace-wide aggregates.
Total energy consumed in kilowatt-hours. Measured per inference call, aggregated per agent, workspace, and billing period.
Estimated CO2-equivalent emissions. Calculated using region-specific grid carbon intensity data from Electricity Maps.
Allocated compute cost derived from GPU-hours, token throughput, and storage usage. Supports cost allocation tags.
Total tokens processed (input + output) across all agent operations. Broken down by model type and task category.
Total GPU compute hours consumed. Categorized by GPU type (A100, H100, etc.) and utilization percentage.
Composite efficiency metric: useful output per kWh. Benchmarked against industry averages for similar workloads.
| Level | Scope | Use Case |
|---|---|---|
| Per-Request | Individual API call or inference | Debugging, cost attribution for specific operations |
| Per-Agent | Single agent across all operations | Agent efficiency comparison, optimization targets |
| Per-Workspace | All agents in a workspace | Department billing, budget tracking |
| Per-Organization | All workspaces across the organization | ESG reporting, executive dashboards |
| Per-Model | Grouped by model type (e.g., GPT-5, Claude) | Model efficiency benchmarking, vendor comparison |
Carbon Intensity Data
DRD uses real-time grid carbon intensity data from Electricity Maps, updated every 15 minutes. When your workloads run in regions with high renewable energy penetration, your carbon footprint is automatically lower.
Set carbon and compute budgets with automatic alerts when thresholds are approached or exceeded.
| Budget Type | Alert Thresholds | Action on Exceed |
|---|---|---|
| Carbon (gCO2e/month) | 50%, 75%, 90%, 100% | Alert, throttle, or block |
| Compute (USD/month) | 50%, 75%, 90%, 100% | Alert, throttle, or block |
| GPU Hours (hours/month) | 75%, 90%, 100% | Alert or throttle |
| Token Budget (tokens/day) | 80%, 95%, 100% | Alert or block |
Enforcement Actions
When a budget is exceeded and the action is set to "block," all non-essential agent operations are paused until the next billing period. Critical operations (health checks, compliance audits) are exempt from blocking.
curl "https://api.drd.io/v1/carbon/agents/agt_01HQ3XBN4RTYP?period=2026-02" \
-H "Authorization: Bearer drd_ws_sk_live_Abc123..."
# Response
{
"ok": true,
"data": {
"agentId": "agt_01HQ3XBN4RTYP",
"period": "2026-02",
"energy": {
"totalKwh": 42.5,
"avgPerRequest": 0.0012
},
"carbon": {
"totalGCO2e": 12750,
"avgPerRequest": 0.36,
"gridIntensity": 300,
"region": "us-east-1"
},
"compute": {
"totalUsd": 285.40,
"gpuHours": 18.5,
"tokensProcessed": 45000000
},
"efficiency": {
"score": 78,
"benchmark": 65,
"percentile": 82
}
}
}curl "https://api.drd.io/v1/carbon/workspace?period=2026-02&groupBy=agent" \
-H "Authorization: Bearer drd_ws_sk_live_Abc123..."
# Response
{
"ok": true,
"data": {
"period": "2026-02",
"totals": {
"energyKwh": 312.8,
"carbonGCO2e": 93840,
"computeUsd": 2150.60,
"gpuHours": 142.3
},
"byAgent": [
{
"agentId": "agt_01HQ3XBN4RTYP",
"name": "content-guardian-v3",
"energyKwh": 42.5,
"carbonGCO2e": 12750,
"computeUsd": 285.40,
"efficiency": 78
}
],
"budget": {
"carbonLimit": 150000,
"carbonUsed": 93840,
"carbonUtilization": 0.626,
"computeLimit": 5000,
"computeUsed": 2150.60,
"computeUtilization": 0.430
}
}
}import { DRD } from '@drd/sdk';
const drd = new DRD({ apiKey: process.env.DRD_API_KEY });
// Get agent-level carbon metrics
const agentCarbon = await drd.carbon.agent('agt_01HQ3XBN4RTYP', {
period: '2026-02',
});
console.log(`Energy: ${agentCarbon.energy.totalKwh} kWh`);
console.log(`Carbon: ${agentCarbon.carbon.totalGCO2e} gCO2e`);
console.log(`Cost: $${agentCarbon.compute.totalUsd}`);
console.log(`Efficiency: ${agentCarbon.efficiency.score}/100`);
// Get workspace-wide summary
const workspace = await drd.carbon.workspace({
period: '2026-02',
groupBy: 'agent',
});
console.log(`Total carbon: ${workspace.totals.carbonGCO2e} gCO2e`);
console.log(`Budget utilization: ${(workspace.budget.carbonUtilization * 100).toFixed(1)}%`);
// Set a carbon budget with alerts
await drd.carbon.budgets.set({
type: 'carbon',
limit: 150000,
period: 'monthly',
alerts: [
{ threshold: 0.75, channels: ['email'] },
{ threshold: 0.90, channels: ['email', 'slack'] },
{ threshold: 1.0, channels: ['email', 'slack', 'sms'], action: 'throttle' },
],
});