Skip to content

On-premise users: click in-app to access the full platform documentation for your version of DataRobot.

Playgrounds (GenAI)

This page outlines the operations, endpoints, parameters, and example requests and responses for the Playgrounds (GenAI).

GET /api/v2/genai/playgrounds/

List playgrounds.

Code samples

# You can also use wget
curl -X GET https://app.datarobot.com/api/v2/genai/playgrounds/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
useCaseId query any false Only retrieve the playgrounds linked to the specified use cases.
offset query integer false Skip the specified number of values.
limit query integer false Retrieve only the specified number of values.
search query any false Only retrieve the playgrounds with names matching the search query.
sort query any false Apply this sort order to the results. Valid options are "name", "description", "creationDate", "creationUserId", "lastUpdateDate", "lastUpdateUserId", "savedLLMBlueprintsCount". Prefix the attribute name with a dash to sort in descending order, e.g., sort=-creationDate.

Example responses

200 Response

{
  "count": 0,
  "data": [
    {
      "creationDate": "2019-08-24T14:15:22Z",
      "creationUserId": "string",
      "description": "string",
      "id": "string",
      "lastUpdateDate": "2019-08-24T14:15:22Z",
      "lastUpdateUserId": "string",
      "llmBlueprintsCount": 0,
      "name": "string",
      "savedLLMBlueprintsCount": 0,
      "useCaseId": "string",
      "userName": "string"
    }
  ],
  "next": "string",
  "previous": "string",
  "totalCount": 0
}

Responses

Status Meaning Description Schema
200 OK Successful Response ListPlaygroundsResponse
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

POST /api/v2/genai/playgrounds/

Create a new playground.

Code samples

# You can also use wget
curl -X POST https://app.datarobot.com/api/v2/genai/playgrounds/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{CreatePlaygroundRequest}'

Body parameter

{
  "copyInsights": {
    "sourcePlaygroundId": "string",
    "withEvaluationDatasets": false
  },
  "description": "string",
  "name": "string",
  "useCaseId": "string"
}

Parameters

Name In Type Required Description
body body CreatePlaygroundRequest true none

Example responses

201 Response

{
  "creationDate": "2019-08-24T14:15:22Z",
  "creationUserId": "string",
  "description": "string",
  "id": "string",
  "lastUpdateDate": "2019-08-24T14:15:22Z",
  "lastUpdateUserId": "string",
  "llmBlueprintsCount": 0,
  "name": "string",
  "savedLLMBlueprintsCount": 0,
  "useCaseId": "string",
  "userName": "string"
}

Responses

Status Meaning Description Schema
201 Created Successful Response PlaygroundResponse
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

DELETE /api/v2/genai/playgrounds/{playgroundId}/

Delete an existing playground.

Code samples

# You can also use wget
curl -X DELETE https://app.datarobot.com/api/v2/genai/playgrounds/{playgroundId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
playgroundId path string true The ID of the playground to delete.

Example responses

422 Response

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
204 No Content Successful Response None
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/genai/playgrounds/{playgroundId}/

Retrieve an existing playground.

Code samples

# You can also use wget
curl -X GET https://app.datarobot.com/api/v2/genai/playgrounds/{playgroundId}/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
playgroundId path string true The ID of the playground to retrieve.

Example responses

200 Response

