Endpoints

/workspaces

GET/rest/v1/workspaces
Fetch all of the workspaces associated with the user

Example curl request

curl https://www.comet.ml/api/rest/v1/workspaces \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "workspaces": [ "Brandon", "Walsh" ]
}

/projects

GET/rest/v1/projects
Fetch all of the projects associated with the user
Query Params
workspaceworkspace name

Example curl request

curl https://www.comet.ml/api/rest/v1/projects?workspace=${WORKSPACE_NAME} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "projects": [
    {
      "project_id": "NA",
      "user_name": "some-user-name",
      "project_name": "general",
      "project_desc": "View all experiments that aren't assigned to a project.",
      "is_owner": true,
      "is_public": false,
      "is_shared": false,
      "num_of_experiments": 1,
      "last_updated": 1527183924215
    }
  ]
}


/experiments

GET/rest/v1/experiments
Fetch all experiments metadata related to the provided project
Query Params
projectIdrepresents the project id for a particular project

Example curl request

curl https://www.comet.ml/api/rest/v1/experiments?projectId=${PROJECT_ID} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "experiments": [
    {
      "code_sha": "N/A",
      "file_name": "test.py",
      "file_path": "/tmp/test.py",
      "duration_millis": 0,
      "start_server_timestamp": 1527184671290,
      "end_server_timestamp": 1527184671290,
      "has_images": false,
      "experiment_key": "someExperimentKey",
      "optimization_id": "someOptimizationId"
    }
  ]
}


/experiment/html

GET/rest/v1/experiment/html
Fetch the logged html associated with a particular experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/html?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "html": "<html><div>some html</div></html>"
}


/experiment/code

GET/rest/v1/experiment/code
Fetch logged source code identified by the provided experiment key
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/code?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "code": "someCodeSnippet"
}


/experiment/stdout

GET/rest/v1/experiment/stdout
Fetch logged stdout for the specified experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/stdout?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "output": "some stdout"
}


/experiment/installed-packages

GET/rest/v1/experiment/installed-packages
Fetch the list of installed packages related to the given experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/installed-packages?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "packages": [
    "package1"
  ]
}


/experiment/graph

GET/rest/v1/experiment/graph
Fetch the graph data logged the the specific experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/graph?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "graph": "someGraph"
}


/experiment/images

GET/rest/v1/experiment/images
Fetch logged images which were added for the identified experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/images?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "images": [
    {
      "apiKey": "someApiKey",
      "runId": "someRunId0123456789012345",
      "experimentKey": "someExperimentKey",
      "projectId": null,
      "figCounter": 123,
      "figName": "imageName",
      "step": 12312,
      "runContext": "contextA",
      "fileName": "file.py",
      "imagePath": "https://comet-ml.nyc3.digitaloceanspaces.com/file.py"
    }
  ]
}


/experiment/params

GET/rest/v1/experiment/params
Fetch logged params for the specific experiment identified
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/params?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "results": [
    {
      "name": "nameA",
      "valueMax": "valueA",
      "valueMin": "valueA",
      "valueCurrent": "valueA",
      "timestampMax": 1527266735622,
      "timestampMin": 1527266735622,
      "timestampCurrent": 1527266735622,
      "runContextMax": "",
      "runContextMin": "",
      "runContextCurrent": "",
      "stepMax": null,
      "stepMin": null,
      "stepCurrent": null
    }
  ]
}


/experiment/metrics

GET/rest/v1/experiment/metrics
Fetch aggregated metrics related to the identified experiment
Query Params
experimentKeyThe experiment key

Info

This endpoint only returns aggregated results for each metric (min, max, last). If you're looking to fetch a timeseries of all metric's data point use /experiment/metrics-raw

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/metrics?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "results": [
    {
      "name": "someNameA",
      "valueMax": "1.123",
      "valueMin": "1.123",
      "valueCurrent": "1.123",
      "timestampMax": 1527266664729,
      "timestampMin": 1527266664729,
      "timestampCurrent": 1527266664729,
      "runContextMax": null,
      "runContextMin": null,
      "runContextCurrent": null,
      "stepMax": null,
      "stepMin": null,
      "stepCurrent": null
    }
  ]
}


/experiment/metrics-raw

GET/rest/v1/experiment/metrics-raw
Fetch raw metrics related to the identified experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/metrics-raw?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "metrics": [
    {
      "metricName": "batch",
      "metricValue": "0",
      "timestamp": 1519918455197,
      "step": null,
      "runContext": null,
      "offset": 16
    },
    {
      "metricName": "size",
      "metricValue": "120",
      "timestamp": 1519918455197,
      "step": null,
      "runContext": null,
      "offset": 17
    }
  ]
}


