Skip to main content
GET
/
v2
/
threads
/
{thread_id}
/
traces
Error
A valid request URL is required to generate request examples
{
  "items": [
    {
      "completion_cost": 123,
      "completion_cost_details": {
        "raw": {}
      },
      "completion_token_details": {
        "raw": {}
      },
      "completion_tokens": 123,
      "end_time": "2025-01-15T12:00:01.500Z",
      "error_preview": "<string>",
      "first_token_time": "2024-01-15T10:30:00.312Z",
      "inputs_preview": "<string>",
      "latency": 123,
      "name": "<string>",
      "op": 123,
      "outputs_preview": "<string>",
      "prompt_cost": 123,
      "prompt_cost_details": {
        "raw": {}
      },
      "prompt_token_details": {
        "raw": {}
      },
      "prompt_tokens": 123,
      "start_time": "2025-01-15T12:00:00.000Z",
      "thread_id": "d4e5f6a7-b8c9-4d5e-1f2a-3b4c5d6e7f8a",
      "total_cost": 123,
      "total_tokens": 123,
      "trace_id": "018e4c7e-a9fb-7ef0-a5b6-6ea3a82e9327"
    }
  ],
  "next_cursor": "eyJydW5zX2N1cnNvciI6Imx0KGN1cnNvciwiLi4uIikifQ=="
}

Documentation Index

Fetch the complete documentation index at: https://docs.langchain.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required
X-Tenant-Id
string
header
required

Path Parameters

thread_id
string
required

Thread ID

Query Parameters

cursor
string

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.

filter
string

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_size
integer
default:20

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.

Required range: 1 <= x <= 100
project_id
string<uuid>
required

project_id is the tracing project UUID (required).

selects
enum<string>[]

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.

Available options:
THREAD_ID,
TRACE_ID,
OP,
PROMPT_TOKENS,
COMPLETION_TOKENS,
TOTAL_TOKENS,
START_TIME,
END_TIME,
LATENCY,
FIRST_TOKEN_TIME,
INPUTS_PREVIEW,
OUTPUTS_PREVIEW,
PROMPT_COST,
COMPLETION_COST,
TOTAL_COST,
PROMPT_TOKEN_DETAILS,
COMPLETION_TOKEN_DETAILS,
PROMPT_COST_DETAILS,
COMPLETION_COST_DETAILS,
NAME,
ERROR_PREVIEW

Response

items and pagination

items
object[]

items is the page of root traces in this thread. Which properties are populated on each trace depends on the selects query parameter.

next_cursor
string

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

Example:

"eyJydW5zX2N1cnNvciI6Imx0KGN1cnNvciwiLi4uIikifQ=="