LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmith_openapi_clientresourcestracesTracesResource
Class●Since v0.10

TracesResource

Copy
TracesResource(
    self,
    client: Langsmith,
)

Bases

SyncAPIResource

Methods

View source on GitHub
method
with_raw_response
method
with_streaming_response
method
list_runs
method
query

This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content.

An alternative to .with_raw_response that doesn't eagerly read the response body.

Alpha: The request and response contract may change; Returns runs for a trace ID within min/max start time. Optional filter; repeatable selects to select fields to return.

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).