# /cpu

#### `/api/cpu`

### Overview

The `/api/cpu` endpoint returns the current CPU load of the system in the form of a JSON response.

### Endpoint

```bash
GET /api/cpu
```

### Example

```js
fetch('/api/cpu')
  .then(response => response.json())
  .then(data => {
    console.log(`CPU Load: ${data.cpuLoad}%`);
  });
```

### Response

The response will return a JSON object containing the `cpuLoad` value:

```json
{
  "cpuLoad": "15.34"
}
```

### Description

* **`/api/cpu`** provides the current CPU load as a percentage value.
* It uses the `getCpuLoad()` function internally to fetch the data.
* The result is returned as a floating-point number with two decimal places, representing the CPU load in percentage.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sheita.gitbook.io/sysmonitoring/api/cpu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
