---
title: "Fetch analytics summary"
method: POST
path: "/analytics/summary"
tags: ["Analytics"]
---

# Fetch analytics summary

`POST /analytics/summary`

## Request

- Base URL: `https://api.us-east-1.langdb.ai`
- URL: `https://api.us-east-1.langdb.ai/analytics/summary`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/langdb/apis/ai-gateway-api/docs/analytics/summary/post.ts> (a function with typed inputs; its response is checked against the schema)

## Headers

- `X-Project-Id` string, required

## Request body

- object
  - `start_time_us` integer
  - `end_time_us` integer
  - `groupBy` string[], required

## Response `200`

Successful response

- AnalyticsSummaryResponse
  - `summary` AnalyticsSummaryItem[], required: An array of aggregated analytics summary records.
    - `tag_tuple` string[], required: The grouping key(s) used for this summary. In this example the key is returned as tag_tuple. (Depending on the groupBy parameter, this field might contain provider names or model names.)
    - `total_cost` number, double, required: Aggregated total cost in USD for the group.
    - `total_requests` integer, required: Aggregated total number of requests for the group.
    - `total_duration` number, double, required: Aggregated total duration (in milliseconds) for the group.
    - `avg_duration` number, double, required: Average duration (in milliseconds) of requests for the group.
    - `duration` number, double, required: Representative duration (in milliseconds) for the group.
    - `duration_p99` number, double, required: 99th percentile of request durations.
    - `duration_p95` number, double, required: 95th percentile of request durations.
    - `duration_p90` number, double, required: 90th percentile of request durations.
    - `duration_p50` number, double, required: 50th percentile of request durations.
    - `total_input_tokens` integer, required: Aggregated total input tokens used in the group.
    - `total_output_tokens` integer, required: Aggregated total output tokens generated in the group.
    - `avg_ttft` number, double, required: Average time-to-first-byte (TTFT) in milliseconds for the group.
    - `ttft` number, double, required: Representative TTFT value in milliseconds for the group.
    - `ttft_p99` number, double, required: 99th percentile of TTFT.
    - `ttft_p95` number, double, required: 95th percentile of TTFT.
    - `ttft_p90` number, double, required: 90th percentile of TTFT.
    - `ttft_p50` number, double, required: 50th percentile of TTFT.
    - `tps` number, double, required: Aggregated transactions per second (TPS) for the group.
    - `tps_p99` number, double, required: 99th percentile of TPS.
    - `tps_p95` number, double, required: 95th percentile of TPS.
    - `tps_p90` number, double, required: 90th percentile of TPS.
    - `tps_p50` number, double, required: 50th percentile of TPS.
    - `tpot` number, double, required: Aggregated average transactions per output token (TPOT) for the group.
    - `tpot_p99` number, double, required: 99th percentile of TPOT.
    - `tpot_p95` number, double, required: 95th percentile of TPOT.
    - `tpot_p90` number, double, required: 90th percentile of TPOT.
    - `tpot_p50` number, double, required: 50th percentile of TPOT.
    - `error_rate` number, double, required: Error rate (as a percentage) for the group.
    - `error_request_count` integer, required: Total number of error requests in the group.
  - `start_time_us` integer, required: Start time in microseconds since epoch.
  - `end_time_us` integer, required: End time in microseconds since epoch.

---

[API](https://skmtc.dev/langdb/apis/ai-gateway-api.md) - [All operations](https://skmtc.dev/langdb/apis/ai-gateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/langdb/apis/ai-gateway-api/revisions/56b3696d655b?raw)
