Skip to main content
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

ModelCoefficientRelative Cost
gpt-3.5-turbo0.20Lowest
gemini-1.5-flash0.20Lowest
gemini-2.0-flash0.25Very low
claude-haiku-3.50.30Low
gemini-2.5-flash0.30Low
gpt-4o-mini0.30Low
gpt-5-mini0.35Low
o3-mini0.50Medium
o1-mini0.80Medium-high
gpt-4o1.00Baseline
claude-sonnet-41.00Baseline
gemini-1.5-pro1.00Baseline
gpt-51.20High
gemini-2.5-pro1.20High
gpt-4-turbo1.50High
gpt-41.50High
claude-opus-4.51.80Very high
o12.00Highest

Energy Caps

Set a maximum energy budget for a run:
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:
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):
ModelInputOutput
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