# HTTP API

## Overview

The HTTP API lets you interact with the assets of a site using simple request/response calls. You can use it to:

- discover the sites and assets you have access to,
- query historical metrics, status events, alerts and configuration,
- send commands to steer the assets.

All data is exchanged as JSON.

Data exposed by this API is cleaned, preprocessed and aggregated on our side to guarantee consistency and reliability. As a consequence, the most recent data point is typically 5 to 10 minutes old. Steering commands, on the other hand, are applied in real time. If you need lower-latency data, consider using our MQTT API instead.

Two environments are available to partners:

| Environment | Host |
| --- | --- |
| `Production` | [https://api.octave.energy](<https://api.octave.energy>) |
| `Integration` | [https://api.integration.octave.energy](<https://api.integration.octave.energy>) |

Use the integration environment for development and testing: it lets you safely exercise the API without affecting production sites.

### Security

The HTTP API is protected by mTLS and an API key. Every request must present a valid client certificate and include the API key in the `x-api-key` header. See the [Credentials setup](<https://docs.octave.energy/partner_api/onboarding.html#1-credentials-setup>) section for details.

Rate limits are in place to prevent abuse and ensure fair usage. If you run into rate limiting issues, please contact us.

### OpenAPI Specification

The complete HTTP API is described by an OpenAPI specification, available .

### Data conventions

- Data is available for up to 1 year in the past.
- Metrics are time series that we process, resample and aggregate. Depending on the metric, they are available per asset/device, aggregated per plant, or both.
- Metrics can be queried per minute or per quarter-hour:

  - per minute: up to 1 day of data per request,
  - per quarter-hour: up to 15 days of data per request.
- Percentage metrics (typically suffixed with `_pct`) are expressed between 0 and 100.
- Missing data points are returned as `null` so that responses always have a consistent shape. For example, if you request 4 minutes of data and one of those minutes has no recorded value, that minute still appears in the response, with a `null` value. We never interpolate missing data.

## Getting started

The typical workflow using the API is as follows:

1. Get a list of sites your account has access to.
2. Discover the available assets on a site.
3. Read metrics/data from these assets.
4. Steering assets (optional).

The example scripts below show how to use the HTTP API from Python, in the order you would typically perform these actions. You can run them locally with `uv run <script_name.py>`.

The scripts assume you already have an API key and client certificates. Adjust the file paths in the script to point to your credentials, or store them where the script expects them.

> [!NOTE]
>
> **Check the OpenAPI specification**
>
> The examples below illustrate typical usage patterns to help you get started. They show one example per type of endpoint and do not cover every endpoint, metric or parameter. For the complete reference, see the [OpenAPI specification](<#openapi-specification>).

Basic HTTP api calling

```python
# /// script
# dependencies = [
#   "niquests",
#   "mh-structlog",
# ]
# ///

import json
from datetime import UTC, datetime, timedelta  # ruff: ignore[unused-import]
from pathlib import Path

import mh_structlog
import niquests

mh_structlog.setup()
logger = mh_structlog.get_logger()

# Ensure these files contain the correct information for your situation
api_key = Path("/tmp/api_key.txt").read_text('utf-8').strip()  # ruff: ignore[hardcoded-temp-file]
cert_pem = "/tmp/client_cert.pem"  # ruff: ignore[hardcoded-temp-file]
cert_key = "/tmp/client_key.key"  # ruff: ignore[hardcoded-temp-file]

# Do an api call
response = niquests.get(
    url="https://api.octave.energy/<some-path>",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    params={},  # some query parameters
    json={},  # some body
)

# Log the response
logger.info(
    "Response received:\n%s",
    json.dumps(response.json(), indent=4),
    status_code=response.status_code,
    url=response.request.url,
    response_headers=response.headers,
)
```

### List available sites

This endpoint returns the list of sites your account has access to.

Get sites info

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/info",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

> [!NOTE]
>
> If you do not have access to any site yet, this endpoint returns an empty list rather than an error. This makes it a convenient way to check that your credentials are set up correctly.

Example response (values are illustrative):

```json
[
    {
        "site_id": "b89e5b7c-8e73-4a80-bfc6-1b5e81a62cb6",
        "label": "Octave Office 1",
        "latitude": 51.050278,
        "longitude": 4.444874,
        "street": "ZANDVOORTSTRAAT 12A",
        "city": "Mechelen",
        "postal_code": "2800",
        "country_code": "BE",
        "region": "Flanders",
        "state": "Antwerp",
        "commissioning_date": "2025-04-18T07:08:38.407000Z"
    }
]
```

The `site_id` identifies the site in every other API request related to that site.

The `commissioning_date` is the moment the site became operational. No data is available before this timestamp.

### Asset discovery

Once you have a `site_id`, you can list the assets installed on that site.

Get BESS assets info

```python
site_id = "43a69a32-cc1a-449f-a80c-2f547a6cbef0"  # replace with the actual site_id you want to query
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/bess/info",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "43a69a32-cc1a-449f-a80c-2f547a6cbef0",
    "bess": [
        {
            "bess_index": 1,
            "serial_number": null,
            "vendor_model_reference": "OCTAVE_ONE_PLUS",
            "label": null,
            "max_charge_power_kw": 125.0,
            "max_discharge_power_kw": 125.0,
            "min_soc": 0.03,
            "max_soc": 1.0,
            "capacity_kwh": 261.0
        }
    ]
}
```

The `bess_index` identifies a BESS asset within the site. Use it to query or steer that specific BESS.

Get site power meter info

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/power_meter/info",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "4d15479f-8add-4691-bcff-e7bf3009a6cc",
    "power_meters": [
        {
            "meter_index": 1,
            "meter_type": "SITE",
            "label": null,
            "data_transfer_type": "modbus_tcp",
            "vendor_model_reference": null,
            "serial_number": null,
            "network_host": "10.0.30.3",
            "network_mac_address": "00:80:67:90:ee:34"
        }
    ]
}
```

The `meter_index` identifies a power meter within the site. Use it to query that specific meter.

Get Solar/PV info

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/pv/info",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "4d15479f-8add-4691-bcff-e7bf3009a6cc",
    "pvs": [
        {
            "pv_index": 1,
            "label": null,
            "data_transfer_type": "modbus_tcp",
            "vendor_model_reference": "Huawei - Smart Logger 3000",
            "serial_number": null,
            "network_host": "10.0.30.99",
            "network_mac_address": "a4:6d:a4:2d:66:83",
            "is_controlled": false
        }
    ]
}
```

The `pv_index` identifies a Solar/PV asset within the site. Use it to query or steer that specific asset. `is_controlled` indicates whether the Octave EMS is allowed to curtail this asset.

### Site configuration

This endpoint returns the grid connection settings of a site: injection and offtake capacities, maximum current per phase, and peak shaving target.

The response is a history of configuration changes rather than a single snapshot. Each event describes the full configuration from its `timestamp` until the next event. To make it easy to know the configuration at the start of your time range, the response always includes the last event before `start_timestamp`. `end_timestamp` is optional: when omitted, all events from `start_timestamp` onwards are returned.

Get the configuration of a site

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/config",
    params={
        'start_timestamp': '2026-08-23T00:00:00Z',
        'end_timestamp': '2026-09-23T23:59:59Z',
    },
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "97cae0aa-80f3-49d1-9d8e-395b59f5f721",
    "config_change_events": [
        {
            "timestamp": "2026-08-01T10:15:00Z",
            "site_injection_capacity_kw": 500.0,
            "site_offtake_capacity_kw": 800.0,
            "site_max_current_per_phase_a": null,
            "site_peak_shaving_target_kw": null
        },
        {
            "timestamp": "2026-09-10T08:00:00Z",
            "site_injection_capacity_kw": 500.0,
            "site_offtake_capacity_kw": 750.0,
            "site_max_current_per_phase_a": 250.0,
            "site_peak_shaving_target_kw": 600.0
        }
    ]
}
```

### Get alerts for site

This endpoint returns the alerts that were active at any moment during the requested time range. This includes alerts that started before `start_timestamp` or ended after `end_timestamp`, as long as they overlap with the range.

Get alerts for a site

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/alerts",
    params={
        'start_timestamp': '2026-08-23T00:00:00Z',
        'end_timestamp': '2026-09-23T23:59:59Z',
    },
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "97cae0aa-80f3-49d1-9d8e-395b59f5f721",
    "alerts": [
        {
            "start_time": "2026-08-28T07:43:20Z",
            "end_time": "2026-08-28T09:08:20Z",
            "current_status": "resolved",
            "severity": "ERROR",
            "name": "BESS \u2014 PCS Alert",
            "description": "This alert is triggered when the PCS is in fault, for any inverter in the BESS plant. As a result, the BESS may operate sub-optimally, at a reduced power rate, or become completely unavailable.\r\n\r\nThe alert is evaluated every 5 minutes.",
            "documentation_link": "https://ems.octave.energy/alerts/alert-bess-pcs",
            "bess_index": 0,
            "sn_device": "120449"
        },
        {
            "start_time": "2026-09-01T17:03:20Z",
            "end_time": "2026-09-01T18:23:20Z",
            "current_status": "resolved",
            "severity": "ERROR",
            "name": "BESS \u2014 PCS Alert",
            "description": "This alert is triggered when the PCS is in fault, for any inverter in the BESS plant. As a result, the BESS may operate sub-optimally, at a reduced power rate, or become completely unavailable.\r\n\r\nThe alert is evaluated every 5 minutes.",
            "documentation_link": "https://ems.octave.energy/alerts/alert-bess-pcs",
            "bess_index": 0,
            "sn_device": "120449"
        }
    ]
}
```

### Get metrics

All endpoints ending in `/metrics` work the same way. The example below uses BESS PCS metrics.

Besides the time range and the metric names, you must provide the `period` query parameter, expressed in seconds:

- `60` for per-minute values,
- `900` for per-quarter-hour values.

Fetching BESS metrics

```python
bess_index = 1
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/bess/unit/{bess_index}/pcs/metrics",
    params={
        'start_timestamp': '2026-09-22T23:20:00Z',
        'end_timestamp': '2026-09-22T23:30:00Z',
        'period': '60',  # query per minute = 60 seconds
        'name': ['active_power_in_kw', 'active_power_out_kw'],
    },
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "97cae0aa-80f3-49d1-9d8e-395b59f5f721",
    "start_timestamp": "2026-09-22T23:20:00Z",
    "end_timestamp": "2026-09-22T23:30:00Z",
    "period_seconds": 60,
    "metrics": [
        {
            "bess_index": 1,
            "name": "active_power_in_kw",
            "values": [
                2.54,
                0.11,
                0.0,
                0.0,
                0.0,
                1.92,
                2.3,
                0.61,
                0.24,
                0.77,
                0.01
            ]
        },
        {
            "bess_index": 1,
            "name": "active_power_out_kw",
            "values": [
                0.0,
                0.0,
                -1.49,
                -0.02,
                -1.62,
                -0.03,
                0.0,
                0.0,
                0.0,
                0.0,
                -6.85
            ]
        }
    ]
}
```

Each `values` array holds one value per period. Timestamps are not repeated in the response: the timestamp of the value at index `i` is `start_timestamp + i × period_seconds`.

### Get status events

Status endpoints return the state changes of the site components (e.g. the operating state of a BESS inverter). Depending on the endpoint, events are available per device/asset or aggregated per site.

The response contains every state change that occurred between `start_timestamp` and `end_timestamp`. Unlike metrics, status events are not resampled: each event keeps its exact timestamp. For convenience, the last event before `start_timestamp` is also included, so you always know the state at the beginning of the range.

Reading BESS PCS Status Events

```python
bess_index = 1
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/bess/unit/{bess_index}/pcs/status",
    params={
        'start_timestamp': '2026-09-23T00:00:00Z',
        'end_timestamp': '2026-09-23T23:00:00Z',
        'name': [
            'operating_vendor_state_events',
            'operating_octave_state_events',
            'vendor_fault_state_events',
            'vendor_fault_code_events',
        ],
    },
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
)
```

Example response (values are illustrative):

```json
{
    "site_id": "89ac3726-d1d0-4f9d-a6fc-1a5c68d639bb",
    "operating_vendor_state_events": [],
    "operating_octave_state_events": [
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T00:00:00Z",
            "operating_octave_state": "OFF"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:46:57.756000Z",
            "operating_octave_state": "UNKNOWN"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:47:17.009000Z",
            "operating_octave_state": "ERROR"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:47:29.045000Z",
            "operating_octave_state": "OFF"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:47:30.059000Z",
            "operating_octave_state": "PRECHARGE"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:47:49.478000Z",
            "operating_octave_state": "STANDBY"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:48:00.512000Z",
            "operating_octave_state": "STARTING"
        },
        {
            "bess_index": 1,
            "timestamp": "2026-09-23T07:49:01.244000Z",
            "operating_octave_state": "GRID_CONNECTED"
        }
    ],
    "vendor_fault_state_events": [],
    "vendor_fault_code_events": []
}
```

### Configure peak shaving

The peak shaving target is the maximum power the site should take from the grid. When it is set, the battery discharges as needed to keep the site offtake below this value. You can set, clear and read this target through the API.

Setting the peak shaving target is useful for managing the monthly capacity cost of the site.

> [!NOTE]
>
> If you observe that the battery is discharging while you haven't send a discharge command, it is very likely that the peak shaving target is set and the battery is actively managing the site's offtake to stay below this target. Clearing the peak shaving target will stop this behavior.

Setting a Peak Shaving Target

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/set_peak_shaving_target",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={"peak_shaving_target_kw": 48},
)
```

Example response (values are illustrative):

```json
{
    "site_id": "b89e5b7c-8e73-4a80-bfc6-1b5e81a62cb6",
    "peak_shaving_target_kw": 48.0
}
```

To clear the target, call the same endpoint with `null`:

Clearing the Peak Shaving Target

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/set_peak_shaving_target",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={"peak_shaving_target_kw": None},
)
```

Example response (values are illustrative):

```json
{
    "site_id": "b89e5b7c-8e73-4a80-bfc6-1b5e81a62cb6",
    "peak_shaving_target_kw": null
}
```

The current target, and its history, is returned by the [site configuration](<#site-configuration>) endpoint:

Getting the Peak Shaving Target values

```python
response = niquests.get(
    url=f"https://api.octave.energy/site/{site_id}/config",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    params={
        "start_timestamp": "2026-10-08T20:00:00Z",
        "end_timestamp": "2026-10-08T21:00:00Z",
    },
)
```

After setting and then clearing the target as shown above, a typical response looks like this:

```json
{
    "site_id": "b89e5b7c-8e73-4a80-bfc6-1b5e81a62cb6",
    "config_change_events": [
        {
            "timestamp": "2026-10-08T16:56:39Z",
            "site_injection_capacity_kw": 35.0,
            "site_offtake_capacity_kw": 45.0,
            "site_max_current_per_phase_a": 55.0,
            "site_peak_shaving_target_kw": 46.0
        },
        {
            "timestamp": "2026-10-08T20:46:09Z",
            "site_injection_capacity_kw": 35.0,
            "site_offtake_capacity_kw": 45.0,
            "site_max_current_per_phase_a": 55.0,
            "site_peak_shaving_target_kw": 48.0
        },
        {
            "timestamp": "2026-10-08T20:49:53Z",
            "site_injection_capacity_kw": 35.0,
            "site_offtake_capacity_kw": 45.0,
            "site_max_current_per_phase_a": 55.0,
            "site_peak_shaving_target_kw": null
        }
    ]
}
```

The peak shaving target is shown in the portal, on the `Overview` tab.

[![Peak shaving target visualized in the portal](<https://docs.octave.energy/partner_api/assets/peak_shaving.png>)](<https://docs.octave.energy/partner_api/assets/peak_shaving.png>)

Peak shaving target visualized in the portal

### Steering a BESS

You steer the BESS plant of a site by sending a **schedule**: a list of commands, each applying during its own time window. This lets you send a complete plan in a single request, for example the charge/discharge plan of the next day.

How schedules work:

- **Time windows**: each command applies from `start_dt` (included) to `end_dt` (excluded). Timestamps must include a timezone. Time windows of a schedule must not overlap.
- **Each schedule replaces the previous one**: every request overrides the full schedule previously sent. Always send the complete plan you want the BESS to follow, not only the new commands. Sending an empty list of commands cancels the current plan.
- **Outside of any command**: when no command covers the current time, the BESS stays idle (0 kW). However, we report this as an abnormal operation and it is reported as a downtime event. Hence why it is important to always provide a complete schedule covering the desired operation periods.
- **Safety limits always apply**: whatever the command, the EMS keeps the BESS within its own limits (min/max state of charge, max charge/discharge power) and within the site grid connection limits (injection/offtake capacities, max current per phase, peak shaving target). The power actually applied can therefore differ from the requested one.

Sign conventions:

- Battery power: **positive charges** the battery, **negative discharges** it.
- Site power: **positive is offtake** from the grid, **negative is injection** into the grid.

#### Command types

Three types of commands are available, selected with the `command_type` field.

`"command_type": "BESS"` sets the power of the battery directly. The battery charges or discharges at the requested power, regardless of what happens on the rest of the site.

| Field | Unit | Required | Description |
| --- | --- | --- | --- |
| `active_power` | kW | yes | Battery active power. Positive charges, negative discharges. |
| `reactive_power` | kVAr | no | Battery reactive power. Positive is inductive, negative is capacitive. When omitted, no reactive power is requested. |

The example below charges the battery at 1 kW for 2 minutes:

BESS command steering example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/bess/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-12T14:17:00Z",
                "end_dt": "2026-10-12T14:19:00Z",
                "command": {"command_type": "BESS", "active_power": 1, "reactive_power": 0},
            }
        ],
    },
)
```

`"command_type": "Site"` sets a target for the power exchanged with the grid at the site connection point. The EMS continuously measures the site power meter and adjusts the battery power so that the site reaches this target, compensating for the variations of consumption and production on site.

You can additionally restrict the range of power the battery may use to reach the target.

| Field | Unit | Required | Description |
| --- | --- | --- | --- |
| `site_active_power` | kW | yes | Target site power. Positive is offtake from the grid, negative is injection. |
| `min_bess_active_power` | kW | no | Lowest battery power allowed (positive charges, negative discharges). Unbounded when omitted. |
| `max_bess_active_power` | kW | no | Highest battery power allowed (positive charges, negative discharges). Unbounded when omitted. |
| `max_bess_apparent_power` | kVA | no | Highest battery apparent power allowed. Unbounded when omitted. |

The example below targets 0 kW at the grid connection for 5 minutes, while preventing the battery from discharging. It charges the battery to absorb surplus generation, subject to the safety limits above; net site consumption is still supplied by the grid.

Site command steering example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/bess/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-12T14:20:00Z",
                "end_dt": "2026-10-12T14:25:00Z",
                "command": {
                    "command_type": "Site",
                    "site_active_power": 0,
                    "min_bess_active_power": 0,
                },
            }
        ],
    },
)
```

