Appearance
Sustainability Dashboard API
Get comprehensive sustainability metrics in a single request.
GET /v1/sustainability/dashboardOverview
The Dashboard endpoint returns all sustainability data needed for a complete overview:
- Summary KPIs - Total carbon, energy, efficiency score
- Time series - Carbon and energy over time
- Efficiency breakdown - Score components
- Optimization opportunities - Top recommendations
This is the recommended endpoint for initial dashboard load.
Request
bash
curl "https://api.gateflow.ai/v1/sustainability/dashboard?time_range=last_7_days" \
-H "Authorization: Bearer gw_prod_..."python
import requests
response = requests.get(
"https://api.gateflow.ai/v1/sustainability/dashboard",
headers={"Authorization": "Bearer gw_prod_..."},
params={
"time_range": "last_7_days",
"project_id": "proj_abc123"
}
)typescript
const response = await fetch(
'https://api.gateflow.ai/v1/sustainability/dashboard?time_range=last_7_days',
{
headers: {
'Authorization': 'Bearer gw_prod_...',
},
}
);Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
start_date | date | No | - | Start date (YYYY-MM-DD) |
end_date | date | No | - | End date (YYYY-MM-DD) |
time_range | string | No | last_7_days | Preset: last_7_days, last_30_days, this_month, this_quarter |
project_id | string | No | null | Filter by project |
team_id | string | No | null | Filter by team |
Response
json
{
"summary": {
"total_carbon_gco2e": 1250.5,
"total_energy_kwh": 2.5,
"total_requests": 15000,
"avg_carbon_per_request_gco2e": 0.083,
"efficiency_score": 78,
"carbon_trend_percent": -12.5,
"breakdown_by_model": [
{"model": "gpt-4o", "carbon_gco2e": 450.2, "percentage": 36.0},
{"model": "claude-sonnet-4-5", "carbon_gco2e": 350.1, "percentage": 28.0}
],
"breakdown_by_provider": [
{"provider": "openai", "carbon_gco2e": 650.3, "percentage": 52.0},
{"provider": "anthropic", "carbon_gco2e": 400.2, "percentage": 32.0}
]
},
"time_series": [
{
"date": "2024-01-09",
"carbon_gco2e": 180.5,
"energy_kwh": 0.36,
"requests": 2150
},
{
"date": "2024-01-10",
"carbon_gco2e": 175.2,
"energy_kwh": 0.35,
"requests": 2100
}
],
"efficiency": {
"overall_score": 78,
"components": {
"carbon_savings_rate": {"score": 82, "weight": 0.4},
"cache_hit_rate": {"score": 65, "weight": 0.3},
"grid_efficiency": {"score": 85, "weight": 0.3}
},
"grade": "B+",
"percentile": 75
},
"opportunities": [
{
"type": "model_downgrade",
"title": "Use smaller models for simple tasks",
"description": "15% of requests use GPT-4o for simple Q&A tasks",
"potential_savings_kg_co2": 2.5,
"implementation": "Enable intelligent routing with model=auto"
},
{
"type": "enable_caching",
"title": "Enable semantic caching",
"description": "Detected 25% duplicate queries that could be cached",
"potential_savings_kg_co2": 1.8,
"implementation": "Set caching=enabled in project settings"
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
summary | object | Aggregated KPIs |
summary.total_carbon_gco2e | number | Total carbon emissions in grams CO₂e |
summary.total_energy_kwh | number | Total energy consumption in kWh |
summary.efficiency_score | integer | Overall efficiency (0-100) |
summary.carbon_trend_percent | number | Change vs previous period |
time_series | array | Daily/hourly data points |
efficiency | object | Score breakdown |
opportunities | array | Top 5 optimization recommendations |
Time Range Presets
| Preset | Description |
|---|---|
last_7_days | Past 7 days including today |
last_30_days | Past 30 days including today |
this_month | Current calendar month |
this_quarter | Current calendar quarter |
Efficiency Score Components
The efficiency score (0-100) is calculated from three components:
| Component | Weight | Description |
|---|---|---|
| Carbon Savings Rate | 40% | % carbon saved vs baseline |
| Cache Hit Rate | 30% | % requests served from cache |
| Grid Efficiency | 30% | Grid carbon intensity vs global average |
See Also
- Summary API - Summary KPIs only
- Time Series API - Detailed time series
- Efficiency Score API - Score breakdown
- Optimization API - Full recommendations