{"openapi":"3.1.0","info":{"title":"EcoLogits API","description":"**EcoLogits API** provides a language-agnostic HTTP interface to the\n[EcoLogits](https://ecologits.ai) library, so any stack — not just Python — can\nestimate the environmental footprint of generative-AI inference.\n\n## What is EcoLogits?\n\nEcoLogits is an open-source project (part of the CodeCarbon non-profit) that estimates\nthe environmental impacts of AI model usage at inference time.\nIt follows Life Cycle Assessment (LCA) principles defined by ISO 14044.\n\n## Environmental metrics\n\n| Metric | Unit | Description |\n|---|---|---|\n| **Energy** | kWh | Energy consumed by the request |\n| **GWP** (Global Warming Potential) | kgCO₂eq | Greenhouse gas emissions |\n| **ADPe** (Abiotic Depletion Potential) | kgSbeq | Mineral & metal resource depletion |\n| **PE** (Primary Energy) | MJ | Total primary energy consumed |\n| **WCF** (Water Consumption Footprint) | L | Fresh water consumed by data centers and power generation, not returned to its source |\n\nResults are returned as **approximation intervals** (min/max range), not single point estimates.\n\n## Useful links\n\n- [EcoLogits documentation](https://ecologits.ai/)\n- [Methodology](https://ecologits.ai/latest/methodology/)\n- [GitHub repository](https://github.com/mlco2/ecologits)\n","contact":{"name":"EcoLogits","url":"https://ecologits.ai/"},"version":"0.0.2beta"},"paths":{"/v1beta/providers":{"get":{"tags":["Catalog"],"summary":"List all supported providers","operationId":"get_providers_v1beta_providers_get","responses":{"200":{"description":"List of provider identifiers.","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Providers V1Beta Providers Get"},"example":{"providers":["anthropic","mistralai","openai","huggingface_hub","cohere","google_genai"]}}}}}}},"/v1beta/models/{provider_name}":{"get":{"tags":["Catalog"],"summary":"List models for a provider","description":"Models may include **warning** and **error** indicators ([details](https://ecologits.ai/latest/tutorial/warnings_and_errors/)).","operationId":"get_models_v1beta_models__provider_name__get","parameters":[{"name":"provider_name","in":"path","required":true,"schema":{"type":"string","title":"Provider Name"}}],"responses":{"200":{"description":"List of models for the provider.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Models V1Beta Models  Provider Name  Get"},"example":{"models":[{"provider":"openai","name":"gpt-4o-mini","architecture":{"type":"moe","parameters":{"total":440,"active":{"min":44,"max":132}}},"warnings":[{"code":"model-arch-not-released","message":"The model architecture has not been released, expect lower precision."}],"sources":[]}]}}}},"404":{"description":"Provider not found.","content":{"application/json":{"example":{"detail":"Provider not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1beta/electricity-mix-zones/{zone}":{"get":{"tags":["Electricity mix"],"summary":"Get electricity mix for a zone","description":"Use ISO 3166-1 alpha-3 codes (`USA`, `FRA`, `DEU`) (or `WOR` for World average).","operationId":"get_electricity_mix_zones_v1beta_electricity_mix_zones__zone__get","parameters":[{"name":"zone","in":"path","required":true,"schema":{"type":"string","title":"Zone"}}],"responses":{"200":{"description":"Electricity mix composition for the specified zone.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Electricity Mix Zones V1Beta Electricity Mix Zones  Zone  Get"},"example":{"electricity_mix":{"zone":"FRA","adpe":4.858e-08,"pe":9.3135,"gwp":0.04418,"wue":3.6737}}}}},"404":{"description":"Zone not supported by EcoLogits.","content":{"application/json":{"example":{"detail":"Electricity mix zone 'XYZ' is not supported by EcoLogits"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1beta/estimations":{"post":{"tags":["Estimations"],"summary":"Estimate environmental impacts of an LLM request","operationId":"post_estimations_v1beta_estimations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_post_estimations_v1beta_estimations_post"}}},"required":true},"responses":{"200":{"description":"Environmental impact estimation with min/max intervals.","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Estimations V1Beta Estimations Post"},"example":{"impacts":{"energy":{"type":"energy","name":"Energy","value":{"min":1.740232832301384e-05,"max":2.1502108309942407e-05},"unit":"kWh"},"gwp":{"type":"GWP","name":"Global Warming Potential","value":{"min":8.448613075332601e-06,"max":1.0387850006949683e-05},"unit":"kgCO2eq"},"adpe":{"type":"ADPe","name":"Abiotic Depletion Potential (elements)","value":{"min":1.2955834115064265e-11,"max":1.3011140147087931e-11},"unit":"kgSbeq"},"pe":{"type":"PE","name":"Primary Energy","value":{"min":4.76420806326274e-05,"max":5.82486214368103e-05},"unit":"MJ"},"wcf":{"type":"WCF","name":"Water Consumption Footprint","value":{"min":9.151188371940057e-05,"max":0.00011307098675866313},"unit":"L"},"usage":{"type":"usage","name":"Usage","energy":{"type":"energy","name":"Energy","value":{"min":1.740232832301384e-05,"max":2.1502108309942407e-05},"unit":"kWh"},"gwp":{"type":"GWP","name":"Global Warming Potential","value":{"min":8.231475320068776e-06,"max":1.0170712251685857e-05},"unit":"kgCO2eq"},"adpe":{"type":"ADPe","name":"Abiotic Depletion Potential (elements)","value":{"min":2.3475740907745673e-13,"max":2.9006344110112307e-13},"unit":"kgSbeq"},"pe":{"type":"PE","name":"Primary Energy","value":{"min":4.5021563604469106e-05,"max":5.5628104408652e-05},"unit":"MJ"},"wcf":{"type":"WCF","name":"Water Consumption Footprint","value":{"min":9.151188371940057e-05,"max":0.00011307098675866313},"unit":"L"}},"embodied":{"type":"embodied","name":"Embodied","gwp":{"type":"GWP","name":"Global Warming Potential","value":{"min":2.1713775526382546e-07,"max":2.1713775526382546e-07},"unit":"kgCO2eq"},"adpe":{"type":"ADPe","name":"Abiotic Depletion Potential (elements)","value":{"min":1.2721076705986809e-11,"max":1.2721076705986809e-11},"unit":"kgSbeq"},"pe":{"type":"PE","name":"Primary Energy","value":{"min":2.6205170281582953e-06,"max":2.6205170281582953e-06},"unit":"MJ"}},"warnings":[{"code":"model-arch-not-released","message":"The model architecture has not been released, expect lower precision."},{"code":"model-arch-multimodal","message":"The model architecture is multimodal, expect lower precision."}]}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_post_estimations_v1beta_estimations_post":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider identifier (use `GET /v1beta/providers` to list valid values).","examples":["openai"]},"model_name":{"type":"string","title":"Model Name","description":"Model identifier as registered in EcoLogits (use `GET /v1beta/models/{provider}` to list valid values).","examples":["gpt-4o-mini"]},"output_token_count":{"type":"integer","title":"Output Token Count","description":"Number of tokens generated by the model.","examples":[300]},"request_latency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Request Latency","description":"Measured request latency in seconds.","examples":[1.5]},"electricity_mix_zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Electricity Mix Zone","description":"ISO 3166-1 alpha-3 zone code for the electricity mix. Defaults to `WOR` (world average). (use `GET /v1beta/electricity-mix-zones/{zone}` to check zone availability)","examples":["WOR"]}},"type":"object","required":["provider","model_name","output_token_count"],"title":"Body_post_estimations_v1beta_estimations_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"tags":[{"name":"Estimations","description":"Estimate the environmental impacts of an LLM inference request."},{"name":"Catalog","description":"Browse the AI providers and models supported by EcoLogits. Use these endpoints to discover valid values for the estimation request."},{"name":"Electricity mix","description":"Retrieve the electricity mix composition for a given geographic zone. This data is used to calculate carbon impacts."}]}