Skip to main content

Experiments

Create, manage, and compare ML experiments. Experiments provide a structured way to track model training runs, hyperparameter configurations, and results across your machine learning projects.

All endpoints require authentication via X-API-Key header (external) or JWT Bearer token (internal platform services via auth-proxy) and the appropriate scope.


Experiment Object

{
"id": "exp_abc123",
"name": "Sentiment Analysis v2",
"description": "Comparing transformer architectures for sentiment classification",
"status": "running",
"owner": "user_456",
"organizationId": "org_xyz",
"tags": ["nlp", "sentiment", "production"],
"pinned": true,
"runCount": 12,
"bestRunId": "run_789",
"isPublic": false,
"sharedWith": ["user_789"],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-02-01T14:22:00Z"
}

GET /api/v1/experiments

List all experiments accessible to the authenticated user.

Scope: ml-workbench:read

Query Parameters

ParameterTypeRequiredDescription
searchstringNoSearch by experiment name or description
statusstringNoFilter by status: draft, running, completed, failed
tagstringNoFilter by tag
pinnedbooleanNoFilter by pinned status (true or false)
limitintegerNoNumber of results to return (default: 20)
offsetintegerNoNumber of results to skip (default: 0)
sortstringNoSort field and direction, e.g. createdAt:desc

Response 200 OK

{
"count": 28,
"limit": 20,
"offset": 0,
"experiments": [
{
"id": "exp_abc123",
"name": "Sentiment Analysis v2",
"description": "Comparing transformer architectures for sentiment classification",
"status": "running",
"owner": "user_456",
"organizationId": "org_xyz",
"tags": ["nlp", "sentiment", "production"],
"pinned": true,
"runCount": 12,
"bestRunId": "run_789",
"isPublic": false,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-02-01T14:22:00Z"
}
]
}

POST /api/v1/experiments

Create a new experiment or run.

Scope: ml-workbench:write

Request Body

{
"name": "Sentiment Analysis v2",
"description": "Comparing transformer architectures for sentiment classification",
"tags": ["nlp", "sentiment"],
"run_id": "run_abc123",
"experiment_name": "my-experiment",
"run_name": "baseline-run",
"parameters": { "learning_rate": 0.01, "epochs": 10 },
"modelType": "classification",
"problem_type": "binary",
"framework": "sklearn",
"parent_run_id": "run_parent_abc",
"system_info": { "python_version": "3.11.0", "platform": "linux" }
}
FieldTypeRequiredDescription
namestringYes*Experiment name
experiment_namestringNoAlternative to name (used by AutoML trainer and SDK)
run_namestringNoAlternative to name (falls back if name not provided)
descriptionstringNoExperiment description
tagsstring[]NoArray of tag strings for categorization
run_idstringNoCustom run identifier
parametersobject or arrayNoHyperparameters (objects auto-converted to key-value arrays)
final_metricsobject or arrayNoFinal metrics (objects auto-converted to key-value arrays)
modelTypestringNoModel type (e.g., classification, regression)
problem_typestringNoProblem type (e.g., binary, multiclass)
frameworkstringNoML framework (e.g., sklearn, pytorch)
parent_run_idstringNoParent run ID for nested runs
system_infoobjectNoSystem information (Python version, platform, etc.)
statusstringNoInitial status (default: pending)
duration_secondsnumberNoRun duration in seconds

* If name is not provided, run_name or experiment_name will be used as the name.

Response 201 Created

{
"id": "exp_abc123",
"experiment_id": "exp_abc123",
"run_id": "run_abc123",
"name": "Sentiment Analysis v2",
"status": "pending",
"createdAt": "2025-01-15T10:30:00Z"
}

GET /api/v1/experiments/:id

Get a single experiment by ID.

Scope: ml-workbench:read

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment ID

Response 200 OK

Returns the full Experiment object.


PUT /api/v1/experiments/:id

Update an existing experiment or run.

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment ID

Request Body

{
"name": "Sentiment Analysis v2 - Updated",
"description": "Updated description with new findings",
"status": "completed",
"final_metrics": { "accuracy": 0.95, "f1_score": 0.92 },
"error_message": "Optional error message if failed"
}
FieldTypeRequiredDescription
namestringNoExperiment name
descriptionstringNoExperiment description
tagsstring[]NoArray of tag strings
statusstringNoNew status (running, completed, failed)
final_metricsobject or arrayNoFinal metrics (objects auto-converted to key-value arrays)
duration_secondsnumberNoRun duration in seconds
error_messagestringNoError message (when status is failed)

Response 200 OK

Returns the updated Experiment object.


DELETE /api/v1/experiments/:id

Delete an experiment and all associated runs. This action is irreversible.

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment ID

Response 204 No Content


POST /api/v1/experiments/:id/pin

Toggle the pinned status of an experiment. Pinned experiments appear at the top of list views for quick access.

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment ID

Response 200 OK

{
"id": "exp_abc123",
"pinned": true,
"message": "Experiment pinned successfully"
}

PUT /api/v1/experiments/:id/tags

