Skip to content

Efficiency Score API

Get detailed efficiency score with component breakdown.

GET /v1/sustainability/efficiency-score

Overview

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

ParameterTypeRequiredDefaultDescription
start_datedateNo-Start date (YYYY-MM-DD)
end_datedateNo-End date (YYYY-MM-DD)
time_rangestringNolast_7_daysPreset 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

FieldTypeDescription
overall_scoreintegerCombined efficiency score (0-100)
gradestringLetter grade (A+ to F)
percentileintegerRank vs other users
componentsobjectScore breakdown by component
trendobjectScore change vs previous period
recommendationsarraySuggestions to improve

Score Components

ComponentWeightDescription
Carbon Savings Rate40%Carbon saved through model optimization and routing
Cache Hit Rate30%Percentage of requests served from semantic cache
Grid Efficiency30%How clean your provider grid mix is

Grade Scale

ScoreGrade
90-100A+
85-89A
80-84B+
75-79B
70-74C+
65-69C
60-64D
< 60F

See Also

Built with reliability in mind.