Skip to main content
POST
Create an experiment

Authorizations

X-Auth-Token
string
header
required

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Body

application/json
experiment_slug
string
required

Stable slug you choose. Reusing it returns the same experiment instead of creating another, which is what makes repeated runs land together.

experiment_type
enum<string>
required

BATCH_EVALUATION_V2 for SDK batch evaluations, DSPY for optimizer runs

Available options:
DSPY,
BATCH_EVALUATION,
BATCH_EVALUATION_V2
experiment_id
string

Existing experiment id, as an alternative to the slug

experiment_name
string

Display name, used only when the experiment is created

workflowId
string

Optimization Studio workflow this experiment belongs to

Response

The experiment, created or already existing

slug
string
required

Slug of the experiment, created or existing

path
string
required

Path to the experiment in the LangWatch app