greenai.guide

Home › How do I…? › How do I estimate the energy of my AI API calls?

How do I…?

How do I estimate the energy of my AI API calls?

Updated · 1 min read

In short

You can't meter hardware you don't control, so estimate instead: log input and output tokens per call and use a tool such as EcoLogits, which wraps your AI client and reports estimated energy and emissions per request. Label the figures as estimates, state the method, and replace them with supplier-reported numbers when you can get them.

Steps

  1. Log the model, input tokens and output tokens for every call, tagged with the feature that made it.
  2. Wrap your AI client with an estimator such as EcoLogits to get energy and emissions per request.
  3. Store the estimate next to latency and cost in your logs or dashboards.
  4. Review the heaviest features and prompts at each release.
  5. Ask your supplier for measured figures and swap them in when available.

Estimate from tokens, log it per call, and be clear it is an estimate. Hosted AI services give you no power meter, so heavy features and wasteful prompts stay invisible unless you build a number yourself.

Why tokens?

Energy rises with how much a model reads and writes. Epoch AI's bottom-up estimate puts a typical ChatGPT query at about 0.3 Wh, rising to about 2.5 Wh with a 10,000-token input and almost 40 Wh with a 100,000-token input. Your own token logs therefore tell you far more than any headline average.

Which tool should I use?

CodeCarbon's own guidance draws the line: use CodeCarbon for code running on hardware you manage, and EcoLogits for calls to remote generative AI services. EcoLogits wraps the client libraries of common AI providers and returns estimated energy and global-warming impact for each request, based on the model and token counts.

What should I record with each estimate?

  • the model and version, and the tool version used to estimate;
  • input and output tokens;
  • the feature or workflow that made the call;
  • whether the call succeeded, so you can count energy per successful task.

Common mistakes

More on methods and boundaries in how to measure AI energy.

Sources

  1. EcoLogits documentation, EcoLogits (2025)
  2. When to use CodeCarbon, CodeCarbon (2025)
  3. How much energy does ChatGPT use?, Epoch AI (2025)

Join us

Help cut AI's impact on the planet

Get new guides, funding calls and directory listings by email, about once a month. Or add your product, course, PhD or research to the directories.

No tracking. Unsubscribe in one click. Other ways to join · Privacy