> For the complete documentation index, see [llms.txt](https://docs.cstplus.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cstplus.org/api-reference/general/system.md).

# System

## Get server resource usage

<mark style="color:blue;">`GET`</mark> `http://YOUR_SERVER:8080/api/system`

Returns real-time CPU, RAM, disk, and network stats for the server. Same data shown on the Dashboard.

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer YOUR\_API\_KEY (requires `system:read`) |

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "cpu": {
    "percent": 12.4,
    "cores": 4
  },
  "memory": {
    "totalBytes": 4000000000,
    "usedBytes": 1800000000,
    "percent": 45.0
  },
  "disk": {
    "totalBytes": 80000000000,
    "usedBytes": 34000000000,
    "percent": 42.5
  },
  "network": {
    "rxBytesPerSec": 120000,
    "txBytesPerSec": 8400000
  },
  "loadavg": [0.82, 0.74, 0.68],
  "uptimeSec": 864000
}
```

{% endtab %}
{% endtabs %}

***

### Health check

## Health check

<mark style="color:blue;">`GET`</mark> `http://YOUR_SERVER:8080/health`

Returns 200 when the edge is running. Does not require authentication. Use this endpoint in uptime monitors.

{% tabs %}
{% tab title="200: OK Edge is healthy" %}

```json
{ "ok": true }
```

{% endtab %}

{% tab title="503: Service Unavailable Edge is starting up or in a bad state" %}

```json
{ "ok": false }
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
The `/health` endpoint is always accessible, even when license enforcement is active or the control plane is restarting. It only reflects the state of the edge service itself.
{% endhint %}

***

### SSE: live system stats

## Subscribe to live system stats (SSE)

<mark style="color:blue;">`GET`</mark> `http://YOUR_SERVER:8080/api/system/stream`

Opens a Server-Sent Events stream that pushes system stats every 2 seconds. This is what the Dashboard uses for its live meters.

The connection stays open until the client closes it.

#### Headers

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer YOUR\_API\_KEY (requires `system:read`) |

{% tabs %}
{% tab title="200: OK SSE stream, text/event-stream" %}

```
data: {"cpu":{"percent":12.4,"cores":4},"memory":{"percent":45.0},"network":{"txBytesPerSec":8400000}}

data: {"cpu":{"percent":13.1,"cores":4},"memory":{"percent":45.2},"network":{"txBytesPerSec":9100000}}
```

{% endtab %}
{% endtabs %}

Example: consume the SSE stream in JavaScript:

```javascript
const source = new EventSource(
  "http://YOUR_SERVER:8080/api/system/stream",
  { headers: { Authorization: "Bearer YOUR_API_KEY" } }
);

source.onmessage = (e) => {
  const stats = JSON.parse(e.data);
  console.log("CPU:", stats.cpu.percent + "%");
};
```

{% hint style="info" %}
`EventSource` in browsers does not support custom headers. For browser use, pass the API key as a query parameter: `/api/system/stream?token=YOUR_API_KEY`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cstplus.org/api-reference/general/system.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
