Skip to content

Endpoint Stats

GET https://api.bve.me/admin/endpoint-stats
Authorization: Bearer admin_bve_YOUR_ADMIN_KEY

Returns request counts, error breakdowns, and latency aggregates grouped by the API endpoint path (e.g. /v1/chat/completions, /v1/embeddings). Data is sourced from the 1%-sampled request_logs_sampled table. Default sort order is request_count descending; use sort_by and sort_dir to change it.

Admin Bearer token required. See Admin API Overview for authentication details.

ParameterTypeRequiredDefaultDescription
key_idstringNoRestrict stats to a single API key UUID
modelstringNoRestrict stats to a single model ID. Only rows where request_logs_sampled.model = ? are counted. Endpoints with no rows for that model are excluded. Combines with key_id.
sincestringNoInclude only log entries at or after this ISO 8601 timestamp
untilstringNoInclude only log entries at or before this ISO 8601 timestamp
limitintegerNo20Maximum number of endpoint rows to return (1–500)
sort_bystringNorequest_countColumn to sort by. One of: request_count, error_count, avg_latency_ms, max_latency_ms, p95_latency_ms
sort_dirstringNodescSort direction: asc or desc

All parameters are optional and combinable.

{
"endpoints": [
{
"endpoint": "/v1/chat/completions",
"request_count": 312,
"error_count": 8,
"client_error_count": 6,
"server_error_count": 2,
"avg_latency_ms": 1540,
"max_latency_ms": 9200,
"p50_latency_ms": 1100,
"p95_latency_ms": 5800,
"error_rate": 2.56
},
{
"endpoint": "/v1/embeddings",
"request_count": 87,
"error_count": 0,
"client_error_count": 0,
"server_error_count": 0,
"avg_latency_ms": 130,
"max_latency_ms": 580,
"p50_latency_ms": 120,
"p95_latency_ms": 310,
"error_rate": 0
}
]
}
FieldTypeDescription
endpointstringAPI endpoint path as recorded in the request log (e.g. /v1/chat/completions)
request_countintegerNumber of sampled log entries for this endpoint (~1% of actual requests)
error_countintegerNumber of sampled requests that returned HTTP 400 or above
client_error_countintegerNumber of sampled requests that returned HTTP 4xx
server_error_countintegerNumber of sampled requests that returned HTTP 5xx
avg_latency_msnumber | nullAverage end-to-end latency in milliseconds. null if no latency data was recorded.
max_latency_msnumber | nullMaximum end-to-end latency in milliseconds across all sampled requests for this endpoint. null if no latency data was recorded.
p50_latency_msnumber | nullMedian (50th percentile) latency in milliseconds
p95_latency_msnumber | null95th percentile latency in milliseconds — useful for tail-latency SLO alerting
error_ratenumberError rate as a percentage: (error_count / request_count) × 100, rounded to 2 decimal places. 0 when request_count is 0.
Terminal window
curl "https://api.bve.me/admin/endpoint-stats" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?since=2026-05-19T00:00:00Z&limit=5" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?key_id=550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
# Which endpoints is gpt-4o being called through?
curl "https://api.bve.me/admin/endpoint-stats?model=gpt-4o" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"

Combined filter — model usage for a specific key

Section titled “Combined filter — model usage for a specific key”
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?key_id=550e8400-e29b-41d4-a716-446655440000&model=gpt-4o" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"

Sort by p95 latency (slowest endpoints first)

Section titled “Sort by p95 latency (slowest endpoints first)”
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?sort_by=p95_latency_ms" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?sort_by=error_count&limit=10" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"

Sort by avg latency ascending (fastest first)

Section titled “Sort by avg latency ascending (fastest first)”
Terminal window
curl "https://api.bve.me/admin/endpoint-stats?sort_by=avg_latency_ms&sort_dir=asc" \
-H "Authorization: Bearer admin_bve_YOUR_ADMIN_KEY"
Terminal window
curl -s "https://api.bve.me/admin/endpoint-stats" \
-H "Authorization: Bearer $ADMIN_KEY" \
| jq '.endpoints[] | {endpoint, request_count, error_rate}'
const res = await fetch("https://api.bve.me/admin/endpoint-stats?limit=10", {
headers: { Authorization: `Bearer ${adminKey}` },
});
const { endpoints } = await res.json();
for (const ep of endpoints) {
console.log(`${ep.endpoint}: ${ep.request_count} sampled requests, p95=${ep.p95_latency_ms}ms`);
}
StatusCodeCause
400validation_errorsince or until is not a parseable ISO 8601 timestamp
400validation_errorsort_by is not one of the accepted column names
400validation_errorsort_dir is not asc or desc
401missing_api_keyNo Authorization header
401invalid_api_keyAdmin key does not match the configured ADMIN_API_KEY secret

Find the slowest endpoint by p95 latency:

Terminal window
curl -s "https://api.bve.me/admin/endpoint-stats?sort_by=p95_latency_ms&limit=1" \
-H "Authorization: Bearer $ADMIN_KEY"

Find endpoints with the most errors:

Terminal window
curl -s "https://api.bve.me/admin/endpoint-stats?sort_by=error_count" \
-H "Authorization: Bearer $ADMIN_KEY" \
| jq '.endpoints[] | select(.error_rate > 5)'

Find which endpoints a specific model is called through:

Terminal window
curl -s "https://api.bve.me/admin/endpoint-stats?model=gpt-4o" \
-H "Authorization: Bearer $ADMIN_KEY" | jq '.endpoints[] | {endpoint, request_count}'

Compare endpoint usage for a specific key:

Terminal window
curl -s "https://api.bve.me/admin/endpoint-stats?key_id=<uuid>" \
-H "Authorization: Bearer $ADMIN_KEY" | jq '.'