/experiment/log-other

GET/rest/v1/experiment/log-other
Fetch other logged information that was added to the specified experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/log-other?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "logOtherList": [
    {
      "name": "key",
      "valueMax": "value",
      "valueMin": "value",
      "valueCurrent": "value",
      "timestampMax": 1527266796121,
      "timestampMin": 1527266796121,
      "timestampCurrent": 1527266796121,
      "runContextMax": null,
      "runContextMin": null,
      "runContextCurrent": null,
      "stepMax": null,
      "stepMin": null,
      "stepCurrent": null
    }
  ]
}


/experiment/git-metadata

GET/rest/v1/experiment/git-metadata
Fetch git information for experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/git-metadata?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "user": "The Git User",
  "root": "394116666634f0e220c75277b6d88534b7bcb324",
  "branch": "refs/heads/master",
  "parent": "9b6310a275427273ffbb782863b4175b5ea467da",
  "origin": "https://github.com/some/repo"
}


/experiment/system-details

GET/rest/v1/experiment/system-details
Fetch system information for experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/system-details?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "user": "trevin",
  "python_version": "3.6.5",
  "python_version_verbose": "3.6.5 (default, May  3 2018, 10:08:28) \n[GCC 5.4.0 20160609]",
  "pid": 6355,
  "os_type": "Linux",
  "os": "Linux-4.15.0-33-generic-x86_64-with-Ubuntu-16.04-xenial",
  "ip": "192.168.11.12",
  "hostname": "symphony-2",
  "gpuStaticInfoList": [
    {
      "name": "GeForce GTX 1080 Ti",
      "uuid": "GPU-4e45035e-c31f-3001-ea80-5bdd446e22c2",
      "total_memory": -1165492224,
      "power_limit": 250000
    }
  ],
  "logAdditionalSystemInfoList": [
    {
      "key": "some manual input",
      "value": "some manual value"
    }
  ]
}


/experiment/tags

GET/rest/v1/experiment/tags
Fetch experiment tags
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/experiment/tags?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

{
  "tags": ["tagA", "tagB"]
}


/git/get-patch

GET/rest/v1/git/get-patch
Download git patch for experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/git/get-patch?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

diff --git a/diff_test.txt b/diff_test.txt
index 6b0c6cf..b37e70a 100644
--- a/diff_test.txt
+++ b/diff_test.txt
@@ -1 +1 @@
-this is a git diff test example
+this is a diff example


/asset/get-asset-list

GET/rest/v1/asset/get-asset-list
Get list of assets for experiment
Query Params
experimentKeyThe experiment key

Example curl request

curl https://www.comet.ml/api/rest/v1/asset/get-asset-list?experimentKey=${EXPERIMENT_KEY} \
    -H"Authorization: ${COMET_REST_API_KEY}"

Sample output

[
  {
    "assetId": "6YZYszn9cO9mhDoYrfuQlDLcE",
    "fileName": "file.py",
    "fileSize": 7,
    "runConext": "contextA",
    "step": 12312,
    "link": "https://www.comet.ml/api/rest/v1/asset/get-asset?experimentKey=someExperimentKey&assetId=6YZYszn9cO9mhDoYrfuQlDLcE",
    "createdAt": 1544067813424,
    "dir": "assets"
  }
]


/asset/get-asset

GET/rest/v1/asset/get-asset
Download asset for experiment
Query Params
experimentKeyThe experiment key
assetIddesignated assetId from previous get-asset-list call

Example curl request

curl https://www.comet.ml/api/rest/v1/asset/get-asset?experimentKey=${EXPERIMENT_KEY}&assetId=${ASSET_ID} \
    -H"Authorization: ${COMET_REST_API_KEY}"


/write/new-experiment

POST/rest/v1/write/new-experiment
Create a new experiment
Body
{
  "workspace": "my-workspace",
  "project_name": "project-name",
  "experiment_name": "some-experiment-name" //Optional
}

Example curl request

curl -d '{"workspace":"my-workspace", "project_name":"project-name", "experiment_name":"some-experiment-name"}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST https://www.comet.ml/api/rest/v1/write/new-experiment

Response

{
  "experimentKey":"9b0d4c",
  "link":  "www.link.to.experiment.com"
}


/write/experiment-start-end-time

POST/rest/v1/write/experiment-start-end-time
Update experiment start or end time (can send both or seperate)

Body

{
  "experimentKey": "9b0d4c",
  "start_time_millis": 1544659390256,
  "end_time_millis": 1544659390379
}

Example curl request

