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.
Create a test suite
Create a test suite. It starts empty: scenarios join it by being filed into it, and the targets a run goes against are sent with the run. It may declare fields and attach evaluators from the start.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The test suite name, as it reads in the platform.
The fields the test suite declares, in the order the platform shows them. Up to 30. An identifier is lowercase letters, digits and underscores, starting with a letter; the type is text, number or boolean.
The evaluators that run after every scenario run. Up to 20. A required evaluator that fails fails the scenario; a score-only evaluator reports and never gates.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/test-suites"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = {}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/test-suites";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({}),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/test-suites' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{}'Call the LangWatch API from this project.Request: POST https://app.langwatch.ai/api/v1/test-suitesReference: https://langwatch.ai/docs/api-reference/test-suites/create-test-suites.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{}```Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "id": "string", "name": "string", "slug": "string", "scenarioIds": [ "string" ], "scenarioCount": 0, "fields": [ { "identifier": "string", "type": "text" } ], "evaluators": [ { "id": "string", "evaluatorId": "string", "required": false, "mappings": {} } ], "archivedAt": "string", "createdAt": "string", "updatedAt": "string", "platformUrl": "string"}Request body
application/json · Required
namestringrequiredThe test suite name, as it reads in the platform.
fieldsobject[]The fields the test suite declares, in the order the platform shows them. Up to 30. An identifier is lowercase letters, digits and underscores, starting with a letter; the type is text, number or boolean.
evaluatorsobject[]The evaluators that run after every scenario run. Up to 20. A required evaluator that fails fails the scenario; a score-only evaluator reports and never gates.
Responses
201Success
application/json
idstringrequiredThe test suite id.
namestringrequiredThe test suite name.
slugstringrequiredThe suite's address in the platform. It is kept when the suite is renamed.
scenarioIdsstring[]requiredThe scenarios filed in this suite, in the order it shows them.
scenarioCountnumberrequiredHow many scenarios are filed in it.
fieldsobject[]The fields the test suite declares. Absent on servers that predate fields on this family.
evaluatorsobject[]The evaluators attached to the test suite. Absent on servers that predate evaluators on this family.
archivedAtstring | nullrequiredWhen the suite was archived, or null while it is active.
createdAtstringrequiredWhen the suite was created.
updatedAtstringrequiredWhen the suite was last written.
platformUrlstring (uri)requiredWhere to open this test suite in the LangWatch platform.