Appearance
Efficiency Score API
Get detailed efficiency score with component breakdown.
GET /v1/sustainability/efficiency-scoreOverview
The efficiency score (0-100) measures how sustainably you're using AI infrastructure. This endpoint returns the overall score and breakdown by component.
Request
bash
curl "https://api.gateflow.ai/v1/sustainability/efficiency-score?time_range=last_7_days" \
-H "Authorization: Bearer gw_prod_..."python
import requests
response = requests.get(
"https://api.gateflow.ai/v1/sustainability/efficiency-score",
headers={"Authorization": "Bearer gw_prod_..."},
params={"time_range": "last_7_days"}
)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 time range |
Response
json
{
"overall_score": 78,
"grade": "B+",
"percentile": 75,
"components": {
"carbon_savings_rate": {
"score": 82,
"weight": 0.4,
"description": "Carbon saved vs baseline through optimization",
"current_value": 0.32,
"benchmark": 0.25,
"unit": "percentage"
},
"cache_hit_rate": {
"score": 65,
"weight": 0.3,
"description": "Requests served from semantic cache",
"current_value": 0.18,
"benchmark": 0.25,
"unit": "percentage"
},
"grid_efficiency": {
"score": 85,
"weight": 0.3,
"description": "Grid carbon intensity vs global average",
"current_value": 120.5,
"benchmark": 400.0,
"unit": "gCO2/kWh"
}
},
"trend": {
"direction": "improving",
"change_percent": 5.2,
"previous_score": 74
},
"recommendations": [
"Enable semantic caching to improve cache hit rate",
"Consider using Sustain Mode for non-critical workloads"
]
}Response Fields
| Field | Type | Description |
|---|---|---|
overall_score | integer | Combined efficiency score (0-100) |
grade | string | Letter grade (A+ to F) |
percentile | integer | Rank vs other users |
components | object | Score breakdown by component |
trend | object | Score change vs previous period |
recommendations | array | Suggestions to improve |
Score Components
| Component | Weight | Description |
|---|---|---|
| Carbon Savings Rate | 40% | Carbon saved through model optimization and routing |
| Cache Hit Rate | 30% | Percentage of requests served from semantic cache |
| Grid Efficiency | 30% | How clean your provider grid mix is |
Grade Scale
| Score | Grade |
|---|---|
| 90-100 | A+ |
| 85-89 | A |
| 80-84 | B+ |
| 75-79 | B |
| 70-74 | C+ |
| 65-69 | C |
| 60-64 | D |
| < 60 | F |
See Also
- Dashboard API - All metrics
- Optimization API - Improvement recommendations