v48

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-275867561.6 MB
threads

Query Thread Traces

Alpha: The request and response contract may change; Retrieve all traces belonging to a specific thread within a project.

get/v2/threads/{thread_id}/traces

Path parameters

thread_idstring required

Thread ID

Query parameters

cursorstring

cursor is the opaque string from a previous response's next_cursor. Omit on the first request; pass the returned cursor to fetch the next page.

filterstring

filter narrows which traces are returned for this thread, using a LangSmith filter expression evaluated against each root trace run. For example: eq(status, "success") or has(tags, "production"). See https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language for syntax.

page_sizeinteger

page_size is the maximum number of traces to return in this response. Defaults to 20 when omitted; must be between 1 and 100 inclusive when set.

project_idstring uuid required

project_id is the tracing project UUID (required).

selectsstring[]

selects lists which properties to include on each returned trace (repeatable query parameter). Accepts any value of the ThreadTraceSelectField enum. Properties not listed are omitted from each trace object; trace_id is always returned.

Response

items and pagination

next_cursorstring

next_cursor is the opaque cursor to pass as cursor on the next request. Omitted on the final page.

Example response

{
  "items": [
    {
      "end_time": "2025-01-15T12:00:01.500Z",
      "first_token_time": "2024-01-15T10:30:00.312Z",
      "start_time": "2025-01-15T12:00:00.000Z",
      "thread_id": "d4e5f6a7-b8c9-4d5e-1f2a-3b4c5d6e7f8a",
      "trace_id": "018e4c7e-a9fb-7ef0-a5b6-6ea3a82e9327"
    }
  ],
  "next_cursor": "eyJydW5zX2N1cnNvciI6Imx0KGN1cnNvciwiLi4uIikifQ=="
}