`"command_type": "SoC"` brings the battery to a target state of charge. The battery charges or discharges at high power while far from the target, switches to low power when getting close to avoid overshooting, and stops once the target is reached.

| Field | Unit | Required | Description |
| --- | --- | --- | --- |
| `soc_target` | fraction 0–1 | yes | State of charge to reach, e.g. `0.8` for 80 %. |
| `high_power_setpoint` | kW | yes | Power used while far from the target. Always positive: the direction is chosen for you. |
| `low_power_setpoint` | kW | yes | Power used close to the target. Always positive, and not higher than the high power. |
| `soc_error_to_switch_to_low_power` | fraction 0–1 | yes | Distance to the target under which the low power is used, e.g. `0.05` for 5 %. |

> [!NOTE]
>
> Unlike the `_pct` metrics, state of charge values in this command are fractions between 0 and 1, not percentages.

The example below brings the battery to 80 % state of charge, at 50 kW, then at 10 kW in the last 5 %:

SoC command steering example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/bess/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-12T15:00:00Z",
                "end_dt": "2026-10-12T17:00:00Z",
                "command": {
                    "command_type": "SoC",
                    "soc_target": 0.8,
                    "high_power_setpoint": 50,
                    "low_power_setpoint": 10,
                    "soc_error_to_switch_to_low_power": 0.05,
                },
            }
        ],
    },
)
```

#### Constraints

Next to the commands, a schedule can contain **constraints**, each applying during its own time window. Constraints take precedence over commands, so you can use them to make sure the battery is ready for a later use, whatever the commands in the plan. Like commands, the time windows of constraints must not overlap, and `end_dt` must be strictly after `start_dt`.

The following constraint is currently available:

| constraint\_type | Field | Unit | Description |
| --- | --- | --- | --- |
| `min_soc` | `min_soc` | fraction 0–1 | Minimum state of charge to keep in the battery. |

While a `min_soc` constraint is active and the state of charge is below `min_soc`, the commands are put on hold and the battery charges until it reaches `min_soc` again. While doing so, it takes as much power from the grid as the site allows: up to the peak shaving target when one is set, otherwise up to the site offtake capacity.

The example below keeps at least 30 % of charge in the battery between 6:00 and 9:00, on top of the commands:

Constraint example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/bess/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-13T00:00:00Z",
                "end_dt": "2026-10-14T00:00:00Z",
                "command": {"command_type": "Site", "site_active_power": 0},
            }
        ],
        "constraints": [
            {
                "start_dt": "2026-10-13T06:00:00Z",
                "end_dt": "2026-10-13T09:00:00Z",
                "constraints": [{"constraint_type": "min_soc", "min_soc": 0.3}],
            }
        ],
    },
)
```

