Fleet AI Developer API

Build fleet intelligence into your product.

The Fleet AI REST API gives your application direct access to vehicle health scores, predictive risk signals, real-time telemetry, and operational event streams — without building the ML layer yourself.

REST API Webhook events Node.js SDK Python SDK HMAC-signed payloads SSE live stream Drop-in widget
fleet-ai-quickstart.sh
# Predict breakdown risk for any vehicle $ curl -X POST https://your-app.railway.app/api/partner/predict \ -H "X-API-Key: $FLEET_AI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"vehicleId":"VH-2701","samples":[{"rpm":1850,"coolantTemp":97,"batteryVoltage":13.1}]}' # Response — structured, actionable, ready to act on { "vehicleId": "VH-2701", "riskProbability": 0.82, "prediction": "breakdown", "confidence": 0.94, "advisoryText": "Cooling system showing thermal drift. Schedule inspection within 48h.", "diagnosis": { "primarySubsystem": "cooling" } }

Four surfaces. Everything your application needs.

Vehicle health, sensor telemetry, active alerts, and fleet-wide risk — all through one authenticated API.

Vehicle Health API

Per-vehicle predictive health scores, anomaly flags, component risk classification, and recommended service windows — updated from live sensor data every 15 minutes.

Telemetry API

Raw and normalized sensor readings — RPM, coolant temp, battery voltage, fuel rate, engine load, oil pressure — with historical range queries and baseline deviation metrics.

Alerts & Faults API

Active alerts, OBD-II / J1939 fault codes, severity classifications, and resolution status across your fleet. Query by time range, severity, or vehicle group.

Fleet Risk Queue API

The same prioritized ranking your fleet operators use — vehicles sorted by urgency, component affected, service window, and confidence score — as a structured JSON response.

New

Live Stream & SSE

Subscribe to GET /api/partner/stream with an EventSource and your dashboard updates the instant new telemetry is scored — no polling, no latency, no infrastructure to run.

New

Drop-in Embed Widget

One <script> tag drops a live vehicle health card into any page. Shows risk score, component diagnosis (injectors, bearings, cooling), sensor health bars, and days-to-service — all updating in real time from the SSE stream.

Predictable endpoints. Consistent JSON.

Standard REST resource paths, HTTP status codes, cursor pagination, and RFC 7807 error format. No proprietary query language, no GraphQL overhead.

GET
/v1/vehicles
List all fleet vehicles with status, device pairing, and last-seen timestamp.
GET
/v1/vehicles/{id}/health
Health score, risk level, affected component, anomaly flags, and recommended action for a single vehicle.
GET
/v1/vehicles/{id}/telemetry
Latest sensor snapshot. Append ?range=24h for a historical window.
GET
/v1/vehicles/{id}/alerts
Active alerts and DTC codes. Filter by severity, status, or time range.
GET
/v1/fleet/risk-queue
Prioritized list across the entire fleet — sorted by urgency, window, and confidence.
GET
/v1/fleet/health-summary
Aggregated fleet metrics: mean score, vehicles at risk, active faults, signal coverage.
POST
/v1/work-orders
Create a maintenance work order from an active risk event. Links to the triggering signal.
POST
/v1/webhooks
Register an HTTPS endpoint to receive real-time fleet events signed with HMAC-SHA256.
GET
/api/partner/vehicles/{id}/live
Latest scored snapshot — risk probability, component diagnosis, sensor risks, and breakdown timeline. Refreshes on every POST /predict call.
GET
/api/partner/stream?vehicleId={id}
Server-Sent Events stream. Connect once and receive real-time prediction updates as telemetry arrives. No polling needed.
# Get risk-ranked fleet summary
curl https://your-app.railway.app/api/partner/fleet?minRisk=0.35 \
  -H "X-API-Key: $FLEET_AI_API_KEY"

