Models endpoint
A model is an instance of a machine learning recipe that is trained using historical data and configurations to solve for a business use case.
Retrieve a list of Models
You can retrieve a list of Model details belonging to all Models by performing a single GET request to /models. By default this list will order itself from oldest created model and limit the results to 25. You may choose to filter results by specifying some query parameters. For a list of available queries, refer to the appendix section on query parameters for asset retrieval.
API format
GET /models
Request
curl -X GET \
https://platform.adobe.io/data/sensei/models/ \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing the details of your Models including each Models unique identifier (id
).
{
"children": [
{
"id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"name": "A name for this Model",
"experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "A description for this Model",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
},
{
"id": "27c53796-bd6b-4u59-b51d-7296aa20er23",
"name": "Model 2",
"experimentId": "3cb25a2d-2cbd-4d34-a619-8ddae5259a5t",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "A description for Model2",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
},
{
"id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"name": "Model 3",
"experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "A description for Model3",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
},
],
"_page": {
"property": "deleted==false",
"count": 3
}
}
id
modelArtifactUri
name
value for the model.experimentId
experimentRunId
Retrieve a specific Model
You can retrieve a list of Model details belonging to a particular Model by performing a single GET request and providing a valid Model ID in the request path. To help filter results, you can specify query parameters in the request path. For a list of available queries, refer to the appendix section on query parameters for asset retrieval.
API Format
GET /models/{MODEL_ID}
GET /models/?property=experimentRunID=={EXPERIMENT_RUN_ID}
{MODEL_ID}
{EXPERIMENT_RUN_ID}
Request
The following request contains a query and retrieves a list of trained Models sharing the same experimentRunID ({EXPERIMENT_RUN_ID}).
curl -X GET \
https://platform.adobe.io/data/sensei/models/?property=experimentRunId==33408593-2871-4198-a812-6d1b7d939cda \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing the details of your Model including the Models unique identifier (id
).
{
"children": [
{
"id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"name": "A name for this Model",
"experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "A description for this Model",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
}
],
"_page": {
"property": "experimentRunId==33408593-2871-4198-a812-6d1b7d939cda,deleted==false",
"count": 1
}
}
id
modelArtifactUri
name
value for the model.experimentId
experimentRunId
Register a pre-generated Model register-a-model
You can register a pre-generated Model by making a POST request to the /models
endpoint. In order to register your Model, the modelArtifact
file and model
property values need to be included in the body of the request.
API Format
POST /models
Request
The following POST contains the modelArtifact
file and model
property values that are needed. See the table below for more information on these values.
curl -X POST \
https://platform.adobe.io/data/sensei/models \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-F 'modelArtifact=@/Users/yourname/Desktop/model.onnx' \
-F 'model={
"name": "Your Model - 0615-1342-45",
"originType": "offline"
}'
modelArtifact
model
Response
A successful response returns a payload containing the details of your Model including the Models unique identifier (id
).
{
"id": "a28f151a-597a-4a7e-87e9-1c1dbc9c2af7",
"name": "Your Model - 0615-1342-45",
"originType": "offline",
"modelArtifactUri": "http://storageblobml.blob.core.windows.net/prod-models/a28f151a-597a-4a7e-87e9-1c1dbc9c2af7",
"created": "2020-06-15T20:55:41.520Z",
"updated": "2020-06-15T20:55:41.520Z",
"deprecated": false
}
id
modelArtifactUri
id
value for your model.Update a Model by ID
You can update an existing Model by overwriting its properties through a PUT request that includes the target Model’s ID in the request path and providing a JSON payload containing updated properties.
API Format
PUT /models/{MODEL_ID}
{MODEL_ID}
Request
curl -X PUT \
https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'Content-Type: application/vnd.adobe.platform.sensei+json;profile=mlInstance.v1.json' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
-d '{
"id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"name": "A name for this Model",
"experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "An updated description for this Model",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
}'
Response
A successful response returns a payload containing the Experiment’s updated details.
{
"id": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"name": "A name for this Model",
"experimentId": "5cb25a2d-2cbd-4c99-a619-8ddae5250a7b",
"experimentRunId": "33408593-2871-4198-a812-6d1b7d939cda",
"description": "An updated description for this Model",
"modelArtifactUri": "wasb://test-models@mlpreprodstorage.blob.core.windows.net/model-name",
"created": "2019-01-01T00:00:00.000Z",
"createdBy": {
"userId": "Jane_Doe@AdobeID"
},
"updated": "2019-01-02T00:00:00.000Z"
}
Delete a Model by ID
You can delete a single Model by performing a DELETE request that includes the target Model’s ID in the request path.
API Format
DELETE /models/{MODEL_ID}
{MODEL_ID}
Request
curl -X DELETE \
https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing a 200 status confirming the deletion of the Model.
{
"title": "Success",
"status": 200,
"detail": "Model deletion was successful"
}
Create a new transcoding for a Model create-transcoded-model
Transcoding is the direct digital-to-digital conversion of one encoding to another. You create a new transcoding for a Model by providing the {MODEL_ID}
and a targetFormat
you want the new output to be in.
API Format
POST /models/{MODEL_ID}/transcodings
{MODEL_ID}
Request
curl -X POST \
https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: text/plain' \
-D '{
"id": "491a3be5-1d32-4541-94d5-cd1cd07affb5",
"modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"targetFormat": "CoreML",
"created": "2019-12-16T19:59:08.360Z",
"createdBy": {
"userId": "FDD760CD5CD467380A495FE2@AdobeID"
},
"updated": "2019-12-19T18:37:43.696Z",
"deleted": false,
}'
Response
A successful response returns a payload containing a JSON object with the information of your transcoding. This includes the transcodings unique identifier (id
) used in retrieving a specific transcoded Model.
{
"id": "491a3be5-1d32-4541-94d5-cd1cd07affb5",
"modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"targetFormat": "CoreML",
"created": "2020-06-12T22:01:55.886Z",
"createdBy": {
"userId": "FDD760CD5CD467380A495FE2@AdobeID"
},
"updated": "2020-06-12T22:01:55.886Z",
"deleted": false
}
Retrieve a list of transcodings for a Model retrieve-transcoded-model-list
You can retrieve a list of transcodings that have been performed on a Model by performing a GET request with your {MODEL_ID}
.
API Format
GET /models/{MODEL_ID}/transcodings
{MODEL_ID}
Request
curl -X GET \
https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing a json object with a list of each transcoding performed on the Model. Each transcoded Model receives a unique identifier (id
).
{
"children": [
{
"id": "460aa5a1-e972-455d-b8dc-4bc6cd91edb6",
"modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"created": "2019-12-20T01:07:50.978Z",
"createdBy": {
"userId": "FDD760CD5CD467380A495FE2@AdobeID"
},
"updated": "2019-12-20T01:07:50.978Z",
"deprecated": false
},
{
"id": "bdb3e4c2-4702-4045-86b4-17ee40df91cc",
"modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"created": "2019-12-20T17:48:26.473Z",
"createdBy": {
"userId": "FDD760CD5CD467380A495FE2@AdobeID"
},
"updated": "2019-12-20T17:48:26.473Z",
"deprecated": false
}
],
"_page": {
"property": "modelId==15c53796-bd6b-4e09-b51d-7296aa20af71,deleted==false,deprecated==false",
"count": 2
}
}
Retrieve a specific transcoded Model retrieve-transcoded-model
You can retrieve a specific transcoded Model by performing a GET request with your {MODEL_ID}
and the id of a transcoded model.
API Format
GET /models/{MODEL_ID}/transcodings/{TRANSCODING_ID}
{MODEL_ID}
{TRANSCODING_ID}
Request
curl -X GET \
https://platform.adobe.io/data/sensei/models/15c53796-bd6b-4e09-b51d-7296aa20af71/transcodings/460aa5a1-e972-455d-b8dc-4bc6cd91edb6 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a payload containing a JSON object with the data of the transcoded Model.
{
"id": "460aa5a1-e972-455d-b8dc-4bc6cd91edb6",
"modelId": "15c53796-bd6b-4e09-b51d-7296aa20af71",
"created": "2019-12-20T01:07:50.978Z",
"createdBy": {
"userId": "FDD760CD5CD467380A495FE2@AdobeID"
},
"updated": "2019-12-20T01:07:50.978Z",
"deprecated": false
}