Replace the tags on an experiment. Overwrites the existing tag list.

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment ID

Request Body

{
"tags": ["nlp", "sentiment", "production", "v2"]
}
FieldTypeRequiredDescription
tagsstring[]YesArray of tag strings to set on the experiment

Response 200 OK

{
"id": "exp_abc123",
"tags": ["nlp", "sentiment", "production", "v2"],
"message": "Tags updated successfully"
}

GET /api/v1/experiments/compare

Compare two or more experiments side by side, including metrics and configuration differences.

Scope: ml-workbench:read

Query Parameters

ParameterTypeRequiredDescription
idsstringYesComma-separated list of experiment IDs to compare (minimum 2)

Response 200 OK

{
"experiments": [
{
"id": "exp_abc123",
"name": "Sentiment Analysis v2",
"status": "completed",
"runCount": 12,
"bestRunId": "run_789",
"bestMetrics": {
"accuracy": 0.934,
"f1Score": 0.921,
"loss": 0.187
},
"tags": ["nlp", "sentiment"],
"createdAt": "2025-01-15T10:30:00Z"
},
{
"id": "exp_def456",
"name": "Sentiment Analysis v3",
"status": "completed",
"runCount": 8,
"bestRunId": "run_012",
"bestMetrics": {
"accuracy": 0.951,
"f1Score": 0.943,
"loss": 0.142
},
"tags": ["nlp", "sentiment", "transformer"],
"createdAt": "2025-01-22T09:15:00Z"
}
]
}

GET /api/v1/experiments/stats

Get aggregate statistics for experiments in the organization.

Scope: ml-workbench:read

Response 200 OK

{
"total": 28,
"running": 3,
"completed": 18,
"failed": 5,
"pinned": 7
}

Run Tracking Endpoints

These endpoints are used by the Python SDK and AutoML trainer to log metrics, parameters, and artifacts during training runs.


POST /api/v1/experiments/register

Register or find an experiment by name. If an experiment with the given name already exists for the authenticated user, returns it. Otherwise, creates a new one.

Scope: ml-workbench:write

Request Body

{
"name": "my-classification-experiment",
"description": "Optional description",
"tags": ["nlp", "v2"]
}
FieldTypeRequiredDescription
namestringYesExperiment name
descriptionstringNoExperiment description
tagsstring[]NoArray of tags

Response 200 OK (existing) or 201 Created (new)

{
"experiment_id": "exp_abc123",
"name": "my-classification-experiment",
"exists": true
}

POST /api/v1/experiments/:id/metrics

Log metrics to an experiment run. Metrics are appended to the existing metrics array.

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment/run ID

Request Body

{
"metrics": [
{ "key": "train_loss", "value": 0.25, "step": 5 },
{ "key": "val_loss", "value": 0.30, "step": 5 },
{ "key": "accuracy", "value": 0.92, "step": 5 }
]
}
FieldTypeRequiredDescription
metricsarrayYesArray of metric objects with key, value, and optional step/timestamp

Response 200 OK

{
"logged": 3
}

POST /api/v1/experiments/:id/params

Log parameters to an experiment run. Parameters are merged with existing parameters (new keys added, existing keys updated).

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment/run ID

Request Body

{
"params": {
"learning_rate": 0.01,
"batch_size": 32,
"optimizer": "adam"
}
}
FieldTypeRequiredDescription
paramsobjectYesKey-value pairs of parameters to log

Response 200 OK

{
"logged": 3
}

POST /api/v1/experiments/:id/artifacts

Register or upload an artifact with an experiment run. Supports two modes:

  1. Metadata registration — provide s3_key for an already-uploaded artifact
  2. Direct upload — provide content_base64 to upload file content (SDK usage)

Scope: ml-workbench:write

Path Parameters

ParameterTypeRequiredDescription
idstringYesExperiment/run ID

Request Body

{
"name": "model_weights.pkl",
"path": "models/model_weights.pkl",
"type": "model",
"s3_key": "experiments/exp_abc123/artifacts/model_weights.pkl",
"size": 1048576,
"content_type": "application/octet-stream"
}

Or with direct upload:

{
"name": "results.csv",
"type": "file",
"content_base64": "aWQsYWNjdXJhY3kKMSwwLjk1Cg==",
"content_type": "text/csv"
}
FieldTypeRequiredDescription
namestringYesDisplay name for the artifact
s3_keystringNo*S3 key of an already-uploaded artifact
content_base64stringNo*Base64-encoded file content for direct upload
pathstringNoArtifact path (defaults to name)
typestringNoArtifact type: file, model, dataset, image (default: file)
sizeintegerNoFile size in bytes
content_typestringNoMIME type

* Either s3_key or content_base64 must be provided.

Response 200 OK

{
"artifact": {
"name": "model_weights.pkl",
"path": "models/model_weights.pkl",
"type": "model",
"s3_key": "experiments/exp_abc123/artifacts/model_weights.pkl",
"size": 1048576,
"content_type": "application/octet-stream",
"created_at": "2025-01-15T12:00:00Z"
}
}