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

# Calculate and report energy cost with Flatpeak

After your system has generated, consumed, or exported energy, you can calculate the corresponding import cost or export value.

The simplest way is to submit meter records from your devices to Flatpeak and let it calculate the cost automatically. Flatpeak also keeps historical values up to date if past energy prices change — for example, after market settlements or provider changes.

You can view instant cost results for each record or fetch aggregated totals for any period (e.g. day, week, month, or year).

To implement, choose one of the two main options:

* **Submit device meter records** and let Flatpeak calculate the cost or value (recommended)
* **Retrieve energy prices** from Flatpeak and calculate the cost or value within your own system

<Tabs>
  <Tab title="Calculate with Flatpeak">
    <Frame>
      <img src="https://mintcdn.com/flatpeak/TQaxvXRAD8Q-IDz9/images/anode/reporting/reporting-realtime.png?fit=max&auto=format&n=TQaxvXRAD8Q-IDz9&q=85&s=b9fa83f5f1708cddf8468edfed72c2b9" alt="Realtime" width="3540" height="1892" data-path="images/anode/reporting/reporting-realtime.png" />
    </Frame>

    Follow the guide below that matches your use case — you may want to implement both:

    <CardGroup cols={1}>
      <Card title="Instant cost calculation" icon="bolt" horizontal href="/guides/calculate/instant">
        Ingests a meter record and instantly returns energy cost (or export value).
      </Card>

      <Card title="Historic cost reporting" icon="clock-rotate-left" horizontal href="/guides/calculate/historic">
        Calculates energy cost (or export value) from previously submitted meter records.
      </Card>
    </CardGroup>
  </Tab>

  <Tab title="Retrieve price">
    <Frame>
      <img src="https://mintcdn.com/flatpeak/TQaxvXRAD8Q-IDz9/images/anode/reporting/reporting-retrieve-prices.png?fit=max&auto=format&n=TQaxvXRAD8Q-IDz9&q=85&s=ab6be67bab04fb045266e310195e15a5" alt="Prices" width="3540" height="1892" data-path="images/anode/reporting/reporting-retrieve-prices.png" />
    </Frame>

    Follow the guide below — it’s the same process used to fetch future prices for scheduling.

    We recommend **re-fetching price before any calculation**, as they may have been retrospectively updated by the market or provider.

    <Card title="Retrieve energy price" icon="coins" horizontal href="/guides/connect/retrieve-price">
      Ask Flatpeak for the energy price and create a full schedule yourself.
    </Card>
  </Tab>
</Tabs>