curl -d '{"experimentKey":"9b0d4c", "start_time_millis":1544659390256, "end_time_millis":1544659390379}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST https://www.comet.ml/api/rest/v1/write/experiment-start-end-time

Response

{
  "msg":"saved"
}


/write/log-other

POST/rest/v1/write/log-other
Log other for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "key": "some key",
  "val": "some value"
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "key":"some key", "val":"some value"}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/log-other"

Response

{
  "msg":"saved"
}


/write/parameter

POST/rest/v1/write/parameter
Log hyper-parameter for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "paramName": "batch_size",
  "paramValue": "12",
  "step": 123 //Optional
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "paramName":"batch_size", "paramValue":"12", "step":123}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/parameter"

Response

{
  "msg":"saved"
}


/write/metric

POST/rest/v1/write/metric
Log metric for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "metricName": "acc",
  "metricValue": "12",
  "step": 123 //Optional
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "metricName":"acc", "metricValue":"12", "step":123}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/metric"

Info

Metrics are always sent as a "String" in the JSON body. Comet performs type conversion based on the value.


/write/git_metadata

POST/rest/v1/write/git_metadata
Log git information for experiment

Body

{
  "experimentKey": "9b0d4c",
  "sdkGitMetadataWithContext": {
    "runContext": "test",
    "sdkGitMetadata": {
      "user": "The Git User",
      "root": "394116666634f0e220c75277b6d88534b7bcb324",
      "branch": "refs/heads/master",
      "parent": "9b6310a275427273ffbb782863b4175b5ea467da",
      "origin": "https://github.com/some/repo"
    }
  }
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "sdkGitMetadataWithContext": {"runContext": "test", "sdkGitMetadata": {"user": "The Git User", "root": "394116666634f0e220c75277b6d88534b7bcb324", "branch": "refs/heads/master", "parent": "9b6310a275427273ffbb782863b4175b5ea467da", "origin": "https://github.com/some/repo"}}}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/git_metadata"

Sample output

{
  "msg":"saved"
}


/write/add-tags-to-experiment

POST/rest/v1/write/add-tags-to-experiment
Add tags to an experiment

Body

{
  "experimentKey": "9b0d4c",
  "addedTags": ["someTag", "anotherTag"]
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "addedTags": ["someTag", "anotherTag"]}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/add-tags-to-experiment"

Sample output

{
  "msg":"saved"
}


/write/html

POST/rest/v1/write/html
Log html for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "html": "<p>nice!</p>",
  "override": false //Optional - override previous html 
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "html":"nice!"}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/html"

Response

{
  "msg":"saved"
}


/write/code

POST/rest/v1/write/code
Log code for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "graph": "<p>code goes here</p>",
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "graph":"code goes here"}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/code"

Response

{
  "msg":"saved"
}


/write/graph

POST/rest/v1/write/graph
Log graph for an experiment

Body

{
  "experimentKey": "9b0d4c",
  "graph": "<p>graph contents here</p>",
}

Example curl request

curl -d '{"experimentKey": "9b0d4c", "graph":"graph contents here"}' \
  -H "Content-Type: application/json" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/graph"

Response

{
  "msg":"saved"
}


/write/upload-asset

POST/rest/v1/write/upload-asset
Log asset for an experiment
Query Params
experimentKeyThe experiment key
stepcurrent step (Optional)
overwriteoverwrite existing file (Optional)
contextthe current context (Optional)

Example curl request

curl -F 'file=@/tmp/cli.txt' \
  -H "Content-Type: multipart/form-data" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/upload-asset?experimentKey=${EXPERIMENT_KEY}"

Response

{
  "msg":"saved",
  "data": "asset ID" 
}


/write/upload-image

POST/rest/v1/write/upload-image
Log image for an experiment
Query Params
experimentKeyThe experiment key
figureNamename of uploaded image (Optional)
stepcurrent step (Optional)
overwriteoverwrite existing file (Optional)
contextthe current context (Optional)

Example curl request

curl -F 'file=@/tmp/1.jpg' \
  -H "Content-Type: multipart/form-data" -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/upload-image?experimentKey=${EXPERIMENT_KEY}?figureName=niceImage"

Response

{
  "msg":"saved"
}


/write/delete-experiment

POST/rest/v1/write/delete-experiment
Delete or archive an experiment
Query Params
experimentKeyThe experiment key
hardDeletehard delete (true), or archive (false)

Example curl request

curl -H "Authorization: ${COMET_REST_API_KEY}" \
  -X POST "https://www.comet.ml/api/rest/v1/write/delete-experiment?experimentKey=${EXPERIMENT_KEY}?hardDelete=false"

Response

{
 'msg': 'deleted',
 'code': 200,
 'data': None,
 'sdk_error_code': 0
}