import requests
url = "https://app.langwatch.ai/api/v1/run-plans/run"
payload = { "config": {
"scope": { "mode": "all" },
"targets": [{ "referenceId": "<string>" }],
"repeatCount": 3,
"simulatorModel": "<string>",
"judgeModel": "<string>",
"scenarioIds": ["<string>"]
} }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
scope: {mode: 'all'},
targets: [{referenceId: '<string>'}],
repeatCount: 3,
simulatorModel: '<string>',
judgeModel: '<string>',
scenarioIds: ['<string>']
}
})
};
fetch('https://app.langwatch.ai/api/v1/run-plans/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/run-plans/run \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"config": {
"scope": {
"mode": "all"
},
"targets": [
{
"referenceId": "<string>"
}
],
"repeatCount": 3,
"simulatorModel": "<string>",
"judgeModel": "<string>",
"scenarioIds": [
"<string>"
]
}
}
'{
"scheduled": true,
"batchRunId": "<string>",
"setId": "<string>",
"jobCount": 123,
"skippedArchived": {
"scenarios": [
"<string>"
],
"targets": [
"<string>"
]
},
"items": [
{
"scenarioRunId": "<string>",
"scenarioId": "<string>",
"target": {
"type": "prompt",
"referenceId": "<string>"
},
"name": "<string>"
}
],
"runPlanId": "<string>",
"planName": "<string>",
"created": true,
"platformUrl": "<string>"
}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.
import requests
url = "https://app.langwatch.ai/api/v1/run-plans/run"
payload = { "config": {
"scope": { "mode": "all" },
"targets": [{ "referenceId": "<string>" }],
"repeatCount": 3,
"simulatorModel": "<string>",
"judgeModel": "<string>",
"scenarioIds": ["<string>"]
} }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {
scope: {mode: 'all'},
targets: [{referenceId: '<string>'}],
repeatCount: 3,
simulatorModel: '<string>',
judgeModel: '<string>',
scenarioIds: ['<string>']
}
})
};
fetch('https://app.langwatch.ai/api/v1/run-plans/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/run-plans/run \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"config": {
"scope": {
"mode": "all"
},
"targets": [
{
"referenceId": "<string>"
}
],
"repeatCount": 3,
"simulatorModel": "<string>",
"judgeModel": "<string>",
"scenarioIds": [
"<string>"
]
}
}
'{
"scheduled": true,
"batchRunId": "<string>",
"setId": "<string>",
"jobCount": 123,
"skippedArchived": {
"scenarios": [
"<string>"
],
"targets": [
"<string>"
]
},
"items": [
{
"scenarioRunId": "<string>",
"scenarioId": "<string>",
"target": {
"type": "prompt",
"referenceId": "<string>"
},
"name": "<string>"
}
],
"runPlanId": "<string>",
"planName": "<string>",
"created": true,
"platformUrl": "<string>"
}Authorizations
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
What this run covers and what it runs against. Written onto the run plan the name resolves.
Show child attributes
Show child attributes
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.
1 - 200Repeat the same key to make a retry join the batch the first call started instead of running everything again. 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.
Show child attributes
Show child attributes
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.
200Response
Success
True once the runs are queued.
The id of this batch. Every run started here carries it.
The result set the batch is filed under in the platform.
How many runs were queued.
What the run left out, and why.
Show child attributes
Show child attributes
Every run this call queued.
Show child attributes
Show child attributes
The run plan this run was filed under.
The name that plan answers to.
True when this run created the plan, false when it joined a plan already there.
Where to watch this run in the LangWatch platform.
Was this page helpful?