> ## Documentation Index
> Fetch the complete documentation index at: https://docs.engrate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost of Energy

> One API for the full cost of energy — grid fees, taxes, transfer charges, and more.

The Cost of Energy API gives you programmatic access to the full cost stack for electricity consumers in Sweden: grid fees, energy tax, transfer charges, peak power fees, subscription fees, and everything else a Distribution System Operator (DSO) charges. Instead of implementing hundreds of rate plans one by one, you work with a single set of building blocks that covers every operator and fee type.

### How it works

Every cost component is described as a machine-readable **calculation pipeline** — a small, composable graph of operations like `multiply`, `add`, `constant`, `aggregate`, and `select`. The same fixed set of operations models everything from a flat monthly subscription fee to a peak-demand tariff with seasonal time-of-use bands.

```mermaid theme={null}
%%{init: {'theme': 'base'}}%%
flowchart LR
    subgraph pipeline[" Calculation Pipeline "]
        direction TB
        ds("energy consumption<br/><small>hourly · kWh</small>")
        mul("multiply<br/><small>× 0.36 SEK/kWh</small>")
        con("constant<br/><small>187.50 SEK · monthly</small>")
        add("add")
        cost("Cost")
        ds --> mul
        mul -->|energy tax| add
        con -->|subscription fee| add
        add -->|total| cost
    end
    class ds eg-dataset
    class mul,con,add eg-fn
    class cost eg-output
```

You can evaluate pipelines yourself in any language — or call our Calculate endpoint and get a step-by-step cost breakdown in the response.

### Why developers choose this

* **Implement once, expand across operators.** There are only a handful of operations to implement. Adding a new DSO means reading new pipeline definitions, not writing new code.
* **Rules change, your code doesn't.** When a DSO updates their rates, the pipeline definition updates — your integration stays the same.
* **Full transparency.** Every calculation returns the intermediate steps. No black boxes. You can audit, display, or optimize against every line item.
* **Calculate or optimise.** The same pipeline serves both: with concrete inputs it computes costs deterministically; with decision-variable inputs it produces variables and constraints for an optimisation solver.

### Coverage

Live in Sweden today — covering all DSOs with published tariffs. Designed for multi-market expansion across European markets.

### Get started

<Steps>
  <Step title="Sign up">
    Create an account at [console.engrate.io](https://console.engrate.io) and generate an API key.
  </Step>

  <Step title="Follow the quickstart">
    Go from zero to a working cost calculation in minutes with the [Cost of Energy Quickstart](/guides/cost-of-energy-quickstart).
  </Step>

  <Step title="Explore the API reference">
    Dive into [calculation pipelines](/api-reference/cost-of-energy/calculation-pipeline), [functions](/api-reference/cost-of-energy/functions/overview), and [conditions](/api-reference/cost-of-energy/conditions/overview).
  </Step>

  <Step title="Connect your AI tools">
    Use the [MCP integration](/guides/mcp) to explore tariffs and calculations from Claude, Cursor, or VS Code.
  </Step>
</Steps>

<Card title="API reference" icon="code" horizontal href="/api-reference/cost-of-energy/overview">
  Explore the Cost of Energy API — models, calculation pipelines, functions, and endpoints
</Card>
