Skip to content

Write Endpoints

Note that access to the Comet REST endpoints require the {'Authorization': ${COMET_API_KEY}} header. You can find your API key in your account settings or by navigating to https://www.comet.com/api/my/settings/.

Set Code

post /api/rest/v2/write/experiment/code

Set an experiment's associated source code

Example Request

application/json
{
  "experimentKey": "someExperimentKey",
  "code": "someCode"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Log Graph

post /api/rest/v2/write/experiment/graph

Log an experiment's associated model graph

Example Request

application/json
{
  "experimentKey": "someExperimentKey",
  "graph": "someGraph"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Log Output

post /api/rest/v2/write/experiment/output

Log a line of standard output or standard error

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "runContext": "required: someContext",
  "outputLines": [
    {
      "localTimestamp": "[Long timestamp for this line of output]",
      "offset": "[Long used to order lines of output]",
      "output": "someOutput",
      "stderr": "[Boolean true is this was stdout, false if this was stderr]"
    }
  ]
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Add Registry Model Version Stage

get /api/rest/v2/write/registry-model/item/stage?modelItemId=someRegistryModelItemId&stage=production

Add a stage to a Registry Model Version

Example Response

200 application/json
"default response"

Add Tags

post /api/rest/v2/write/experiment/tags

Add a list of tags to an experiment

Example Request

application/json
{
  "experimentKey": "someExperimentKey",
  "addedTags": [
    "someTag",
    "anotherTag"
  ]
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Archive Experiment

get /api/rest/v2/write/experiment/archive?experimentKey=KEY

Archive an experiment

Example Response

200 application/json
{
  "msg": "Archived"
}

Create Project

post /api/rest/v2/write/project/create

Create a project

Example Request

application/json
{
  "projectName": "required: someProjectName",
  "projectDescription": "required: someProjectDescription",
  "workspaceName": "required: someTeamName"
}

Example Response

200 application/json
{
  "projectId": "someProjectId"
}

Create Registry Model

post /api/rest/v2/write/registry-model

Create a new Registry Model

Example Request

application/json
{
  "experimentModelId": "someExperimentModelId",
  "registryModelName": "someRegistryModelName",
  "description": "Some Description",
  "isPublic": false,
  "version": "someVersion",
  "comment": "Some Comment",
  "stages": [
    "production",
    "staging"
  ]
}

Example Response

200 application/json
{
  "registryModelId": "someRegistryModelId",
  "registryModelItemId": "someRegistryModelItemId"
}

Delete Experiment

get /api/rest/v2/write/experiment/delete?experimentKey=KEY

Delete an experiment

Example Response

200 application/json
{
  "msg": "Deleted"
}

Delete Project

post /api/rest/v2/write/project/delete

Delete a project

Example Request

application/json
{
  "projectName": "required: someTeamName",
  "workspaceName": "required: someProjectName",
  "deleteAllExperiments": false
}

Example Response

200 application/json
{
  "msg": "Deleted"
}

Delete Registry Model

get /api/rest/v2/write/registry-model/delete?workspaceName=someWorkspaceName&modelName=someRegistryModelName

Delete a Registry Model

Example Response

200 application/json
"default response"

Delete Registry Model Version

get /api/rest/v2/write/registry-model/item/delete?modelItemId=someRegistryModelItemId

Delete a Registry Model version

Example Response

200 application/json
"default response"

Send Experiment Keep-Alive Signal

get /api/rest/v2/write/experiment/set-status?experimentKey=KEY

Send an experiment's keep-alive signal. The response tells the client how often to send the keep-alive signal, and how often to report CPU and GPU usage. Typically, a live experiment requests that the isAliveBeatDurationMillis is around 10 seconds, and an offline experiment requests about 10 minutes. In any event, the return status will send the suggested time intervals. The isAliveBeatDurationMillis determines when an experiment is no longer shown as processing in the frontend GUI

Example Response

200 application/json
{
  "isAliveBeatDurationMillis": 10000,
  "gpuMonitorIntervalMillis": 60000,
  "cpuMonitorIntervalMillis": 68000
}

Create Experiment

post /api/rest/v2/write/experiment/create

Create an experiment

Example Request

application/json
{
  "workspaceName": "required: someTeamName",
  "projectName": "required: someProjectName",
  "experimentName": "optional: someExperimentName"
}

Example Response

200 application/json
{
  "experimentKey": "someExperimentKey",
  "workspaceName": "someTeamName",
  "projectName": "someProjectName",
  "link": "link to experiment"
}

Promote Experiment Model to Registry Model

post /api/rest/v2/write/registry-model/item

Promote a model from an experiment to a Registry Model as a new version

Example Request

application/json
{
  "experimentModelId": "someExperimentModelId",
  "registryModelName": "someRegistryModelName",
  "version": "someVersion",
  "comment": "Some Comment",
  "stages": [
    "production",
    "staging"
  ]
}

Example Response

200 application/json
{
  "registryModelId": "someRegistryModelId",
  "registryModelItemId": "someRegistryModelItemId"
}

Remove Registry Model Version Stage

get /api/rest/v2/write/registry-model/item/stage/delete?modelItemId=someRegistryModelItemId&stage=production

Remove a stage from a Registry Model Version

Example Response

200 application/json
"default response"

Restore Experiment

get /api/rest/v2/write/experiment/restore?experimentKey=KEY

Restore an experiment

Example Response

200 application/json
{
  "msg": "Restore"
}

Stop Experiment

get /api/rest/v2/write/experiment/stop?experimentKey=KEY

Stop an experiment

Example Response

200 application/json
{
  "msg": "Stop Requested"
}

Set Git Metadata

post /api/rest/v2/write/experiment/git/metadata

Set an experiment's git metadata

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "user": "required: gitUser",
  "root": "required: gitRoot",
  "branch": "required: gitBranch",
  "parent": "required: gitParent",
  "origin": "required: gitOrigin"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Set Experiment Start and End Time

post /api/rest/v2/write/experiment/set-start-end-time

Set an experiment's start and end time

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Set System Details

post /api/rest/v2/write/experiment/system-details

Set some or all of the system details

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "user": "optional: someUser",
  "pythonVersion": "optional: somePythonVersion",
  "pythonVersionVerbose": "optional: somePythonVersionVerbose",
  "osType": "optional: someOsType",
  "os": "optional: someOs",
  "ip": "optional: someIp",
  "hostname": "optional: someHostname",
  "env": "JsonNode",
  "gpuStaticInfoList": [
    {
      "name": "name",
      "uuid": "someUniqueId"
    }
  ],
  "logAdditionalSystemInfoList": [
    {
      "key": "some key",
      "value": "some value"
    }
  ],
  "networkInterfaceIps": [
    "a network interface ip",
    "another network interface ip"
  ],
  "command": [
    "myScript.py",
    "-arg",
    "theArgument"
  ],
  "executable": "/usr/local/bin/python",
  "osPackages": [
    "an os packages",
    "another os package"
  ],
  "installedPackages": [
    "an installed packages",
    "another installed package"
  ]
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Add CPU Metrics

post /api/rest/v2/write/experiment/cpu-metrics

Add an instance of CPU usage metrics

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "cpuPercentUtilization": [
    "12",
    "99",
    "[Int percentage, ordered by cpu]"
  ],
  "context": "optional: someContext"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Add GPU Metrics

post /api/rest/v2/write/experiment/gpu-metrics

Add an instance of GPU usage metrics

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "gpus": [
    {
      "freeMemory": "required: [Long]",
      "usedMemory": "required: [Long]",
      "gpuUtilization": "required: [Int percentage utilization]",
      "totalMemory": "required: [Long]"
    }
  ],
  "context": "optional: someContext"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Set HTML

post /api/rest/v2/write/experiment/html

Set (or append onto) an experiment's HTML

Example Request

application/json
{
  "html": "required: someHtml",
  "experimentKey": "required: someExperimentKey",
  "override": false
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Add Processor Load Metrics

post /api/rest/v2/write/experiment/load-metrics

Add an instance of processor load metrics

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "loadAverage": "required: [Double]",
  "context": "optional: someContext"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Log Other

post /api/rest/v2/write/experiment/log-other

Log a key/value other data (not a metric, system, or parameter). Note that you can only retrieve others summary data (e.g., this is not recorded as a full time series)

Example Request

application/json
{
  "key": "required: someKey",
  "value": "required: someValue",
  "experimentKey": "required: someExperimentKey"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Log Metric

post /api/rest/v2/write/experiment/metric

Log a metric name and value. Metrics are the only items that are logged as a full time series. However, even metrics can be throttled if too much data (either by rate or by count) is attempted to be logged

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "metricName": "required: someMetricName",
  "metricValue": "required: someMetricValue",
  "context": "optional: someContext"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Log Parameter

post /api/rest/v2/write/experiment/parameter

Log a parameter name and value. Note that you can only retrieve parameters summary data (e.g., this is not recorded as a full time series)

Example Request

application/json
{
  "parameterName": "required: someParamName",
  "parameterValue": "required: someParamValue",
  "experimentKey": "required: someExperimentKey"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Add RAM Metrics

post /api/rest/v2/write/experiment/ram-metrics

Add an instance of RAM usage metrics

Example Request

application/json
{
  "experimentKey": "required: someExperimentKey",
  "totalRam": "required: [Long]",
  "usedRam": "required: [Long]",
  "context": "optional: someContext"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

get /api/rest/v2/write/project/symlink?experimentKey=KEY&projectName=someProjectName

Add a symlink to an experiment

Example Response

200 application/json
{
  "link": "symlink to experiment under the new project"
}

Update Project

post /api/rest/v2/write/project/update

Update a project's metadata. Either projectId should be non null, Or both projectName and workspaceName should be non null. They should not all be null or all be non null

Example Request

application/json
{
  "projectId": "someProjectId",
  "projectName": "someProjectName",
  "workspaceName": "someTeamName",
  "newProjectName": "optional: someProjectName",
  "newProjectDescription": "optional: someProjectDescription",
  "isPublic": false
}

Example Response

200 application/json
{
  "msg": "Updated"
}

Update Registry Model

post /api/rest/v2/write/registry-model/update

Update a Registry Model's name, description, and/or visibility

Example Request

application/json
{
  "registryModelId": "someRegistryModelId",
  "registryModelName": "newRegistryModelName",
  "description": "New Description",
  "isPublic": false
}

Example Response

200 application/json
"default response"

Update Registry Model Version

post /api/rest/v2/write/registry-model/item/update

Update a Registry Model version's comment and/or stages

Example Request

application/json
{
  "registryModelItemId": "someRegistryModelItemId",
  "comment": "Some Comment",
  "stages": [
    "production",
    "staging"
  ]
}

Example Response

200 application/json
"default response"

Update Registry Model Notes

post /api/rest/v2/write/registry-model/notes

Update the notes for a Registry Model

Example Request

application/json
{
  "workspaceName": "someWorkspaceName",
  "registryModelName": "someRegistryModelName",
  "notes": "A potentially very long notes string"
}

Example Response

200 application/json
"default response"

Upload Text Sample

post /api/rest/v2/write/experiment/upload-text-sample

Upload a text sample

Example Request

application/json
{
  "apiKey": "someApiKey",
  "experimentKey": "someExperimentKey",
  "metadata": "[64 bit encoded metadata blob]",
  "context": "optional: someContext",
  "tags": [
    "string"
  ],
  "content": "The text sample"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Upload Asset

post /api/rest/v2/write/experiment/upload-asset?experimentKey=required: someExperimentKey&extension=optional: jpg&context=optional: someContext&type=optional: someType&metadata=optional: [64 bit encoded metadata blob]&fileName=optional: myAsset.jpg&overwrite=False

Upload an asset

Example Request

multipart/form-data
null

Example Response

200 application/json
{
  "msg": "Saved"
}

Upload Git Patch

post /api/rest/v2/write/experiment/git/patch?experimentKey=required: someExperimentKey

Upload a git patch for this experiment

Example Request

multipart/form-data
null

Example Response

200 application/json
{
  "msg": "Saved"
}

Save Store

post /api/rest/v2/write/viz-instance/store/save

Save an entire store

Example Request

application/json
{
  "instanceId": "required: INSTANCE_ID",
  "projectId": "required: PROJECT_ID",
  "store": "required: {'store': '{key1: value1, ...}'}"
}

Example Response

200 application/json
{
  "msg": "Stored"
}

Update notes for Project

post /api/rest/v2/write/project/notes

Update the notes for a project

Example Request

application/json
{
  "projectId": "required: someProjectId",
  "notes": "required: someNotesString"
}

Example Response

200 application/json
{
  "msg": "Saved"
}

Dec. 17, 2024