LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmith_openapi_clientresourcesThreadTrace
Interface●Since v0.10

ThreadTrace

Copy
interface ThreadTrace

Properties

View source on GitHub
property
completion_cost: number
property
completion_cost_details: CompletionCostDetails
property
completion_token_details: CompletionTokenDetails
property
completion_tokens: number
property
end_time: string
property
error: string
property
error_preview: string
property
first_token_time: string
property
inputs: unknown
property
inputs_preview: string
property
latency: number
property
name: string
property
op: number
property
outputs: unknown
property
outputs_preview: string
property
prompt_cost: number
property
prompt_cost_details: PromptCostDetails
property
prompt_token_details: PromptTokenDetails
property
prompt_tokens: number
property
start_time: string
property
thread_id: string
property
total_cost: number
property
total_tokens: number
property
trace_id: string

completion_cost is the estimated USD cost for the completion. Omitted unless included in selects.

completion_cost_details is the USD cost breakdown for completion-side categories; per-category values are under raw. Omitted unless included in selects.

completion_token_details is the completion-side token breakdown by category; per-category counts are under raw. Omitted unless included in selects.

completion_tokens is the completion-side token count. Omitted unless included in selects.

end_time is when the root run ended (RFC3339 date-time). JSON null if the run is still in progress. Omitted unless included in selects.

error is the full root run error message when the run failed. Omitted unless included in selects.

error_preview is a short error summary when the run failed. Omitted unless included in selects.

first_token_time is when the first output token was produced (RFC3339 date-time), for streamed runs when that metadata exists. Omitted unless included in selects.

inputs is the full root run input payload. Omitted unless included in selects.

inputs_preview is a truncated text preview of inputs. Omitted unless included in selects.

latency is wall-clock duration from start to end in seconds. Omitted unless included in selects.

name is a human-readable label for the root run (for example the model name, function name, or step name chosen when the run was traced). Omitted unless included in selects.

op is a numeric code identifying the root run's run_type (for example LLM vs. tool vs. chain). Encoded as a number for compatibility with legacy clients; prefer the string run_type on RunResponse when available. Omitted unless included in selects.

outputs is the full root run output payload. Omitted unless included in selects.

outputs_preview is a truncated text preview of outputs. Omitted unless included in selects.

prompt_cost is the estimated USD cost for the prompt. Omitted unless included in selects.

prompt_cost_details is the USD cost breakdown for prompt-side categories; per-category values are under raw. Omitted unless included in selects.

prompt_token_details is the prompt-side token breakdown by category; per-category counts are under nested raw. Omitted unless included in selects.

prompt_tokens is the prompt-side token count. Omitted unless included in selects.

start_time is when the trace started (RFC3339 date-time). Omitted unless included in selects.

thread_id is the conversation thread UUID that contains this trace. Matches the thread_id path parameter of the request. Omitted unless included in selects.

total_cost is the estimated total USD cost for the root run. Omitted unless included in selects.

total_tokens is the total token count (prompt plus completion). Omitted unless included in selects.

trace_id is the UUID of this trace (the root run). Returned when TRACE_ID is in selects, or when selects is omitted entirely (sole fallback field).