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.
Trigger a suite run
Trigger a suite run. Schedules scenario executions for all active scenarios x targets x repeatCount. When the id names a test suite, the targets, the repeat count and the models are read from the body. Deprecated: use /api/v1/run-plans and /api/v1/test-suites.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The run plan this run joins or creates. Used only when the id names a test suite; derived from the suite name and the targets when absent.
The prompts, agents or workflows the run goes against. Read only when the id names a test suite, which stores no target of its own; a run plan already holds its own and refuses these.
How many times each scenario and target pairing runs, between 1 and 5. Used only when the id names a test suite.
The model that plays the user for every scenario in the run. Used only when the id names a test suite.
The model that judges every scenario in the run. Used only when the id names a test suite.
Milliseconds (0 to 60000) the agent's trace must stay unchanged before the judge reads it, for every scenario in the run. Used only when the id names a test suite.
Milliseconds (1000 to 300000) the judge waits for the agent's trace before a verdict, for every scenario in the run. Used only when the id names a test suite.
Constant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name.
One short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/suites/<id>/run"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.post( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/suites/<id>/run";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/suites/<id>/run' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project.Request: POST https://app.langwatch.ai/api/v1/suites/<id>/runReference: https://langwatch.ai/docs/api-reference/suites/action-run.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "scheduled": false, "batchRunId": "string", "setId": "string", "jobCount": 0, "skippedArchived": { "scenarios": [ "string" ], "targets": [ "string" ] }, "items": [ { "scenarioRunId": "string", "scenarioId": "string", "target": { "type": "prompt", "referenceId": "string", "scenarioMappings": {}, "runParameters": {}, "runSecretParameterNames": [ "string" ] }, "name": "string" } ], "planName": "string", "created": false, "planSlug": "string"}Not Found
application/json · Generated from schema
{ "error": "string", "message": "string"}Path parameters
idstringrequiredRequest body
application/json
idempotencyKeystringnamestringThe run plan this run joins or creates. Used only when the id names a test suite; derived from the suite name and the targets when absent.
targetsobject[]The prompts, agents or workflows the run goes against. Read only when the id names a test suite, which stores no target of its own; a run plan already holds its own and refuses these.
repeatCountintegerHow many times each scenario and target pairing runs, between 1 and 5. Used only when the id names a test suite.
simulatorModelstring | nullThe model that plays the user for every scenario in the run. Used only when the id names a test suite.
judgeModelstring | nullThe model that judges every scenario in the run. Used only when the id names a test suite.
traceQuietPeriodMsinteger | nullMilliseconds (0 to 60000) the agent's trace must stay unchanged before the judge reads it, for every scenario in the run. Used only when the id names a test suite.
traceWaitTimeoutMsinteger | nullMilliseconds (1000 to 300000) the judge waits for the agent's trace before a verdict, for every scenario in the run. Used only when the id names a test suite.
parametersobjectConstant values applied to every scenario in the run, e.g. a fixture id or a tenant. A value supplied here overrides the scenario's own default for that name.
notestringOne short line describing why this batch was run, e.g. a commit hash or what you changed. It is stored on every run of the batch and shown beside the run in the platform. Up to 200 characters.
Responses
200Success
application/json
scheduledbooleanrequiredbatchRunIdstringrequiredsetIdstringrequiredjobCountnumberrequiredskippedArchivedobjectrequireditemsobject[]requiredplanNamestringcreatedbooleanplanSlugstringrequired404Not Found
application/json
errorstringrequiredmessagestring