# Run a breakdown prediction
curl -X POST https://your-app.railway.app/api/partner/predict \
  -H "X-API-Key: $FLEET_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vehicleId": "VH-2701",
    "samples": [{ "rpm": 1850, "coolantTemp": 97, "engineLoad": 78 }]
  }'

# Response
{ "riskProbability": 0.82, "prediction": "breakdown", "confidence": 0.94 }
// Get risk-ranked fleet and act on critical vehicles
const fleet = await fetch('https://your-app.railway.app/api/partner/fleet?minRisk=0.75', {
  headers: { 'X-API-Key': process.env.FLEET_AI_API_KEY },
}).then(r => r.json());

for (const vehicle of fleet.vehicles) {
  // riskProbability 0–1; ≥0.75 = critical
  const pred = await fetch('https://your-app.railway.app/api/partner/predict', {
    method: 'POST',
    headers: { 'X-API-Key': process.env.FLEET_AI_API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ vehicleId: vehicle.vehicleId, samples: vehicle.latestSamples }),
  }).then(r => r.json());

  if (pred.riskProbability >= 0.75) {
    await createWorkOrder({ vehicleId: vehicle.vehicleId, advisoryText: pred.advisoryText });
  }
}
import os, requests

BASE = "https://your-app.railway.app/api/partner"
HEADERS = {"X-API-Key": os.environ["FLEET_AI_API_KEY"]}

# Get critical vehicles (riskProbability ≥ 0.75)
fleet = requests.get(f"{BASE}/fleet?minRisk=0.75", headers=HEADERS).json()

for vehicle in fleet["vehicles"]:
    pred = requests.post(f"{BASE}/predict", headers=HEADERS, json={
        "vehicleId": vehicle["vehicleId"],
        "samples": vehicle["latestSamples"],
    }).json()

    if pred["riskProbability"] >= 0.75:
        create_work_order(vehicle_id=vehicle["vehicleId"], advisory=pred["advisoryText"])
Real-time events

React the moment something changes.

Register a webhook and Fleet AI pushes a signed event to your server the instant a vehicle's health deteriorates, a fault code appears, or a sensor crosses its individual baseline threshold.

All payloads are HMAC-SHA256 signed. Verify the x-fleetai-signature header before processing. Delivery includes automatic retry with exponential backoff.

risk_threshold_crossed Risk score crosses 0.35
stage2_confirmed Two-stage ML confirms breakdown
dtc_critical High-risk fault code detected
model_ready Predictions available for vehicle
webhook-payload.json
{ "event": "risk_threshold_crossed", "deliveredAt": "2026-06-06T14:22:00Z", "partner": "your-partner-name", "vehicleId": "VH-2701", "riskProbability": 0.82, "prediction": "breakdown", "threshold": 0.35, "advisoryText": "Cooling system showing thermal drift. Schedule inspection within 48h." }

Live vehicle health in two lines of HTML.

Add a <div> and a <script> tag to any page and get a live-updating vehicle health card. No build step. No framework. Works in any HTML page or web view.

Real-time updates
Connects to the SSE stream automatically — no polling, no refresh.
Component-level diagnosis
Shows which part is failing — injectors, bearings, cooling — with mechanic action and part cost.
Breakdown timeline
Displays days-to-service estimate from risk degradation slope — not just a score.
Sensor health bars
Top 6 sensor risk scores shown visually — coolant, battery, DPF, turbo, oil, RPM.
<!-- 1. Container: set data-vehicle to your truck ID -->
<div id="fleetai-widget"
     data-vehicle="TRUCK-001"></div>

<!-- 2. Drop-in script — that's it -->
<script
  src="https://fleetaiops.com/embed/fleet-widget.js"
  data-api-key="YOUR_PARTNER_KEY"
  data-base-url="https://fleetaiops.com">
</script>

