Query traces
GET with body payload — no resources created. Returns the traces matching the query passed as the request payload.
Returns a paginated list of traces (root runs) for a single tracing project. Each item carries the trace’s root run plus optional trace-wide aggregates (total_tokens, total_cost, first_token_time) under trace_aggregates, so clients never have to merge by trace_id.
Traces are scanned within a start_time window: min_start_time defaults to 24 hours before the request, max_start_time defaults to the request time. Set either explicitly to widen or narrow the window.
Supports filters (trace_filter, tree_filter), cursor pagination (cursor), and field projection (selects).
ai_search cannot be combined with sem_filter. With full AI search enabled, ai_search translates natural language into query filters and time bounds and cannot be combined with explicit filter expressions. Otherwise, ai_search retains legacy semantic-only behavior. Use sem_filter for semantic-only matching combined with structured filters. AI search requires organization consent.
When semantic matching is needed, Accept: text/event-stream is required; requests without it return 406. AI search is unavailable on deployments that route queries to the v1 backend and returns 501 there.
Self-hosted deployments require LangSmith v0.16 or later.
Headers
Body
ai_search translates natural language into structured filters, semantic criteria and time bounds.
Cannot be combined with sem_filter. With full AI search enabled, also cannot be combined with explicit filter expressions; otherwise retains legacy semantic-only behavior.
Must contain nonempty text of at most 2000 UTF-8 bytes.
1 - 2000"A run that contains a billing dispute"
max_feedback_modified_at is the exclusive upper bound (RFC3339) on feedback modified_at, applied to the feedback conditions in trace_filter or tree_filter (for example eq(feedback_key, "correctness")).
Requires at least one feedback condition. Root runs must still fall within the start_time window.
"2024-12-31T23:59:59Z"
min_feedback_modified_at is the inclusive lower bound (RFC3339) on feedback modified_at, applied to the feedback conditions in trace_filter or tree_filter (for example eq(feedback_key, "correctness")).
Requires at least one feedback condition. Root runs must still fall within the start_time window.
"2024-01-01T00:00:00Z"
selects lists which properties to include on each returned trace. Properties listed here are routed to the appropriate sub-object on each item: total_tokens, total_cost, and first_token_time appear under trace_aggregates; everything else appears under root_run. If omitted, only id is returned on root_run.
ID, NAME, RUN_TYPE, STATUS, START_TIME, END_TIME, LATENCY_SECONDS, FIRST_TOKEN_TIME, ERROR, ERROR_PREVIEW, EXTRA, METADATA, EVENTS, INPUTS, INPUTS_PREVIEW, OUTPUTS, OUTPUTS_PREVIEW, MANIFEST, PARENT_RUN_IDS, PROJECT_ID, TRACE_ID, THREAD_ID, DOTTED_ORDER, IS_ROOT, REFERENCE_EXAMPLE_ID, REFERENCE_DATASET_ID, TOTAL_TOKENS, PROMPT_TOKENS, COMPLETION_TOKENS, TOTAL_COST, PROMPT_COST, COMPLETION_COST, PROMPT_TOKEN_DETAILS, COMPLETION_TOKEN_DETAILS, PROMPT_COST_DETAILS, COMPLETION_COST_DETAILS, PRICE_MODEL_ID, TAGS, APP_PATH, ATTACHMENTS, THREAD_EVALUATION_TIME, IS_IN_DATASET, LAST_QUEUED_AT, SHARE_URL, FEEDBACK_STATS, LS_USER_ID trace_filter narrows results to traces whose root run matches this LangSmith filter expression. This filter targets root runs only — is_root = true is implied.
See https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language for syntax.
"eq(status, \"error\")"

