> ## Documentation Index
> Fetch the complete documentation index at: https://cascadeflow-docs-readme-hermes-callout.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Energy Tracking

> Deterministic compute-intensity coefficients for carbon-aware AI operations, with energy caps and per-model coefficients.

The harness tracks energy consumption using deterministic compute-intensity coefficients. This provides a proxy for carbon impact without requiring real-time power measurement.

## Energy Formula

```
energy_units = coefficient * (input_tokens + output_tokens * 1.5)
```

Output tokens are weighted 1.5x because generation is more compute-intensive than prompt processing.

## Energy Coefficients

| Model            | Coefficient | Relative Cost |
| ---------------- | ----------- | ------------- |
| gpt-3.5-turbo    | 0.20        | Lowest        |
| gemini-1.5-flash | 0.20        | Lowest        |
| gemini-2.0-flash | 0.25        | Very low      |
| claude-haiku-3.5 | 0.30        | Low           |
| gemini-2.5-flash | 0.30        | Low           |
| gpt-4o-mini      | 0.30        | Low           |
| gpt-5-mini       | 0.35        | Low           |
| o3-mini          | 0.50        | Medium        |
| o1-mini          | 0.80        | Medium-high   |
| gpt-4o           | 1.00        | Baseline      |
| claude-sonnet-4  | 1.00        | Baseline      |
| gemini-1.5-pro   | 1.00        | Baseline      |
| gpt-5            | 1.20        | High          |
| gemini-2.5-pro   | 1.20        | High          |
| gpt-4-turbo      | 1.50        | High          |
| gpt-4            | 1.50        | High          |
| claude-opus-4.5  | 1.80        | Very high     |
| o1               | 2.00        | Highest       |

## Energy Caps

Set a maximum energy budget for a run:

```python theme={null}
import cascadeflow

cascadeflow.init(mode="enforce")

with cascadeflow.run(max_energy=100.0) as session:
    result = await agent.run("Process this large dataset")

    summary = session.summary()
    print(f"Energy used: {summary['energy_used']:.1f} units")
```

When energy exceeds the cap:

* In `observe` mode: logged but not enforced
* In `enforce` mode: execution stops with `action: "stop"`

## Energy-Aware KPI Weights

Include energy in KPI weights for carbon-aware routing:

```python theme={null}
with cascadeflow.run(
    kpi_weights={"quality": 0.4, "cost": 0.3, "energy": 0.3}
) as session:
    # Routes toward lower-energy models when quality allows
    result = await agent.run("Summarize this article")
```

## Pricing Table

Full pricing for all 18 supported models (USD per 1M tokens):

| Model            | Input   | Output  |
| ---------------- | ------- | ------- |
| **OpenAI**       |         |         |
| gpt-4o           | \$2.50  | \$10.00 |
| gpt-4o-mini      | \$0.15  | \$0.60  |
| gpt-5            | \$1.25  | \$10.00 |
| gpt-5-mini       | \$0.20  | \$0.80  |
| gpt-4-turbo      | \$10.00 | \$30.00 |
| gpt-4            | \$30.00 | \$60.00 |
| gpt-3.5-turbo    | \$0.50  | \$1.50  |
| o1               | \$15.00 | \$60.00 |
| o1-mini          | \$3.00  | \$12.00 |
| o3-mini          | \$1.10  | \$4.40  |
| **Anthropic**    |         |         |
| claude-sonnet-4  | \$3.00  | \$15.00 |
| claude-haiku-3.5 | \$1.00  | \$5.00  |
| claude-opus-4.5  | \$5.00  | \$25.00 |
| **Google**       |         |         |
| gemini-2.5-flash | \$0.15  | \$0.60  |
| gemini-2.5-pro   | \$1.25  | \$10.00 |
| gemini-2.0-flash | \$0.10  | \$0.40  |
| gemini-1.5-flash | \$0.075 | \$0.30  |
| gemini-1.5-pro   | \$1.25  | \$5.00  |

<Tip>
  **Example walkthrough:** [KPI-Weighted Routing (energy profile)](/examples/kpi-weighted-routing) | **GitHub:** [examples/cost\_tracking.py](https://github.com/lemony-ai/cascadeflow/blob/main/examples/cost_tracking.py)
</Tip>
