Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Create experiment

POST/v1/private/experimentsCreate experiment

Create experiment

Request body

application/json
objectExperiment_Write
dataset_namenull | stringrequired

minLength 1

dataset_version_idstring · uuid

ID of the dataset version this experiment is linked to. If not provided at creation, experiment will be automatically linked to the latest version.

evaluation_methodstring

one of "dataset", "evaluation_suite"

experiment_scoresarray of object
Show child attributes
Show array items
namestringrequired

minLength 1

valuenumberrequired
idstring · uuid
metadataobject
Show child attributes
anyOf · 3 options
Option 1object
Option 2array of object
Option 3string
namestring
optimization_idstring · uuid
project_idstring · uuid

Project ID. Takes precedence over project_name when both are provided.

project_namestring

Project name. Creates project if it doesn't exist. Ignored when project_id is provided.

pattern (?s)^\s*(\S.*\S|\S)\s*$

prompt_versionobject
prompt_versionsarray of object
Show child attributes
statusstring

one of "running", "completed", "cancelled"

tagsarray of string

maxItems 50 · minItems 0 · uniqueItems true

Show child attributes

maxItems 50 · minItems 0 · uniqueItems true

typestring

one of "regular", "trial", "mini-batch", "mutation"

Example request
{
  "dataset_name": "string",
  "dataset_version_id": "00000000-0000-0000-0000-000000000000",
  "evaluation_method": "dataset",
  "experiment_scores": [
    {
      "name": "string",
      "value": 0
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "metadata": {},
  "name": "string",
  "optimization_id": "00000000-0000-0000-0000-000000000000",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "project_name": "string",
  "prompt_version": {
    "id": "00000000-0000-0000-0000-000000000000"
  },
  "prompt_versions": [
    {
      "id": "00000000-0000-0000-0000-000000000000"
    }
  ],
  "status": "cancelled",
  "tags": [
    "string"
  ],
  "type": "mini-batch"
}

Responses

201Created

Headers

Location
Documentation menu