> ## 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.

# Incorporate on-site generation into cost calculations

If a PV or other local energy generation system is installed at the location and you have access to its production records, submit them **as they arrive**. This is particularly important if you use [Solar Generation Forecasts](/guides/schedule/solar-forecasts), as it ensures accurate local generation data is used for cost calculations.

The per-kWh cost is assumed to be zero unless the customer uses the [Connect](/guides/connect/settings-page#when-flatpeak-location-id-is-not-yet-available) to set a local generation price.

* Submit generation to [submit-meter-interval](/api-reference/anode/meters/submit-meter-interval) endpoint.
* If your system generates cumulative records, use [submit-meter-cumulative](/api-reference/anode/meters/submit-meter-cumulative) instead.
* Include relevant `device_id` and `location_id`
* Set `energy_flow_direction=INBOUND` and `tariff_direction=LOCAL`
* Set the `confidence` parameter to **1**

<CodeGroup>
  ```json Request example highlight={10} theme={"system"}
  curl --request PUT \
    --url https://api.flatpeak.com/meters/interval \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '[
    {
      "location_id": "loc_641b90b758fb8e6293716e40",
      "device_id": "dev_63a6087272941ef077a8fd3e",
      "energy_flow_direction": "INBOUND",
      "tariff_direction": "LOCAL",
      "confidence": 1,
      "units": "W",
      "value": 968,
      "start_time": "2025-08-01T10:30:00Z",
      "end_time": "2025-08-01T11:00:00Z",
    }
  ]'
  ```

  ```json Response example theme={"system"}
  {
    "id": "bat_65e42b7827c0526548432b9f",
    "object": "meter_batch",
    "records_submitted": 1,
    "records_accepted": 1,
    "records_processed": 1
  }
  ```
</CodeGroup>
