4e064cf81dae

latestOpenAPI 3.1.02026-08-131831,331960.0 KB
spans

Get spans summary

Get aggregated statistics for spans/log rows in a time range. start_time, end_time, and environment are URL query parameters. Additional filters must be sent in the JSON body under filters; fields such as log_type are not read as summary query parameters. When filters is omitted or empty, the backend may use the pre-aggregated summary path; when filters is non-empty, it queries raw logs using the same filter object shape as List spans.

post/api/request-logs/summary/

Query parameters

start_timestring date-time

Start of time range (ISO 8601).

end_timestring date-time

End of time range (ISO 8601).

environment'prod' | 'test'

Filter by environment (prod or test).

Headers

Authorizationstring required

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Request body

Response

Summary statistics for matching spans.

number_of_requestsinteger required

Total number of matching spans/log rows.

total_costnumber double required

Total cost in USD for all matching spans/log rows.

total_tokensinteger required

Total tokens across all matching spans/log rows.

total_prompt_tokensinteger required

Total prompt/input tokens.

total_completion_tokensinteger required

Total completion/output tokens.

avg_latencynumber double required

Average latency in seconds.

avg_tpsnumber double required

Average tokens per second.

avg_ttftnumber double required

Average time to first token in seconds.

scoresobject required

Aggregated score summaries grouped by evaluator ID.