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.
Discover what the trace filter fields hold
Discover what the trace filter fields hold in this project. Without field, every facet with its top values. With field, that field's values, paged.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
In UTC. Epoch milliseconds, or an ISO 8601 date string.
In UTC. Epoch milliseconds, or an ISO 8601 date string.
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/traces/facets"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/traces/facets";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/traces/facets' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project: Discover what the trace filter fields hold.Request: GET https://app.langwatch.ai/api/v1/traces/facetsReference: https://langwatch.ai/docs/api-reference/traces/discover-what-the-trace-filter-fields-hold.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.Without field, every facet the project has with its top values and whether the payload is still being computed. With field, that field's values and counts plus the distinct total and whether more remain.
application/json · Generated from schema
{ "facets": [ { "key": "string", "kind": "categorical", "label": "string", "group": "trace", "topValues": [ null ], "totalDistinct": 0 } ], "pending": false}Bad Request
application/json · Generated from schema
{ "error": "string", "message": "string"}Unauthorized
application/json · Generated from schema
{ "error": "string", "message": "string"}Forbidden
application/json · Generated from schema
{ "error": "string", "message": "string"}Unprocessable Entity
application/json · Generated from schema
{ "error": "string", "message": "string"}Internal Server Error
application/json · Generated from schema
{ "error": "string", "message": "string"}Query parameters
fieldstringprefixstringlimitintegeroffsetintegerstartDatestringEpoch milliseconds, or an ISO 8601 date string.
endDatestringEpoch milliseconds, or an ISO 8601 date string.
Responses
200Without field, every facet the project has with its top values and whether the payload is still being computed. With field, that field's values and counts plus the distinct total and whether more remain.
field, every facet the project has with its top values and whether the payload is still being computed. With field, that field's values and counts plus the distinct total and whether more remain.application/json
400Bad Request
application/json
errorstringrequiredmessagestring401Unauthorized
application/json
errorstringrequiredmessagestring403Forbidden
application/json
errorstringrequiredmessagestring422Unprocessable Entity
application/json
errorstringrequiredmessagestring500Internal Server Error
application/json
errorstringrequiredmessagestring