Skip to main content
POST
/
api
/
v2
/
projects
/
{project_id}
/
test-runs
Create Test Run
curl --request POST \
  --url https://api.example.com/api/v2/projects/{project_id}/test-runs \
  --header 'Content-Type: application/json' \
  --data '
{
  "dataset_name": "<string>",
  "include_outputs": true,
  "test_run_name": "<string>",
  "test_run_description": "<string>",
  "flavor_name": "<string>",
  "target_evaluation_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}
'
{
  "test_run_id": "<string>",
  "test_run_name": "<string>",
  "test_run_description": "<string>",
  "test_cases": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "values": "<unknown>",
      "output": "<string>",
      "output_message": {
        "content": [
          {
            "text": "<string>",
            "type": "text"
          }
        ],
        "role": "user"
      },
      "history": [
        {
          "content": [
            {
              "text": "<string>",
              "type": "text"
            }
          ],
          "role": "user"
        }
      ],
      "metadata": {}
    }
  ],
  "trace_test_cases": [
    {
      "test_case_id": "<string>",
      "input": true,
      "output": true,
      "custom_metadata": {},
      "test_case_type": "trace"
    }
  ]
}

Path Parameters

project_id
string
required

Body

application/json
dataset_name
string
required
include_outputs
boolean | null
test_run_name
string | null
test_run_description
string | null
flavor_name
string | null
target_evaluation_ids
string<uuid>[] | null

Response

201 - application/json

TestRunWithTestCasesInfo(test_run_id: str, test_run_name: str, test_run_description: str, test_cases: Optional[list[server.api_routes.test_runs_api_v2.TestCaseInfo]], trace_test_cases: Optional[list[server.api_routes.test_runs_api_v2.TraceTestCaseInfo]])

test_run_id
string
required
test_run_name
string
required
test_run_description
string
required
test_cases
TestCaseInfo · object[] | null
required
trace_test_cases
TraceTestCaseInfo · object[] | null
required