Skip to content

Models & Inference

These endpoints control the AI lifecycle: training models on your custom data and running inference to generate risk scores.

Triggers the asynchronous training of an anomaly detection model using the files uploaded to a mission.

  • Overview: Requires at least 15 files uploaded to the mission.
  • Endpoint: /api/calibrate
  • Method: POST
KeyValueRequired
Content-Typeapplication/jsonYes
X-API-KEYYour-API-KeyYes
ParameterTypeRequiredDescription
robot_iduuidYesThe UUID of the robot.
mission_iduuidYesThe UUID of the mission.
robot_typestringYesThe hardware type. Allowed: SPOT, UR6.
blob_nameslist[str]NoList of unique_filenames to train on. Defaults to all.
epochs1intNoTraining epochs (Default: 100).
batch_sizeintNoBatch size for training (Default: 128).
retrainbooleanNoSet true to force retraining (Default: false).

Code: 200 OK

{
"details": {
"task_id": "a493b453-e29b-41d4-a716-446655440000"
},
"message": "Training task queued"
}
  • 400 Bad Request: Expected 15 files, but found X.
  • 400 Bad Request: Model already exists.
  • 401 Unauthorized: Invalid or missing API Key.
import requests
url = "[https://api.ridescan.ai/api/calibrate](https://api.ridescan.ai/api/calibrate)"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
payload = {
"robot_id": "e7201eff-e29b-41d4-a716-446655440000",
"mission_id": "9384ac10-e29b-41d4-a716-446655440000",
"robot_type": "SPOT",
"epochs1": 150,
"retrain": True
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Runs the trained model against specific files to generate Risk Scores.

  • Overview: The mission must have a trained model (calibration_completed) before you can run inference.
  • Endpoint: /api/process
  • Method: POST
KeyValueRequired
Content-Typeapplication/jsonYes
X-API-KEYYour-API-KeyYes
ParameterTypeRequiredDescription
robot_iduuidYesThe UUID of the robot.
mission_iduuidYesThe UUID of the mission.
blob_nameslist[str]NoList of unique_filenames to analyze. Defaults to all.
devicestringNoDevice to run inference on: cpu or cuda (Default: cpu).

Code: 200 OK

{
"file sent": [
"1a3a81da-e29b-41d4-a716-446655440000_Day16.bag",
"ac8d4704-e29b-41d4-a716-446655440000_Day17.bag"
],
"message": "Processing queued"
}
  • RS-MOD-001: Model not found (Training not completed).
  • 401 Unauthorized: Invalid or missing API Key.
import requests
url = "[https://api.ridescan.ai/api/process](https://api.ridescan.ai/api/process)"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
payload = {
"robot_id": "e7201eff-e29b-41d4-a716-446655440000",
"mission_id": "9384ac10-e29b-41d4-a716-446655440000",
"device": "cpu"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Retrieves the current status of the AI model and the aggregated risk scores.

  • Endpoint: /api/model/mission-details
  • Method: GET
KeyValueRequired
Content-Typeapplication/jsonYes
X-API-KEYYour-API-KeyYes
ParameterTypeRequiredDescription
mission_iduuidYesThe Public UUID of the mission.

Code: 200 OK

{
"data": {
"calibration_status": "calibration_completed",
"epochs": 100,
"files": [
{
"event time": "2026-03-04T10:30:00",
"file type": "calib_file",
"original filename": "Day1.bag",
"risk_score": 10.02,
"unique filename": "b503c086-3_Day1.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day2.bag",
"risk_score": 10.02,
"unique filename": "db830b9b-6_Day2.bag"
},
{
"event time": "2026-03-04T10:30:00",
"file type": "calib_file",
"original filename": "Day1.bag",
"risk_score": 10.02,
"unique filename": "c9c20b14-e_Day1.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day2.bag",
"risk_score": 10.02,
"unique filename": "b64bf76e-7_Day2.bag"
},
{
"event time": "2026-03-04T10:30:00",
"file type": "calib_file",
"original filename": "Day1.bag",
"risk_score": 10.02,
"unique filename": "ddb86b72-5_Day1.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day2.bag",
"risk_score": 10.02,
"unique filename": "e3517aad-b_Day2.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day3.bag",
"risk_score": 13.02,
"unique filename": "ce1931d0-9_Day3.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day4.bag",
"risk_score": 15.02,
"unique filename": "b0a66594-4_Day4.bag"
},
{
"event time": "2026-03-04T10:30:00",
"file type": "calib_file",
"original filename": "Day1.bag",
"risk_score": 04.02,
"unique filename": "1f073c92-a_Day1.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day2.bag",
"risk_score": 10.06,
"unique filename": "553a87ff-b_Day2.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day3.bag",
"risk_score": 10.03,
"unique filename": "3acee6fb-8_Day3.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day4.bag",
"risk_score": 10.07,
"unique filename": "92663c10-3_Day4.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day1.bag",
"risk_score": 08.02,
"unique filename": "9f4b6f7d-c_Day1.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day2.bag",
"risk_score": 11.02,
"unique filename": "5a25512f-6_Day2.bag"
},
{
"event time": "2026-03-03T10:30:00",
"file type": "calib_file",
"original filename": "Day3.bag",
"risk_score": 10.02,
"unique filename": "d5544d2b-1_Day3.bag"
}
],
"inference_possible": true,
"inference_status": "processing_completed",
"mission_avg_risk_score": 21.19,
"mission_length": 1977,
"robot_avg_risk_score": 21.19,
"robot_type": "0",
"training_time": "Thu, 26 Feb 2026 13:34:14 GMT",
"upload_time": "Thu, 26 Feb 2026 13:41:43 GMT"
},
"message": "Model fetched successfully"
}
  • RS-MSN-002: Mission ID not found.
  • 401 Unauthorized: Invalid or missing API Key.
import requests
url = "[https://api.ridescan.ai/api/model/mission-details](https://api.ridescan.ai/api/model/mission-details)"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
params = {
"mission_id": "9384ac10-e29b-41d4-a716-446655440000"
}
response = requests.get(url, params=params, headers=headers)
print(response.json())