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.
Read an experiment's setup
The experiment's datasets, targets and evaluators, with the version to send back when you save. Ask for fields=version to check for changes without transferring the setup.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
The experiment's slug, or its id
Set to `version` to answer with the version and timestamp only
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/experiments/<slug>/workbench-state"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.get( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/v1/experiments/<slug>/workbench-state";const response = await fetch(url, { method: "GET", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request GET \ --url 'https://app.langwatch.ai/api/v1/experiments/<slug>/workbench-state' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project: Read an experiment's setup.Request: GET https://app.langwatch.ai/api/v1/experiments/<slug>/workbench-stateReference: https://langwatch.ai/docs/api-reference/experiments/read-an-experiment-s-setup.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
{ "id": "string", "slug": "string", "name": "string", "state": {}, "version": -9007199254740991, "updatedAt": "string"}The experiment is not an evaluations workbench (experiment_type_mismatch)
Missing or invalid API key, or the key lacks the permission
No such experiment in this project
Path parameters
slugstringrequiredThe experiment's slug, or its id
Query parameters
fieldsstringSet to version to answer with the version and timestamp only
Responses
200Success
application/json
idstringrequiredslugstringrequirednamestring | nullstateobject | nullversionintegerrequiredSend this back as expectedVersion to save safely
updatedAtstringrequiredISO 8601 timestamp of the last save