Skip to main content
Docsapi

API Endpoints

Complete reference for all DeepAILab API endpoints. Each endpoint includes parameters, code examples, and response formats.

POSThttps://api.deepailab.ai/v1/models/{model_id}/train

Train Model#

Start a training or fine-tuning job for a model. The training job will run asynchronously and you can track its progress via the experiments endpoint.

Request body

dataset_idRequired
string

The ID of the dataset to use for training.

hyperparametersOptional
object

Training configuration including epochs, batch_size, learning_rate, etc.

validation_splitOptional
number

Fraction of data to use for validation (default: 0.1).

Example request

bash
curl https://api.deepailab.ai/v1/models/model_abc123/train \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "dataset_id": "ds_xyz789",
 "hyperparameters": {
 "epochs": 3,
 "batch_size": 32,
 "learning_rate": 2e-5
 }
 }'

Response

json
{
 "id": "job_train_99381",
 "object": "training.job",
 "model_id": "model_abc123",
 "status": "pending",
 "created_at": 1698765432,
 "hyperparameters": {
 "epochs": 3,
 "batch_size": 32,
 "learning_rate": 2e-5
 }
}
POSThttps://api.deepailab.ai/v1/models/{model_id}/predict

Create Prediction#

Run inference on a deployed model. Send input data and receive predictions. The model must be deployed before calling this endpoint.

Request body

inputsRequired
object

Input data matching the model's expected schema.

parametersOptional
object

Inference parameters like temperature, top_k, etc.

Example request

bash
curl https://api.deepailab.ai/v1/models/model_abc123/predict \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "inputs": {
 "text": "Classify this customer review sentiment."
 }
 }'

Response

json
{
 "id": "pred_12345",
 "object": "prediction",
 "model_id": "model_abc123",
 "predictions": [
 {
 "label": "positive",
 "score": 0.9823
 }
 ],
 "usage": {
 "input_tokens": 8,
 "latency_ms": 45
 }
}
POSThttps://api.deepailab.ai/v1/nas/searches

Create NAS Search#

Start an automated Neural Architecture Search (NAS) to find the optimal model architecture for your task and constraints.

Request body

task_typeRequired
string

Type of task: 'classification', 'detection', 'segmentation', etc.

dataset_idRequired
string

Dataset to use for architecture evaluation.

constraintsRequired
object

Resource constraints including max_latency_ms, max_params, max_flops.

search_spaceOptional
string

Predefined search space: 'small', 'medium', 'large' (default: 'medium').

Example request

bash
curl https://api.deepailab.ai/v1/nas/searches \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "task_type": "image_classification",
 "dataset_id": "ds_imagenet_subset",
 "constraints": {
 "max_latency_ms": 50,
 "max_params": 5000000
 }
 }'

Response

json
{
 "id": "nas_88219",
 "object": "nas.search",
 "status": "running",
 "task_type": "image_classification",
 "created_at": 1698765432,
 "estimated_duration_hours": 4,
 "architectures_evaluated": 0,
 "best_architecture": null
}
POSThttps://api.deepailab.ai/v1/models/{model_id}/deploy

Deploy Model#

Deploy a trained model to a production endpoint. Once deployed, the model can serve real-time predictions via the predict endpoint.

Request body

replicasOptional
integer

Number of instances to run (default: 1).

instance_typeOptional
string

Compute instance type: 'cpu', 'gpu-small', 'gpu-large'.

auto_scalingOptional
object

Auto-scaling configuration with min_replicas and max_replicas.

Example request

bash
curl https://api.deepailab.ai/v1/models/model_abc123/deploy \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "replicas": 2,
 "instance_type": "gpu-small"
 }'

Response

json
{
 "id": "dep_11235",
 "object": "deployment",
 "model_id": "model_abc123",
 "status": "provisioning",
 "endpoint_url": "https://api.deepailab.ai/v1/endpoints/dep_11235",
 "replicas": 2,
 "instance_type": "gpu-small",
 "created_at": 1698765432
}
GEThttps://api.deepailab.ai/v1/experiments

List Experiments#

Returns a list of experiments (training jobs, evaluations) belonging to the user's organization.

Request body

statusOptional
string

Filter by status: 'pending', 'running', 'completed', 'failed'.

limitOptional
integer

Number of experiments to return (default: 20, max: 100).

afterOptional
string

Cursor for pagination. Use the id of the last experiment from previous request.

Example request

bash
curl "https://api.deepailab.ai/v1/experiments?status=running&limit=10" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY"

Response

json
{
 "object": "list",
 "data": [
 {
 "id": "exp_123",
 "object": "experiment",
 "name": "BERT Fine-tuning V2",
 "status": "running",
 "created_at": 1698765432,
 "metrics": {
 "loss": 0.45,
 "accuracy": 0.89
 }
 }
 ],
 "has_more": true
}