environment_impact block alongside the model output. This data is calculated per request based on the actual provider, datacenter location, and measured Power Usage Effectiveness (PUE), giving you an accurate picture rather than broad estimates. Whether you are building sustainability dashboards, meeting ESG reporting obligations, or simply trying to make greener infrastructure choices, this field gives you the raw data to act on.
The environment_impact Response Field
Every chat completion response, embedding response, and other inference response from Meliai includes an environment_impact object at the top level. Here is a representative example:
number
Energy consumed by this request in kilowatt-hours, including overhead scaled by the datacenter PUE.
number
Carbon dioxide equivalent in grams, calculated from
energy_kwh and the grid carbon intensity at the datacenter location.number
Estimated water consumption in liters, derived from the datacenter’s Water Usage Effectiveness (WUE) and the energy consumed.
integer
Percentage of energy at the serving datacenter sourced from renewable generation, as reported by the provider.
number
Power Usage Effectiveness of the datacenter — the ratio of total facility energy to IT equipment energy. A PUE of 1.0 would be perfectly efficient; values closer to 1.0 are better.
string
The Meliai provider identifier that served this request, such as
"ovhcloud", "scaleway", or "hetzner".string
ISO 3166-1 alpha-2 country code of the datacenter that processed the request, for example
"FR", "DE", or "FI".Every Meliai inference response also includes a
billing_cost object at the top level alongside environment_impact. This field carries the monetary cost of the request broken down by token usage, letting you track both financial and environmental spend in a single response.Minimising Environmental Impact
Meliai’s:eco routing suffix biases the automatic provider selection toward datacenters with higher renewable energy percentages, lower grid carbon intensity, and better PUE scores. Switch to :eco by appending the suffix to your model ID — no other changes are required.
Python
Logging and Aggregating Carbon Per Request
The example below iterates over a list of prompts, accumulates the carbon cost of each response, and prints a total. Adapt this pattern to write metrics to your observability stack, database, or ESG reporting tool.Python
response.model_extra is the OpenAI Python SDK’s way of accessing fields that are not part of the standard OpenAI response schema. If you are using a different HTTP client, environment_impact is present at the top level of the JSON response body alongside id, object, choices, and usage.