The requested setpoints are shown in the portal, on the `Battery` tab.

[![BESS setpoints visualized in the portal](<https://docs.octave.energy/partner_api/assets/setpoints_portal.png>)](<https://docs.octave.energy/partner_api/assets/setpoints_portal.png>)

BESS setpoints visualized in the portal

### Steering Solar

You steer the Solar plant of a site by sending a **schedule**: a list of commands, each applying during its own time window. This lets you send a complete plan in a single request, for example the curtailment plan of the next day.

How schedules work:

- **Time windows**: each command applies from `start_dt` (included) to `end_dt` (excluded). Timestamps must include a timezone. `end_dt` must not be before `start_dt`, and time windows of a schedule must not overlap.
- **Each schedule replaces the previous one**: every request overrides the full schedule previously sent. Always send the complete plan you want the Solar plant to follow, not only the new commands. Sending an empty list of commands cancels the current plan.
- **Outside of any command**: when no command covers the current time, the Solar plant does **not** keep the last command. It switches to the default behavior of the site, which is to produce **uncurtailed**. Two other default behaviors exist: shutting down production, or self-consumption (no injection into the grid). The default behavior is agreed for each site during onboarding and can't be changed through the API yet.
- **Production can only be reduced**: the EMS controls how much the Solar plant is allowed to produce. It can't make the plant produce more than the solar resource allows.
- **Safety limits always apply**: whatever the command, the EMS keeps the site within its grid connection limits (injection and offtake capacities). For example, it doesn't curtail production below the level at which the site would exceed its offtake capacity. The power actually applied can therefore differ from the requested one.

Sign conventions:

- Solar active power: always **positive** (production).
- Site power: **positive is injection** into the grid, **negative is offtake** from the grid.
- Reactive power: **positive is inductive**, **negative is capacitive**.

> [!WARNING]
>
> The site power convention of Solar commands is the opposite of the one used by the BESS `Site` command, where positive is offtake.

#### Command fields

A command has three fields. All of them are optional and can be combined. A field that is omitted or set to `null` means you don't request anything for it.

| Field | Unit | Required | Description |
| --- | --- | --- | --- |
| `pv_active_power_limit` | kW | no | Maximum active power the Solar plant may produce. Must be positive or zero; `0` stops production. When omitted, production isn't limited (uncurtailed), apart from safety limits. |
| `site_injection_power_setpoint` | kW | no | Target power at the site grid connection point. Positive is injection, negative is offtake. The EMS adjusts the Solar production to keep the site at this target. |
| `pv_reactive_power_setpoint` | kVAr | no | Solar plant reactive power. Positive is inductive, negative is capacitive. When omitted, no reactive power is requested. |

How the fields combine:

- **Only `pv_active_power_limit`**: the Solar plant produces up to the limit, whatever happens on the rest of the site.
- **Only `site_injection_power_setpoint`**: the EMS continuously measures the site power meter and adjusts the Solar production so that the site reaches the target, compensating for the variations of consumption on site. If the plant can't produce enough to reach the target, it produces as much as it can.
- **Both**: the EMS brings the site to the target, while keeping the Solar production at or below `pv_active_power_limit`.
- **None of them** (empty command `{}`): the Solar plant produces uncurtailed during the time window. Use it to make sure production is uncurtailed during a time window, whatever the default behavior of the site.

The example below limits the Solar production to 100 kW for 1 hour:

Solar production limit example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/pv/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-12T11:00:00Z",
                "end_dt": "2026-10-12T12:00:00Z",
                "command": {"pv_active_power_limit": 100},
            }
        ],
    },
)
```

The example below prevents the site from injecting into the grid for 2 hours (zero export), for example during negative prices. Solar production still supplies the consumption of the site.

Solar site injection target example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/pv/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-12T12:00:00Z",
                "end_dt": "2026-10-12T14:00:00Z",
                "command": {"site_injection_power_setpoint": 0},
            }
        ],
    },
)
```

