Models & Inference
These endpoints control the AI lifecycle: training models on your custom data and running inference to generate risk scores.
Calibrate Model
Section titled “Calibrate Model”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
Request Headers
Section titled “Request Headers”| Key | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
X-API-KEY | Your-API-Key | Yes |
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
robot_id | uuid | Yes | The UUID of the robot. |
mission_id | uuid | Yes | The UUID of the mission. |
robot_type | string | Yes | The hardware type. Allowed: SPOT, UR6. |
blob_names | list[str] | No | List of unique_filenames to train on. Defaults to all. |
epochs1 | int | No | Training epochs (Default: 100). |
batch_size | int | No | Batch size for training (Default: 128). |
retrain | boolean | No | Set true to force retraining (Default: false). |
Success Response
Section titled “Success Response”Code: 200 OK
{ "details": { "task_id": "a493b453-e29b-41d4-a716-446655440000" }, "message": "Training task queued"}Possible Errors
Section titled “Possible Errors”- 400 Bad Request: Expected 15 files, but found X.
- 400 Bad Request: Model already exists.
- 401 Unauthorized: Invalid or missing API Key.
Sample Code (Python)
Section titled “Sample Code (Python)”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())Process Files (Inference)
Section titled “Process Files (Inference)”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
Request Headers
Section titled “Request Headers”| Key | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
X-API-KEY | Your-API-Key | Yes |
Request Body
Section titled “Request Body”| Parameter | Type | Required | Description |
|---|---|---|---|
robot_id | uuid | Yes | The UUID of the robot. |
mission_id | uuid | Yes | The UUID of the mission. |
blob_names | list[str] | No | List of unique_filenames to analyze. Defaults to all. |
device | string | No | Device to run inference on: cpu or cuda (Default: cpu). |
Success Response
Section titled “Success Response”Code: 200 OK
{ "file sent": [ "1a3a81da-e29b-41d4-a716-446655440000_Day16.bag", "ac8d4704-e29b-41d4-a716-446655440000_Day17.bag" ], "message": "Processing queued"}Possible Errors
Section titled “Possible Errors”- RS-MOD-001: Model not found (Training not completed).
- 401 Unauthorized: Invalid or missing API Key.
Sample Code (Python)
Section titled “Sample Code (Python)”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())Get Model & Mission Details
Section titled “Get Model & Mission Details”Retrieves the current status of the AI model and the aggregated risk scores.
- Endpoint:
/api/model/mission-details - Method:
GET
Request Headers
Section titled “Request Headers”| Key | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
X-API-KEY | Your-API-Key | Yes |
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
mission_id | uuid | Yes | The Public UUID of the mission. |
Success Response
Section titled “Success Response”Code: 200 OK
{ "calibration_status": "calibration_completed", "epochs": 150, "files": [ { "filename": "Day10.bag", "risk_score": 5.4 } ], "inference_possible": true, "inference_status": "processing_completed", "mission_avg_risk_score": 12.5, "mission_length": 2073, "robot_type": "SPOT", "training_time": "Wed, 07 Jan 2026 10:30:00 GMT"}Possible Errors
Section titled “Possible Errors”- RS-MSN-002: Mission ID not found.
- 401 Unauthorized: Invalid or missing API Key.
Sample Code (Python)
Section titled “Sample Code (Python)”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())