ExoBengal API Access
Access ExoBengal's machine learning models deployed on Cerebrium Cloud Platform. Use Random Forest, CNN, KNN, and Decision Tree models to predict exoplanet characteristics and calculate Earth Similarity Index with auto-scaling and high availability.
Quick Start
1. Simple Authentication
Include Content-Type and Accept headers in your requests for proper API communication
2. Make Requests
Use RESTful endpoints to predict exoplanet characteristics using ML models
3. Build Apps
Create visualizations, analysis tools, or educational applications
API Endpoints
Base URL: https://api.aws.us-east-1.cerebrium.ai/v4/p-e08fc93f/exobengal-api/
/health_checkHealth check endpoint to verify API status and deployment health
/get_model_infoInformation about available models, input parameters, and deployment configuration
/predictSingle exoplanet prediction using ML models with Earth Similarity Index calculation
Parameters:
Note: Request body must include an 'item' object with all parameters
/initManual model initialization for faster subsequent requests
Code Examples
python
import requests
url = "https://api.aws.us-east-1.cerebrium.ai/v4/p-e08fc93f/exobengal-api/predict"
headers = {
"Content-Type": "application/json",
"Accept": "application/json"
}
data = {
"item": {
"period": 365.0,
"prad": 1.0,
"teq": 288.0,
"srad": 1.0,
"slog_g": 4.44,
"steff": 5778.0,
"impact": 0.1,
"duration": 5.0,
"depth": 100.0,
"models": ["random_forest", "cnn"]
}
}
response = requests.post(url, json=data, headers=headers)
result = response.json()
print(f"Run ID: {result['run_id']}")
print(f"ESI: {result['result']['esi']}")
print(f"Predictions: {result['result']['predictions']}")curl
curl -X POST https://api.aws.us-east-1.cerebrium.ai/v4/p-e08fc93f/exobengal-api/predict \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"item": {
"period": 365.0,
"prad": 1.0,
"teq": 288.0,
"srad": 1.0,
"slog_g": 4.44,
"steff": 5778.0,
"impact": 0.1,
"duration": 5.0,
"depth": 100.0
}
}'javascript
const response = await fetch('https://api.aws.us-east-1.cerebrium.ai/v4/p-e08fc93f/exobengal-api/predict', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
item: {
period: 365.0,
prad: 1.0,
teq: 288.0,
srad: 1.0,
slog_g: 4.44,
steff: 5778,
impact: 0.1,
duration: 5.0,
depth: 100.0,
models: ["random_forest", "cnn"]
}
})
});
const data = await response.json();
console.log('Run ID:', data.run_id);
console.log('Predictions:', data.result.predictions);Response Format
Cerebrium API Response Structure
{
"run_id": "c514a61a-34f4-9cb7-bba8-a11679c5e2d5",
"result": {
"predictions": {
"random_forest": {
"prediction": {
"prediction": "Not a Planet",
"probability": 0.452
},
"model_type": "Random Forest"
},
"knn": {
"prediction": {
"prediction": "Planet",
"probability": 1,
"ESI": 0.021
},
"model_type": "Knn"
}
},
"esi": 1,
"input_data": {...},
"models_executed": ["random_forest", "decision_tree", "knn", "cnn"],
"status": "success"
},
"run_time_ms": 7866.67
}The API returns a run_id for tracking, a result object with predictions from each model, calculated Earth Similarity Index (ESI), and execution time in milliseconds.
Error Handling
Missing Parameters
{
"error": "Missing required fields: ['period', 'prad']",
"status": "error"
}Invalid Model
{
"error": "Invalid model(s): ['invalid_model']. Available models: ['random_forest', 'decision_tree', 'knn', 'cnn']",
"status": "error"
}Model Execution Error
{
"predictions": {
"random_forest": {
"error": "Model execution failed: [error details]",
"model_type": "Random Forest"
}
},
"status": "success"
}Available Models
Random Forest
Ensemble learning method using multiple decision trees
Decision Tree
Tree-based learning algorithm for classification
K-Nearest Neighbors (KNN)
Instance-based learning algorithm
Convolutional Neural Network (CNN)
Deep learning model for pattern recognition
Input Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| period | float | Orbital period (days) | 365.25 |
| prad | float | Planet radius (Earth radii) | 1.0 |
| teq | float | Equilibrium temperature (Kelvin) | 288.0 |
| srad | float | Stellar radius (solar radii) | 1.0 |
| slog_g | float | Stellar surface gravity (log scale) | 4.44 |
| steff | float | Stellar effective temperature (Kelvin) | 5778 |
| impact | float | Impact parameter | 0.0 |
| duration | float | Transit duration (hours) | 13.0 |
| depth | float | Transit depth (parts per million) | 84.0 |
Deployment Configuration
Hardware Specifications
- • CPU: 2.0 cores
- • Memory: 4.0 GB
- • Compute: CPU (AWS)
- • Python: 3.10
- • Base Image: python:3.10-bookworm
Auto-scaling Settings
- • Min Replicas: 0 (scales to zero when idle)
- • Max Replicas: 3
- • Cooldown: 10 seconds
- • Concurrency: 1 request per replica
- • Metric: Concurrency utilization
Model Files
random_forest_classifier.pkldecision_tree_classifier.pklcnn_model.h5knn_model.pklscaler.pklimputer.pklPerformance
Cold Start
Model loading time for idle replicas
Warm Response
Response time for active replicas
Availability
Uptime on Cerebrium platform
Concurrent Requests
Maximum concurrent requests
API Features
- • Multiple ML Models (Random Forest, Decision Tree, KNN, CNN)
- • Earth Similarity Index (ESI) calculation
- • Batch processing support
- • Model selection options
- • Automatic OpenAPI documentation