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.
List an experiment's versions
Every saved version of the experiment's setup, newest first. A commit, an agent write and a restore each add a numbered version. Ordinary typing rewrites one autosave row, which is the entry with autoSaved true. Page through them with limit and cursor.
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
Versions per page, capped at 100
The `nextCursor` of the previous page
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/experiments/<slug>/versions"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>/versions";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>/versions' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project: List an experiment's versions.Request: GET https://app.langwatch.ai/api/v1/experiments/<slug>/versionsReference: https://langwatch.ai/docs/api-reference/experiments/list-an-experiment-s-versions.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
{ "versions": [ { "version": -9007199254740991, "counterVersion": -9007199254740991, "autoSaved": false, "commitMessage": "string", "authorLabel": "user", "authorId": "string", "createdAt": "string", "updatedAt": "string" } ], "nextCursor": -9007199254740991}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
limitintegerVersions per page, capped at 100
cursorintegerThe nextCursor of the previous page
Responses
200Success
application/json
versionsobject[]requiredNewest first, by counterVersion
nextCursorinteger | nullrequiredPass as cursor to read the next page, null on the last one