{
  "creationDate": "2019-08-24T14:15:22Z",
  "creationUserId": "string",
  "description": "string",
  "id": "string",
  "lastUpdateDate": "2019-08-24T14:15:22Z",
  "lastUpdateUserId": "string",
  "llmBlueprintsCount": 0,
  "name": "string",
  "savedLLMBlueprintsCount": 0,
  "useCaseId": "string",
  "userName": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful Response PlaygroundResponse
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

PATCH /api/v2/genai/playgrounds/{playgroundId}/

Edit an existing playground.

Code samples

# You can also use wget
curl -X PATCH https://app.datarobot.com/api/v2/genai/playgrounds/{playgroundId}/ \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
  -d '{undefined}'

Body parameter

{
  "description": "string",
  "name": "string"
}

Parameters

Name In Type Required Description
playgroundId path string true The ID of the playground to edit.
body body EditPlaygroundRequest true none

Example responses

200 Response

{
  "creationDate": "2019-08-24T14:15:22Z",
  "creationUserId": "string",
  "description": "string",
  "id": "string",
  "lastUpdateDate": "2019-08-24T14:15:22Z",
  "lastUpdateUserId": "string",
  "llmBlueprintsCount": 0,
  "name": "string",
  "savedLLMBlueprintsCount": 0,
  "useCaseId": "string",
  "userName": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful Response PlaygroundResponse
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

GET /api/v2/genai/playgrounds/{playgroundId}/ootbMetricConfigurations/

List OOTB metric configurations for the selected playground.

Code samples

# You can also use wget
curl -X GET https://app.datarobot.com/api/v2/genai/playgrounds/{playgroundId}/ootbMetricConfigurations/ \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Parameters

Name In Type Required Description
playgroundId path string true The ID of the playground.

Example responses

200 Response

{
  "ootbMetricConfigurations": [
    {
      "customModelLLMValidationId": "string",
      "customOotbMetricName": "string",
      "errorMessage": "string",
      "errorResolution": [
        "ootbMetricName"
      ],
      "executionStatus": "NEW",
      "llmId": "azure-openai-gpt-3.5-turbo",
      "moderationConfiguration": {
        "guardConditions": [
          {
            "comparand": 0,
            "comparator": "greaterThan"
          }
        ],
        "intervention": {
          "action": "block",
          "message": "string"
        }
      },
      "ootbMetricConfigurationId": "string",
      "ootbMetricName": "latency"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OOTB metric configurations list OOTBMetricConfigurationsResponse
422 Unprocessable Entity Validation Error HTTPValidationErrorResponse

To perform this operation, you must be authenticated by means of one of the following methods:

BearerAuth

Schemas

CopyInsightsRequest

{
  "sourcePlaygroundId": "string",
  "withEvaluationDatasets": false
}

CopyInsightsRequest

Properties

Name Type Required Restrictions Description
sourcePlaygroundId string true The ID of the existing playground from where to copy insights.
withEvaluationDatasets boolean false If true also copies source playground evaluation datasets to target playground.

CreatePlaygroundRequest

{
  "copyInsights": {
    "sourcePlaygroundId": "string",
    "withEvaluationDatasets": false
  },
  "description": "string",
  "name": "string",
  "useCaseId": "string"
}

CreatePlaygroundRequest

Properties

Name Type Required Restrictions Description
copyInsights CopyInsightsRequest¦null false If present, copy insights from source playground to the created playground.
description string true maxLength: 5000
The description of the playground.
name string true maxLength: 5000
The name of the playground.
useCaseId string true The ID of the use case to link the playground to.

EditPlaygroundRequest

{
  "description": "string",
  "name": "string"
}

EditPlaygroundRequest

Properties

Name Type Required Restrictions Description
description string¦null false maxLength: 5000
If specified, updates the playground description to this value.
name string¦null false maxLength: 5000
If specified, renames the playground to this value.

ExecutionStatus

"NEW"

ExecutionStatus

Properties

Name Type Required Restrictions Description
ExecutionStatus string false Job and entity execution status.

Enumerated Values

Property Value
ExecutionStatus [NEW, RUNNING, COMPLETED, REQUIRES_USER_INPUT, SKIPPED, ERROR]

GuardCondition

{
  "comparand": 0,
  "comparator": "greaterThan"
}

GuardCondition

Properties

Name Type Required Restrictions Description
comparand any true The comparand(s) used in the guard condition.

anyOf

Name Type Required Restrictions Description
» anonymous number false none

or

Name Type Required Restrictions Description
» anonymous string false none

or

Name Type Required Restrictions Description
» anonymous boolean false none

or

Name Type Required Restrictions Description
» anonymous [string] false none

continued

Name Type Required Restrictions Description
comparator GuardConditionComparator true The comparator used in the guard condition.

GuardConditionComparator

"greaterThan"

GuardConditionComparator

Properties

Name Type Required Restrictions Description
GuardConditionComparator string false The comparator used in a guard condition.

Enumerated Values

Property Value
GuardConditionComparator [greaterThan, lessThan, equals, notEquals, is, isNot, matches, doesNotMatch, contains, doesNotContain]

HTTPValidationErrorResponse

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

HTTPValidationErrorResponse

Properties

Name Type Required Restrictions Description
detail [ValidationError] false none

InsightErrorResolution

"ootbMetricName"

InsightErrorResolution

Properties

Name Type Required Restrictions Description
InsightErrorResolution string false Error type linking directly to the field name that is related to the error.

Enumerated Values

Property Value
InsightErrorResolution [ootbMetricName, intervention, guardCondition, sidecarOverall, sidecarRevalidate, sidecarDeploymentId, sidecarInputColumnName, sidecarOutputColumnName, promptPipelineFiles, promptPipelineTemplateId, responsePipelineFiles, responsePipelineTemplateId]

Intervention

{
  "action": "block",
  "message": "string"
}

Intervention

Properties

Name Type Required Restrictions Description
action ModerationAction true The intervention strategy.
message string true minLength: 1
minLength: 1
The intervention message to replace the prediction when a guard condition is satisfied.

LanguageModelTypeId

"azure-openai-gpt-3.5-turbo"

LanguageModelTypeId

Properties

Name Type Required Restrictions Description
LanguageModelTypeId string false The ID that defines the type of the LLM.

Enumerated Values

Property Value
LanguageModelTypeId [azure-openai-gpt-3.5-turbo, azure-openai-gpt-3.5-turbo-16k, azure-openai-gpt-4, azure-openai-gpt-4-32k, azure-openai-gpt-4-turbo, azure-openai-gpt-4-o, amazon-titan, anthropic-claude-2, anthropic-claude-3-haiku, anthropic-claude-3-sonnet, anthropic-claude-3-opus, google-bison, google-gemini-1.5-flash, google-gemini-1.5-pro, custom-model]

ListPlaygroundSortQueryParam

"name"

ListPlaygroundSortQueryParam

Properties

Name Type Required Restrictions Description
ListPlaygroundSortQueryParam string false Sort order values for listing playgrounds.

Enumerated Values

Property Value
ListPlaygroundSortQueryParam [name, -name, description, -description, creationUserId, -creationUserId, creationDate, -creationDate, lastUpdateUserId, -lastUpdateUserId, lastUpdateDate, -lastUpdateDate, savedLLMBlueprintsCount, -savedLLMBlueprintsCount, llmBlueprintsCount, -llmBlueprintsCount]

ListPlaygroundsResponse

{
  "count": 0,
  "data": [
    {
      "creationDate": "2019-08-24T14:15:22Z",
      "creationUserId": "string",
      "description": "string",
      "id": "string",
      "lastUpdateDate": "2019-08-24T14:15:22Z",
      "lastUpdateUserId": "string",
      "llmBlueprintsCount": 0,
      "name": "string",
      "savedLLMBlueprintsCount": 0,
      "useCaseId": "string",
      "userName": "string"
    }
  ],
  "next": "string",
  "previous": "string",
  "totalCount": 0
}

ListPlaygroundsResponse

Properties

Name Type Required Restrictions Description
count integer true The number of records on this page.
data [PlaygroundResponse] true The list of records.
next string¦null true The URL to the next page, or null if there is no such page.
previous string¦null true The URL to the previous page, or null if there is no such page.
totalCount integer true The total number of records.

ModerationAction

"block"

ModerationAction

Properties

Name Type Required Restrictions Description
ModerationAction string false The moderation strategy.

Enumerated Values

Property Value
ModerationAction [block, report, reportAndBlock]

ModerationConfigurationWithoutID

{
  "guardConditions": [
    {
      "comparand": 0,
      "comparator": "greaterThan"
    }
  ],
  "intervention": {
    "action": "block",
    "message": "string"
  }
}

ModerationConfigurationWithoutID

Properties

Name Type Required Restrictions Description
guardConditions [GuardCondition] true maxItems: 1
minItems: 1
The guard conditions associated with a metric.
intervention Intervention true The intervention specific moderation configuration.

OOTBMetricConfigurationResponse

{
  "customModelLLMValidationId": "string",
  "customOotbMetricName": "string",
  "errorMessage": "string",
  "errorResolution": [
    "ootbMetricName"
  ],
  "executionStatus": "NEW",
  "llmId": "azure-openai-gpt-3.5-turbo",
  "moderationConfiguration": {
    "guardConditions": [
      {
        "comparand": 0,
        "comparator": "greaterThan"
      }
    ],
    "intervention": {
      "action": "block",
      "message": "string"
    }
  },
  "ootbMetricConfigurationId": "string",
  "ootbMetricName": "latency"
}

OOTBMetricConfigurationResponse

Properties

Name Type Required Restrictions Description
customModelLLMValidationId string¦null false The ID of the custom model LLM validation (if using a custom model LLM).
customOotbMetricName string¦null false The custom OOTB metric name to be associated with the OOTB metric.
errorMessage string¦null false The error message associated with the OOTB metric configuration.
errorResolution [InsightErrorResolution]¦null false The error type associated with the insight error status and error message as an indicator of what fields needs to be edited if any.
executionStatus ExecutionStatus true The execution status of the OOTB metric configuration.
llmId LanguageModelTypeId¦null false The ID of the LLM to use for correctness and faithfulness metrics.
moderationConfiguration ModerationConfigurationWithoutID¦null false The moderation configuration to be associated with the OOTB metric.
ootbMetricConfigurationId string true The ID of OOTB metric.
ootbMetricName OOTBMetricInsightNames true The Out-Of-The-Box metric name that can be used in the playground.

OOTBMetricConfigurationsResponse

{
  "ootbMetricConfigurations": [
    {
      "customModelLLMValidationId": "string",
      "customOotbMetricName": "string",
      "errorMessage": "string",
      "errorResolution": [
        "ootbMetricName"
      ],
      "executionStatus": "NEW",
      "llmId": "azure-openai-gpt-3.5-turbo",
      "moderationConfiguration": {
        "guardConditions": [
          {
            "comparand": 0,
            "comparator": "greaterThan"
          }
        ],
        "intervention": {
          "action": "block",
          "message": "string"
        }
      },
      "ootbMetricConfigurationId": "string",
      "ootbMetricName": "latency"
    }
  ]
}

OOTBMetricConfigurationsResponse

Properties

Name Type Required Restrictions Description
ootbMetricConfigurations [OOTBMetricConfigurationResponse] true The list of OOTB metric configurations to use.

OOTBMetricInsightNames

"latency"

OOTBMetricInsightNames

Properties

Name Type Required Restrictions Description
OOTBMetricInsightNames string false The Out-Of-The-Box metric name that can be used in the playground.

Enumerated Values

Property Value
OOTBMetricInsightNames [latency, citations, rouge_1, faithfulness, correctness, prompt_tokens, response_tokens, document_tokens, all_tokens, jailbreak_violation, toxicity_violation, pii_violation, exact_match]

PlaygroundResponse

{
  "creationDate": "2019-08-24T14:15:22Z",
  "creationUserId": "string",
  "description": "string",
  "id": "string",
  "lastUpdateDate": "2019-08-24T14:15:22Z",
  "lastUpdateUserId": "string",
  "llmBlueprintsCount": 0,
  "name": "string",
  "savedLLMBlueprintsCount": 0,
  "useCaseId": "string",
  "userName": "string"
}

PlaygroundResponse

Properties

Name Type Required Restrictions Description
creationDate string(date-time) true The creation date of the playground (ISO 8601 formatted).
creationUserId string true The ID of the user that created this playground.
description string true The description of the playground.
id string true The ID of the playground.
lastUpdateDate string(date-time) true The date of the most recent update of this playground (ISO 8601 formatted).
lastUpdateUserId string true The ID of the user that made the most recent update to this playground.
llmBlueprintsCount integer true The number of LLM blueprints in this playground.
name string true The name of the playground.
savedLLMBlueprintsCount integer true The number of saved LLM blueprints in this playground.
useCaseId string true The ID of the use case this playground belongs to.
userName string true The name of the user that created this playground.

ValidationError

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

ValidationError

Properties

Name Type Required Restrictions Description
loc [anyOf] true none

anyOf

Name Type Required Restrictions Description
» anonymous string false none

or

Name Type Required Restrictions Description
» anonymous integer false none

continued

Name Type Required Restrictions Description
msg string true none
type string true none

Updated January 24, 2025