<!-- Multiple vehicles on the same page -->
<div data-fleetai-vehicle="TRUCK-001"></div>
<div data-fleetai-vehicle="TRUCK-002"></div>
<div data-fleetai-vehicle="TRUCK-003"></div>
// Raw SSE — build your own UI on top of the stream
const es = new EventSource(
  `https://fleetaiops.com/api/partner/stream` +
  `?vehicleId=TRUCK-001&apiKey=${YOUR_KEY}`
);

es.addEventListener("snapshot", (e) => {
  const data = JSON.parse(e.data);
  // data.riskProbability   → 0–1 risk score
  // data.prediction        → "failure_imminent" | "healthy" | ...
  // data.diagnosis         → { components: [{ component, confidence, mechanic_action }] }
  // data.sensorRisks       → { coolantTemp: 87, batteryVoltage: 12, ... }
  // data.advisoryText      → plain-English summary
  renderDashboard(data);
});

// Auto-reconnect on drop
es.onerror = () => { es.close(); reconnect(); };

The widget is served from /embed/fleet-widget.js — a single self-contained file with no dependencies. The SSE stream also accepts ?vehicleId=* to receive updates for all your vehicles at once.

What teams build on top of it

The Fleet AI API is purpose-built for products that need fleet health intelligence without operating their own ML pipeline.

01 — Maintenance platforms

Auto-generate work orders from risk

Poll the risk queue on a schedule, translate high-risk flags into work orders, and sync them to your shop management system or ERP. Fleet AI handles detection; your system handles the workflow.

GET /fleet/risk-queue POST /work-orders
02 — Insurance telematics

Flag vehicles before a claim happens

Subscribe to vehicle.risk_escalated to trigger underwriting reviews, adjust coverage parameters, or route a vehicle to inspection before a roadside event occurs.

POST /webhooks GET /vehicles/{id}/health
03 — Fleet management SaaS

Embed predictive health into your UI

Surface Fleet AI's risk queue and sensor drift data inside your own product without building the detection model. Add a health score column to your vehicle table in an afternoon.

GET /vehicles GET /vehicles/{id}/telemetry
04 — OEM & dealer portals

Proactive service outreach by VIN

Pull health scores by VIN and surface them in a branded service portal. Trigger automated outreach the moment a vehicle's score drops — before the customer calls about a breakdown.

GET /vehicles/{id}/health GET /vehicles/{id}/alerts
05 — Dispatch & logistics

Block high-risk units before load assignment

Check the health score of any vehicle before assigning a load. Block programmatically or alert dispatchers in real time when a vehicle's risk changes while it's in transit.

GET /vehicles/{id}/health vehicle.risk_escalated
06 — AI agents & automation

Tool-call the API from your AI agent

Expose the Fleet AI API as a tool in an LLM agent, n8n workflow, or Zapier automation. Let the agent pull the risk queue, post to Slack, open Jira tickets, or page on-call when a vehicle flags.

GET /fleet/health-summary POST /webhooks

What API access includes

API credentials are provisioned through a sales conversation so we can scope rate limits and data access to your integration. Reach out to get started.

Authentication

X-API-Key header with SHA-256 hashed keys. Raw key shown once at provisioning — never stored in plaintext.

  • Per-key rate limits
  • Key rotation on request
  • Tier-scoped access control
  • Usage tracked per key for billing

Response format

All endpoints return JSON with a consistent envelope. Errors include a machine-readable code field alongside the message.

  • Predictable /api/partner/ paths
  • ISO 8601 timestamps throughout
  • Batch endpoint for up to 200 vehicles
  • HMAC-SHA256 signed webhooks

Reliability

The API runs on the same infrastructure as the Fleet AI platform. Predictions are available within seconds of telemetry submission.

  • Webhook retry with exponential backoff
  • Node.js fallback when ML service is busy
  • Dedicated Slack channel for API partners
  • Direct engineering support during integration

Ready to build?

Tell us what you're building and we'll scope API access, provide sample data, and stand up a sandbox environment so you can integrate before committing to a contract.