Experiments API

이 제품은 선택한 Datadog 사이트에서 지원되지 않습니다. ().
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

As an alternative to using LLM Observability Experiments with the Python SDK, you can use the Experiments HTTP API to create and run experiments.

Postman quickstart

Datadog highly recommends importing the Experiments Postman collection into Postman. Postman’s View documentation feature can help you better understand this API.

Request format

FieldTypeDescription
dataObject: DataThe request body is nested within a top level data field.

Example: Creating a dataset

{
  "data": {
    "type": "datasets",  # request type
    "attributes": {
        "name": "Dataset example",
        "description": "Description example"
    }
  }
}

Response format

FieldTypeDescription
dataObject: DataThe request body of an experimentation API is nested within a top level data field.
metaObject: PagePagination attributes.

Example: Retrieving datasets

{
    "data": [
        {
            "id": "4ac5b6b2-dcdb-40a9-ab29-f98463f73b4z",
            "type": "datasets",
            "attributes": {
                "created_at": "2025-02-19T18:53:03.157337Z",
                "description": "Description example",
                "name": "Dataset example",
                "updated_at": "2025-02-19T18:53:03.157337Z"
            }
        }
    ],
    "meta": {
        "after": ""
    }
}

Object: Data

FieldTypeDescription
idstringThe ID of an experimentation entity.
Note: Set your ID field reference at this level.
typestringIdentifies the kind of resource an object represents. For example: experiments, datasets, etc.
attributesjsonContains all the resource’s data except for the ID.

Object: Page

FieldTypeDescription
afterstringThe cursor to use to get the next results, if any. Provide the page[cursor] query parameter in your request to get the next results.

Projects API

Request type: projects

List all projects, sorted by creation date. The most recently created projects are first.

Query parameters

ParameterTypeDescription
filter[id]stringThe ID of a project to search for.
filter[name]stringThe name of a project to search for.
page[cursor]stringList results with a cursor provided in the previous query.
page[limit]intLimits the number of results.

Response

FieldTypeDescription
within Data[]ProjectList of projects.

Object: Project

FieldTypeDescription
idUUIDUnique project ID. Set at the top level id field within the Data object.
namestringUnique project name.
descriptionstringProject description.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Create a project. If there is an existing project with the same name, the API returns the existing project unmodified.

Request

FieldTypeDescription
name (required)stringUnique project name.
descriptionstringProject description.

Response

FieldTypeDescription
idUUIDUnique project ID. Set at the top level id field within the Data object.
namestringUnique project name.
descriptionstringProject description.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Partially update a project object. Specify the fields to update in the payload.

Request

FieldTypeDescription
namestringUnique project name.
descriptionstringProject description.

Response

FieldTypeDescription
idUUIDUnique project ID. Set at the top level id field within the Data object.
namestringUnique project name.
descriptionstringProject description.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Delete one or more projects.

Request

FieldTypeDescription
project_ids (required)[]UUIDList of project IDs to delete.

Response

Empty body on success.

Datasets API

Request type: datasets

List all datasets, sorted by creation date. The most recently-created datasets are first.

Query parameters

ParameterTypeDescription
filter[name]stringThe name of a dataset to search for.
filter[id]stringThe ID of a dataset to search for.
page[cursor]stringList results with a cursor provided in the previous query.
page[limit]intLimits the number of results.

Response

FieldTypeDescription
within Data[]DatasetList of datasets.

Object: Dataset

FieldTypeDescription
idstringUnique dataset ID. Set at the top level id field within the Data object.
namestringUnique dataset name.
descriptionstringDataset description.
metadatajsonArbitrary key-value metadata associated with the dataset.
current_versionintThe current version number of the dataset. Versions start at 0 and increment when records are added or modified.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Create a dataset. If there is an existing dataset with the same name, the API returns the existing dataset unmodified.

Request

FieldTypeDescription
name (required)stringUnique dataset name.
descriptionstringDataset description.
metadatajsonArbitrary key-value metadata associated with the dataset.

Response

FieldTypeDescription
idUUIDUnique ID for the dataset. Set at the top level id field within the Data object.
namestringUnique dataset name.
descriptionstringDataset description.
metadatajsonArbitrary key-value metadata associated with the dataset.
current_versionintThe current version number of the dataset. Starts at 0 for new datasets.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

List all dataset records, sorted by creation date. The most recently-created records are first.

Query parameters

ParameterTypeDescription
filter[version]intList results for a given dataset version. If not specified, defaults to the dataset’s current version. Version numbers start at 0.
page[cursor]stringList results with a cursor provided in the previous query.
page[limit]intLimits the number of results.

Notes:

  • Without filter[version], you get records from the current version only, not all versions.
  • To retrieve records from a specific historical version, use filter[version]=N where N is the version number.
  • Version numbers start at 0 when a dataset is created.

Response

FieldTypeDescription
within Data[]RecordList of dataset records.

Object: Record

FieldTypeDescription
idstringUnique record ID.
dataset_idstringUnique dataset ID.
inputany (string, number, Boolean, object, array)Data that serves as the starting point for an experiment.
expected_outputany (string, number, Boolean, object, array)Expected output.
metadatajsonArbitrary key-value metadata associated with the record.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Appends records for a given dataset.

Request

FieldTypeDescription
deduplicateboolIf true, deduplicates appended records. Defaults to true.
records (required)[]RecordReqList of records to create.

Object: RecordReq

