Skip to contentSkip to page list

Docs

Create an experiment and its setup

Create an evaluations experiment. Send a setup to start from, or send none and get a blank workbench with one inline dataset. The slug it answers with is what every other experiment endpoint takes.

POST/api/v1/experiments
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/experiments"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.post(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "slug": "string",  "version": 0}
api-reference/experiments/post-create-an-experiment

Authorization

X-Auth-Tokenstringheaderrequired

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.

Request body

application/json

namestring

Name for the experiment. A draft name is picked when omitted.

At least 1 character
stateobject

Setup to start from. Omit for a blank workbench with one inline dataset.

Responses

200

Success

application/json

idstringrequired

Identifier of the created experiment

slugstringrequired

Slug to address the experiment by

versionnumberrequired

Version of the saved setup, starting at 1

400

The setup did not match the schema (experiment_invalid_workbench_state) or points at something that no longer exists (experiment_workbench_missing_reference)

Documentation