---
title: "Create experiment"
method: POST
path: "/v1/private/experiments"
tags: ["Experiments"]
---

# Create experiment

`POST /v1/private/experiments`

Create experiment

## Request body

- ExperimentWrite
  - `id` string, uuid
  - `dataset_name` string, nullable, required
  - `project_id` string, uuid — Project ID. Takes precedence over project_name when both are provided.
  - `project_name` string — Project name. Creates project if it doesn't exist. Ignored when project_id is provided.
  - `name` string
  - `metadata` JsonListStringWrite
  - `tags` string[]
  - `type` 'regular' | 'trial' | 'mini-batch' | 'mutation'
  - `evaluation_method` 'dataset' | 'evaluation_suite'
  - `optimization_id` string, uuid
  - `status` 'running' | 'completed' | 'cancelled'
  - `experiment_scores` ExperimentScoreWrite[]
    - `name` string, required
    - `value` number, required
  - `prompt_version` PromptVersionLinkWrite
    - `id` string, uuid, required
  - `prompt_versions` PromptVersionLinkWrite[]
    - `id` string, uuid, required
  - `dataset_version_id` string, 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.

## Response `201`

Created

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
