</>

Leneir API

Integrate Leneir's autonomous platform into your products. Access telemetry, perception data, and vehicle APIs.

Telemetry API Reference

Endpoints for streaming, querying, and managing vehicle telemetry data

POST /api/v1/telemetry/stream
Requires API Key

Stream real-time telemetry data from a vehicle. This is the primary endpoint for accessing live sensor readings, GPS coordinates, and system status from connected vehicles.

Request Body

ParameterTypeRequiredDescription
vehicle_idstringYesThe unique vehicle identifier
sensorsarrayNoFilter by sensor type (lidar, radar, camera, gps)
frequencyintegerNoPolling rate in Hz (default: 10, max: 100)
formatstringNoResponse format: json or protobuf (default: json)

Success Response (200)

{
  "status": "streaming",
  "vehicle_id": "cs9-001",
  "data": {
    "gps": { "lat": 40.7128, "lng": -74.0060 },
    "speed_mph": 32.5,
    "heading": 270,
    "sensors": {
      "lidar": { "points": 128000, "status": "active" },
      "radar": { "objects": 12, "status": "active" }
    }
  },
  "timestamp": "2026-03-05T14:23:01Z"
}

Error Response (422)

{
  "error": "vehicle_not_found",
  "message": "No vehicle found with the given ID."
}

Possible error codes:

vehicle_not_found invalid_api_key rate_limit_exceeded sensor_unavailable
GET /api/v1/vehicles/{vehicle_id}/status
Requires API Key

Retrieve the current status and health of a specific vehicle, including battery level, system diagnostics, and active perception modules.

Success Response (200)

{
  "vehicle_id": "cs9-001",
  "status": "online",
  "battery": 87,
  "modules": {
    "lidar": "active",
    "radar": "active",
    "camera_front": "active",
    "camera_rear": "standby"
  },
  "last_ping": "2026-03-05T14:22:58Z"
}
POST /api/v1/perception/detect
Requires API Key

Submit sensor data for object detection and classification. Returns detected objects with bounding boxes, confidence scores, and classification labels.

Request Body

ParameterTypeRequiredDescription
frame_database64YesBase64-encoded sensor frame data
sensor_typestringYesSource sensor: camera, lidar, or fused
confidence_thresholdfloatNoMin confidence 0.0–1.0 (default: 0.7)

Success Response (200)

{
  "detections": [
    {
      "class": "vehicle",
      "confidence": 0.95,
      "bbox": [120, 340, 280, 420],
      "distance_m": 14.2
    }
  ],
  "processing_ms": 23
}
POST /api/v1/webhooks
Requires API Key

Register a webhook URL to receive real-time notifications about vehicle events such as geofence triggers, system alerts, and perception anomalies.

Request Body

ParameterTypeRequiredDescription
urlstringYesHTTPS endpoint to receive webhook payloads
eventsarrayYesEvents: geofence, alert, anomaly, status_change
secretstringNoSigning secret for verifying payloads

Success Response (201)

{
  "id": "wh_k8m2n4p6",
  "url": "https://yourapp.com/webhooks/leneir",
  "events": ["geofence", "alert"],
  "created_at": "2026-03-05T14:30:00Z"
}

Rate Limiting

The API is rate-limited to protect against abuse. Current limits:

60

requests per minute

1,000

requests per hour

10,000

requests per day

Rate limit headers: X-RateLimit-Remaining, X-RateLimit-Limit

SDKs

Install an SDK and make your first API call in minutes.

JS

JavaScript / Node.js

npm install @leneir/sdk
PY

Python

pip install leneir
PH

PHP / Laravel

composer require leneir/sdk