Skip to main content
POST
/
api
/
v1
/
runs
/
stats
Error
A valid request URL is required to generate request examples
{
  "run_count": 123,
  "latency_p50": 123,
  "latency_p99": 123,
  "first_token_p50": 123,
  "first_token_p99": 123,
  "total_tokens": 123,
  "prompt_tokens": 123,
  "completion_tokens": 123,
  "median_tokens": 123,
  "completion_tokens_p50": 123,
  "prompt_tokens_p50": 123,
  "tokens_p99": 123,
  "completion_tokens_p99": 123,
  "prompt_tokens_p99": 123,
  "last_run_start_time": "2023-11-07T05:31:56Z",
  "feedback_stats": {},
  "run_facets": [
    {}
  ],
  "error_rate": 123,
  "streaming_rate": 123,
  "total_cost": 123,
  "prompt_cost": 123,
  "completion_cost": 123,
  "cost_p50": 123,
  "cost_p99": 123,
  "prompt_token_details": {},
  "completion_token_details": {},
  "prompt_cost_details": {},
  "completion_cost_details": {}
}

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

Body

application/json

Query params for run stats.

id
string<uuid>[] | null
trace
string<uuid> | null
parent_run
string<uuid> | null
run_type
enum<string> | null

Enum for run types.

Available options:
tool,
chain,
llm,
retriever,
embedding,
prompt,
parser
session
string<uuid>[] | null
reference_example
string<uuid>[] | null
execution_order
integer | null
Required range: 1 <= x <= 1
start_time
string<date-time> | null
end_time
string<date-time> | null
error
boolean | null
query
string | null
filter
string | null
trace_filter
string | null
tree_filter
string | null
is_root
boolean | null
data_source_type
enum<string> | null

Enum for run data source types.

Available options:
current,
historical,
lite,
root_lite,
runs_feedbacks_rmt_wide
skip_pagination
boolean | null
search_filter
string | null
group_by
RunStatsGroupBy · object

Group by param for run stats.

groups
(string | null)[] | null
select
enum<string>[] | null

Metrics you can select from run stats endpoint.

Available options:
run_count,
latency_p50,
latency_p99,
latency_avg,
first_token_p50,
first_token_p99,
total_tokens,
prompt_tokens,
completion_tokens,
median_tokens,
completion_tokens_p50,
prompt_tokens_p50,
tokens_p99,
completion_tokens_p99,
prompt_tokens_p99,
last_run_start_time,
feedback_stats,
thread_feedback_stats,
run_facets,
error_rate,
streaming_rate,
total_cost,
prompt_cost,
completion_cost,
cost_p50,
cost_p99,
session_feedback_stats,
all_run_stats,
all_token_stats,
prompt_token_details,
completion_token_details,
prompt_cost_details,
completion_cost_details

Response

Successful Response

run_count
integer | null
latency_p50
number | null
latency_p99
number | null
first_token_p50
number | null
first_token_p99
number | null
total_tokens
integer | null
prompt_tokens
integer | null
completion_tokens
integer | null
median_tokens
integer | null
completion_tokens_p50
integer | null
prompt_tokens_p50
integer | null
tokens_p99
integer | null
completion_tokens_p99
integer | null
prompt_tokens_p99
integer | null
last_run_start_time
string<date-time> | null
feedback_stats
Feedback Stats · object
run_facets
Run Facets · object[] | null
error_rate
number | null
streaming_rate
number | null
total_cost
number | null
prompt_cost
number | null
completion_cost
number | null
cost_p50
number | null
cost_p99
number | null
prompt_token_details
Prompt Token Details · object
completion_token_details
Completion Token Details · object
prompt_cost_details
Prompt Cost Details · object
completion_cost_details
Completion Cost Details · object