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

# API Overview

> Cyberwave APIs overview

## Introduction

Cyberwave provides two main APIs to interact with the platform, each designed for specific use cases and communication patterns.

## REST API

The REST API is used for **non-real-time communication** with the Cyberwave platform. It follows standard HTTP methods and is ideal for:

* Creating and managing digital twins
* Configuring robot settings
* Retrieving historical data
* Managing user accounts and permissions
* Performing administrative tasks

### Authentication

All REST endpoints require an API key. Go to the [Cyberwave dashboard](https://app.cyberwave.com/profile) → **API Tokens** card → **Create Token**, then pass the key in the `Authorization` header on every request.

| Field                   | Value                                                                                                             |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------- |
| Base URL                | `https://api.cyberwave.com`                                                                                       |
| Auth header             | `Authorization: Bearer <CYBERWAVE_API_KEY>`                                                                       |
| Accepted prefixes       | `Bearer` and `Token` (case-insensitive)                                                                           |
| OpenAPI security scheme | `CustomTokenAuthentication` (API key, header)                                                                     |
| Recommended env var     | `CYBERWAVE_API_KEY`                                                                                               |
| Where to get a key      | [`https://app.cyberwave.com/profile`](https://app.cyberwave.com/profile) → **API Tokens** card → **Create Token** |

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    export CYBERWAVE_API_KEY="cw_your_token_here"

    curl -X GET "https://api.cyberwave.com/api/v1/projects" \
      -H "Authorization: Bearer $CYBERWAVE_API_KEY"
    ```
  </Tab>

  <Tab title="Python (requests)">
    ```python theme={null}
    import os
    import requests

    headers = {
        "Authorization": f"Bearer {os.environ['CYBERWAVE_API_KEY']}",
    }

    r = requests.get("https://api.cyberwave.com/api/v1/projects", headers=headers)
    r.raise_for_status()
    print(r.json())
    ```
  </Tab>

  <Tab title="JavaScript (fetch)">
    ```javascript theme={null}
    const res = await fetch("https://api.cyberwave.com/api/v1/projects", {
      headers: {
        Authorization: `Bearer ${process.env.CYBERWAVE_API_KEY}`,
      },
    });

    if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
    const data = await res.json();
    ```
  </Tab>
</Tabs>

<Warning>
  Treat the API key like a password. Never commit it to source control or paste it into client-side code that ships to browsers. Prefer environment variables and short-lived keys for production deployments.
</Warning>

## MQTT API

The MQTT API is used for **real-time communication** with robots and telemetry data. This lightweight, publish-subscribe protocol is perfect for:

* Live robot control and commands
* Real-time telemetry streaming
* Sensor data collection
* Event notifications
* Low-latency bidirectional communication

## Choosing the Right API

| Use Case                            | Recommended API |
| ----------------------------------- | --------------- |
| Fetch robot configuration           | REST            |
| Send real-time commands to robots   | MQTT            |
| Query historical telemetry          | REST            |
| Stream live sensor data             | MQTT            |
| Manage user permissions             | REST            |
| Receive instant event notifications | MQTT            |

## Getting Started

To start using the Cyberwave APIs, make sure you have:

1. A valid API key or authentication credentials
2. The appropriate SDK installed (optional but recommended)
3. Network access to the Cyberwave platform

<CardGroup cols={2}>
  <Card title="REST API Reference" icon="rocket" href="/api-reference/rest/DefaultApi">
    Browse every REST endpoint, request schema, and response shape.
  </Card>

  <Card title="MQTT API Reference" icon="bolt" href="/api-reference/mqtt/main">
    Connect to MQTT and start streaming real-time data.
  </Card>
</CardGroup>
