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 new evaluator
Create a new evaluator: a built-in one, a custom code evaluator (type: "code") or one that wraps a workflow (type: "workflow")
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
For a built-in evaluator: { evaluatorType, settings }. For a code evaluator: { code, inputs: [{ identifier, type }] }; outputs are the fixed passed, score, label and details. For a workflow evaluator: {}.
The kind of evaluator. "evaluator" (the default) is a built-in type named by config.evaluatorType; "code" is a custom Python evaluator whose config carries code and inputs; "workflow" wraps the workflow named by workflowId.
The workflow a "workflow" evaluator wraps. Only for type "workflow".
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/evaluators"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/evaluators";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/evaluators' \ --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/evaluatorsReference: https://langwatch.ai/docs/api-reference/evaluators-config/create-evaluators.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", "projectId": "string", "name": "string", "slug": "string", "type": "string", "config": {}, "workflowId": "string", "copiedFromEvaluatorId": "string", "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-01-01T00:00:00Z", "fields": [ { "identifier": "string", "type": "string", "optional": false } ], "outputFields": [ { "identifier": "string", "type": "string", "optional": false } ], "workflowName": "string", "workflowIcon": "string", "version": 0, "labels": [ { "label": "string", "version": 0 } ], "createdBy": { "id": "string", "name": "string" }, "updatedBy": { "id": "string", "name": "string" }, "platformUrl": "string"}Request body
application/json · Required
namestringrequiredtypestringThe kind of evaluator. "evaluator" (the default) is a built-in type named by config.evaluatorType; "code" is a custom Python evaluator whose config carries code and inputs; "workflow" wraps the workflow named by workflowId.
"evaluator""code""workflow""evaluator"configobjectrequiredFor a built-in evaluator: { evaluatorType, settings }. For a code evaluator: { code, inputs: [{ identifier, type }] }; outputs are the fixed passed, score, label and details. For a workflow evaluator: {}.
workflowIdstringThe workflow a "workflow" evaluator wraps. Only for type "workflow".
Responses
200Success
application/json
idstringrequiredprojectIdstringrequirednamestringrequiredslugstring | nullrequiredtypestringrequiredconfigobject | nullrequiredworkflowIdstring | nullrequiredcopiedFromEvaluatorIdstring | nullrequiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)requiredfieldsobject[]requiredoutputFieldsobject[]requiredworkflowNamestringworkflowIconstringversioninteger | nullrequiredThe version this response shows: the latest, unless a label or a version was asked for.
labelsobject[]requiredThe deploy labels the evaluator carries, such as production, and the version each points at.
createdByobject | nullrequiredThe user who created the evaluator. Null when an API key created it, or it predates creators being recorded.
updatedByobject | nullrequiredThe user who changed the evaluator last. Null when an API key changed it.
platformUrlstring (uri)required