FieldTypeDescription
input (required)any (string, number, Boolean, object, array)Data that serves as the starting point for an experiment.
expected_outputany (string, number, Boolean, object, array)Expected output.
metadatajsonArbitrary key-value metadata associated with the record.

Response

FieldTypeDescription
records[]RecordList of created records.

Partially update a dataset object. Specify the fields to update in the payload.

Request

FieldTypeDescription
namestringUnique dataset name.
descriptionstringDataset description.
metadatajsonArbitrary key-value metadata associated with the dataset.

Response

FieldTypeDescription
idUUIDUnique ID for the dataset. Set at the top level id field within the Data object.
namestringUnique dataset name.
descriptionstringDataset description.
metadatajsonArbitrary key-value metadata associated with the dataset.
current_versionintThe current version number of the dataset. Metadata-only updates do not increment the version.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Partially update a one or more dataset record objects. Specify the fields to update in the payload.

Request

FieldTypeDescription
records (required)[]RecordUpdateList of records to update.

Object: RecordUpdate

FieldTypeDescription
id (required)stringUnique record ID.
inputany (string, number, Boolean, object, array)Updated input.
expected_outputany (string, number, Boolean, object, array)Updated expected output.
metadatajsonUpdated metadata.

Response

FieldTypeDescription
records[]RecordList of updated records.

Delete one or more datasets.

Request

FieldTypeDescription
dataset_ids (required)[]UUIDList of dataset IDs to delete.

Response

Empty body on success.

Delete one or more dataset records.

Request

FieldTypeDescription
record_ids (required)[]stringList of record IDs to delete.

Response

Empty body on success.

Experiments API

Request type: experiments

List all experiments, sorted by creation date. The most recently-created experiments are first.

Query parameters

ParameterTypeDescription
filter[project_id] (required if dataset not provided)stringThe ID of a project to retrieve experiments for.
filter[dataset_id]stringThe ID of a dataset to retrieve experiments for.
filter[id]stringThe ID(s) of an experiment to search for. To query for multiple experiments, use ?filter[id]=<>&filter[id]=<>.
page[cursor]stringList results with a cursor provided in the previous query.
page[limit]intLimits the number of results.

Response

FieldTypeDescription
within Data[]ExperimentList of experiments.

Object: Experiment

FieldTypeDescription
idUUIDUnique experiment ID. Set at the top level id field within the Data object.
project_idstringUnique project ID.
dataset_idstringUnique dataset ID.
namestringUnique experiment name.
descriptionstringExperiment description.
metadatajsonArbitrary key-value metadata associated with the experiment.
configjsonConfiguration used when creating the experiment.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Create an experiment. If there is an existing experiment with the same name, the API returns the existing experiment unmodified.

Request

FieldTypeDescription
project_id (required)stringUnique project ID.
dataset_id (required)stringUnique dataset ID.
dataset_versionintDataset version.
name (required)stringUnique experiment name.
descriptionstringExperiment description.
ensure_uniqueboolIf true, Datadog generates a new experiment with a unique name in the case of a conflict. Default is true.
metadatajsonArbitrary key-value metadata associated with the experiment.
configjsonConfiguration used when creating the experiment.

Response

FieldTypeDescription
idUUIDUnique experiment ID. Set at the top level id field within the Data object.
project_idstringUnique project ID.
dataset_idstringUnique dataset ID.
namestringUnique experiment name.
descriptionstringExperiment description.
metadatajsonArbitrary key-value metadata associated with the experiment.
configjsonConfiguration used when creating the experiment.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Partially update an experiment object. Specify the fields to update in the payload.

Request

FieldTypeDescription
namestringUnique experiment name.
descriptionstringExperiment description.

Response

FieldTypeDescription
idUUIDUnique experiment ID. Set at the top level id field within the Data object.
project_idstringUnique project ID.
dataset_idstringUnique dataset ID.
namestringUnique experiment name.
descriptionstringExperiment description.
metadatajsonArbitrary key-value metadata associated with the experiment.
configjsonConfiguration used when creating the experiment.
created_attimestampTimestamp representing when the resource was created.
updated_attimestampTimestamp representing when the resource was last updated.

Delete one or more experiments.

Request

FieldTypeDescription
experiment_ids (required)[]UUIDList of experiment IDs to delete.

Response

Empty body on success.

Push events (spans and metrics) for an experiment.

Request

FieldTypeDescription
spans[]SpanList of spans capturing experiment task execution.
metrics[]MetricList of evaluator metrics associated with spans.

Object: Span

FieldTypeDescription
trace_idstringTrace ID. Must be different from the span_id value.
span_idstringSpan ID. Must be different from the trace_id value.
project_idstringProject ID.
dataset_idstringDataset ID.
namestringSpan name (for example, task name).
start_nsnumberSpan start time in nanoseconds.
durationnumberSpan duration in nanoseconds.
tags[]stringTags to associate with the span (for example, model).
statusstringSpan status (for example, ok).
meta.inputjsonInput payload associated with the span.
meta.outputjsonOutput payload associated with the span.
meta.expected_outputjsonExpected output for the span.
meta.errorobjectError details: message, stack, type.

Object: Metric

FieldTypeDescription
span_idstringAssociated span ID.
metric_typestringMetric type. One of: score, categorical.
timestamp_msnumberUNIX timestamp in milliseconds.
labelstringMetric label (evaluator name).
score_valuenumberScore value (when metric_type is score).
categorical_valuestringCategorical value (when metric_type is categorical).
metadatajsonArbitrary key-value metadata associated with the metric.
error.messagestringOptional error message for the metric.

Response

Empty body on success.