CONCEPT AND DEVELOPMENTUNMANNED SPORT · #bezpiLOTa · KAIROS DRONE AGENTDocumentation
#bezpiLOTa→Drone Agent→API & SDK
KairOS / DRONE AGENT / 03

REST for integration, raw MAVLink WebSocket for real-time data, versioned MQTT topics for remote relay and a Python SDK for drivers and extensions. This section defines target ports, endpoints, permissions and examples of KairOS’s own interface.

PLANNED

APIs and SDKs are described as a KairOS target contract; a stable version and compatibility guarantees have not yet been released.

KairOS repository ↗
08core REST endpoints
JSONREST responses
WSraw MAVLink
KEYpermission auth
01
REST API / :8080

Eight core endpoints

The control surface listens on port 8080 and returns JSON. Most requests require the X-KairOS-Key header. Each key has a permission level, allowing telemetry reads to be separated from flight commands, mission uploads and administrative operations.

MethodEndpointData or action
GET/api/statusHealth, uptime, FC connection, role, agent version
GET/api/telemetryAttitude, GPS, battery, RC channels, flight mode
GET/api/paramsFC parameter cache with prefix filtering
POST/api/commandsTakeoff, land, goto, RTL, arm, disarm
GET/api/configCurrent agent configuration as JSON
PUT/api/configChange keys and hot-reload affected services
GET/api/servicesrunning, stopped or failed for managed services
GET/api/logsStructured events with service and level filters
bashTelemetry over REST
curl -s http://<board-ip>:8080/api/telemetry \
  -H "X-KairOS-Key: <your-key>" | jq
KairOS target interface: the command becomes executable only after the corresponding component is released.
jsonExample JSON response
{
  "armed": true,
  "mode": "GUIDED",
  "battery": { "voltage": 22.4, "pct": 78 },
  "gps": { "fix": 3, "satellites": 14, "alt": 50.2 },
  "attitude": { "roll": 0.02, "pitch": -0.01, "yaw": 182.5 }
}
02
CLIENT EXAMPLE

Read telemetry and send a command from Python

pythonTarget KairOS client—simulator only until flight validation
import httpx

BASE = "http://<board-ip>:8080"
headers = {"X-KairOS-Key": "<your-key>"}

telem = httpx.get(f"{BASE}/api/telemetry", headers=headers).json()
print(telem["battery"]["pct"], telem["gps"]["satellites"])

httpx.post(
    f"{BASE}/api/commands",
    headers=headers,
    json={"command": "takeoff", "params": {"alt": 10}},
)
KairOS target interface: the command becomes executable only after the corresponding component is released.
03
PORTS & TOPICS

One MAVLink stream, multiple transports

SurfacePort or topicPurpose
REST:8080Status, telemetry, configuration, services, commands
MAVLink WebSocket:8765Bidirectional binary MAVLink v2
WebRTC WHEP:8889Local video
Statuskairos/v1/agents/{agent_id}/statusRetained health and agent availability
Telemetrykairos/v1/agents/{agent_id}/telemetryVehicle state stream
Eventskairos/v1/agents/{agent_id}/eventsObservable events and warnings
Commandskairos/v1/agents/{agent_id}/commandsCommands to the agent with QoS 1
ACKkairos/v1/agents/{agent_id}/acks/{command_id}Result of a specific command
WebRTC signalingkairos/v1/agents/{agent_id}/video/webrtc/offerSDP offer for P2P video

The router receives one stream from the FC and distributes it to multiple consumers simultaneously: browser GCS over WebSocket 8765, SITL/engineering clients over TCP 5760 and legacy tools over UDP 14550. WebSocket has no JSON wrapper: it carries wire-compatible binary MAVLink v2 frames.

javascriptTarget KairOS browser WebSocket
const ws = new WebSocket("ws://<board-ip>:8765");
ws.binaryType = "arraybuffer";

ws.onmessage = (event) => {
  decodeMavlink(new Uint8Array(event.data));
};

ws.send(encodeCommandLong(sysid, compid, cmd, params));
KairOS target interface: the command becomes executable only after the corresponding component is released.
04
PYTHON SDK

Contracts for drivers and on-vehicle logic

ClassPurpose
CameraDriverCSI, USB UVC, IP and vendor-SDK cameras
GimbalDriverPan, tilt, roll and gimbal telemetry
LidarDriverLiDAR and rangefinder devices
GpsDriverGPS/GNSS receivers
EscDriverESC drivers and return telemetry
VisionClientFrames and detections from the on-vehicle vision bus
05
SECURITY

API key permissions limit the scope of action

LevelAllowed operations
readTelemetry, status, configuration, logs and parameters without state changes
commandFlight commands; includes read
missionUpload and execute mission files; includes command
configChange agent and FC configuration; includes read
adminUpdates, service restarts, key management and full access

Keep the key secret and do not include it in public logs, screenshots or client bundles. Browser integrations should use short-lived scoped credentials rather than permanent admin keys.

MCP AI assistant interface: conversational mission analysis, map, telemetry, tool calls, event log and access permissions.
INTERFACE / VISUAL EXAMPLEContext for commands, access and auditing

The permissions panel and tool-call log appear alongside the mission. The illustration connects permissions to operator context; KairOS API contracts are described in the page text.

06
MESSAGE INTEGRITY

MAVLink v2 signing without storing the key on the agent

The ground station creates a 32-byte key and stores it in the browser as a non-extractable Web Crypto key. The capability endpoint checks the firmware and availability of signing parameters. After one-time enrollment, the flight controller verifies the HMAC-SHA256 tag on every outbound frame. The agent remains a transparent pipe and does not store the signing key.

httpCapability check
GET /api/mavlink/signing/capability
X-KairOS-Key: <your-key>

{
  "supported": true,
  "reason": "ok",
  "firmware_name": "ArduPilot",
  "firmware_version": "4.5.0",
  "signing_params_present": true
}
KairOS target interface: the command becomes executable only after the corresponding component is released.