Get spans summary

Get aggregated statistics for spans matching the given filters. Uses the same filters and query parameters as List spans.

Headers

AuthorizationstringRequired

Bearer token. Use Bearer YOUR_API_KEY.

Query parameters

start_timedatetimeOptional

Start of time range (ISO 8601).

end_timedatetimeOptional

End of time range (ISO 8601).

environmentstringOptional
Filter by environment.

Request

This endpoint expects an object.
filtersobjectOptional

Filter criteria. See Filters API Reference for operator syntax.

Response

Summary statistics for matching spans.
total_costdouble
Total cost in USD for all matching spans.
total_tokensinteger
Total tokens across all matching spans.
total_prompt_tokensinteger

Total prompt/input tokens.

total_completion_tokensinteger

Total completion/output tokens.

average_latencydouble
Average latency in seconds.
average_costdouble
Average cost per span in USD.
total_requestsinteger
Total number of matching spans.
error_countinteger
Number of spans with errors.

Errors

400
Bad Request Error
401
Unauthorized Error
429
Too Many Requests Error
500
Internal Server Error