The example below sends a full plan for a day, in a single request:

- from 6:00 to 11:00, production is uncurtailed;
- from 11:00 to 14:00, the site injects at most 50 kW, and the Solar production stays at or below 200 kW;
- from 14:00 to 20:00, the Solar production stays at or below 300 kW.

Outside of these time windows, the Solar plant follows the default behavior of the site.

Solar daily plan example

```python
response = niquests.put(
    url=f"https://api.octave.energy/site/{site_id}/pv/plant/schedule",
    headers={"x-api-key": api_key},
    cert=(cert_pem, cert_key),
    json={
        "commands": [
            {
                "start_dt": "2026-10-13T06:00:00Z",
                "end_dt": "2026-10-13T11:00:00Z",
                "command": {},
            },
            {
                "start_dt": "2026-10-13T11:00:00Z",
                "end_dt": "2026-10-13T14:00:00Z",
                "command": {
                    "site_injection_power_setpoint": 50,
                    "pv_active_power_limit": 200,
                },
            },
            {
                "start_dt": "2026-10-13T14:00:00Z",
                "end_dt": "2026-10-13T20:00:00Z",
                "command": {"pv_active_power_limit": 300},
            },
        ],
    },
)
```

The requested setpoints are shown in the portal, on the `Solar` tab.

[![Solar setpoints visualized in the portal](<https://docs.octave.energy/partner_api/assets/solar_setpoints_portal.png>)](<https://docs.octave.energy/partner_api/assets/solar_setpoints_portal.png>)

Solar setpoints visualized in the portal
