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.
Run a configuration under a name
Run a configuration under a name. The name identifies the run plan: send a name already in use and that plan's configuration is replaced with this one, send a new name and the plan is created, send no name and one is derived from what the run covers and what it runs against.
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. A run plan is identified by its name, so sending the same name again replaces that plan's configuration with this one. Leave it out and the name is derived from what the run covers and what it runs against. Up to 200 characters.
Repeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.
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, and a target that names the same parameter in its runParameters overrides it for that target.
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/run-plans/run"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = { "config": {},}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/run-plans/run";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({ "config": {} }),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/run-plans/run' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"config":{}}'Call the LangWatch API from this project.Request: POST https://app.langwatch.ai/api/v1/run-plans/runReference: https://langwatch.ai/docs/api-reference/run-plans/create-run.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{ "config": {}}```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" } ], "runPlanId": "string", "planName": "string", "created": false, "platformUrl": "string"}Request body
application/json · Required
namestringThe run plan this run joins or creates. A run plan is identified by its name, so sending the same name again replaces that plan's configuration with this one. Leave it out and the name is derived from what the run covers and what it runs against. Up to 200 characters.
configobjectrequiredWhat this run covers and what it runs against. Written onto the run plan the name resolves.
idempotencyKeystringRepeat the same key to make a retry join the batch the first call started instead of running everything again. Send the same request with it: the same key over a different configuration starts its own batch. Defaults to a new key per call.
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, and a target that names the same parameter in its runParameters overrides it for that target.
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
scheduledbooleanrequiredTrue once the runs are queued.
batchRunIdstringrequiredThe id of this batch. Every run started here carries it.
setIdstringrequiredThe result set the batch is filed under in the platform.
jobCountnumberrequiredHow many runs were queued.
skippedArchivedobjectrequiredWhat the run left out, and why.
itemsobject[]requiredEvery run this call queued.
runPlanIdstringrequiredThe run plan this run was filed under.
planNamestringrequiredThe name that plan answers to.
createdbooleanrequiredTrue when this run created the plan, false when it joined a plan already there.
platformUrlstring (uri)requiredWhere to watch this run in the LangWatch platform.