Quick Start Guide
Prerequisites
Before using the Testing API, ensure you have the following installed:
- Python 3.8+
- pip (Python package manager)
- An API Key: Issued via the Supervised AI platform dashboard.
Installation
Clone the repository and install the necessary dependencies to interact with the testing environment:
git clone https://github.com/UditAkhourii/testing-api.git
cd testing-api
pip install -r requirements.txt
Authentication
All requests to the Supervised AI Testing API must include your API Key in the request header.
| Header | Type | Description |
| :--- | :--- | :--- |
| Authorization | string | Your API Key (e.g., Bearer YOUR_API_KEY) |
| Content-Type | string | Must be application/json |
Quick Usage Example
The following Python script demonstrates how to initialize the client and perform a basic connectivity test to the Supervised AI platform.
import requests
# Configuration
API_URL = "https://api.supervised.ai/v1/test"
HEADERS = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
def check_connection():
response = requests.get(f"{API_URL}/ping", headers=HEADERS)
if response.status_code == 200:
print("Success:", response.json())
else:
print(f"Error {response.status_code}: {response.text}")
if __name__ == "__main__":
check_connection()
Core Endpoints
1. Health Check
Validates the availability of the testing infrastructure.
- Endpoint:
/ping - Method:
GET - Output:
status(string): Connection status (e.g., "pong").timestamp(iso8601): Current server time.
2. Run Test Inference
Simulates a model inference call within the testing structure.
-
Endpoint:
/inference/test -
Method:
POST -
Input (JSON): | Parameter | Type | Required | Description | | :--- | :--- | :--- | :--- | |
model_id|string| Yes | The unique identifier of the AI model. | |input_data|dict| Yes | The payload/features to be processed. | |stream|boolean| No | Whether to stream the response (default:false). | -
Output (JSON):
request_id(uuid): Unique identifier for the test session.prediction(object): The result generated by the model.latency_ms(integer): Time taken to process the request.
Error Handling
The API uses standard HTTP response codes:
200 OK: Request succeeded.401 Unauthorized: Invalid or missing API Key.422 Unprocessable Entity: Validation error in your input JSON.500 Internal Server Error: Issue within the Supervised AI testing infrastructure.