Get Hosted API Analytics

Beta
Requests the API served over time: volume split by status, success rate, and p50/p95/p99 latency per time bucket, plus one `top_paths` row per route, busiest first, naming the route by `route_id`. Every request its host answered counts, including refusals such as a missing key (401) or an exhausted rate limit (429); `top_paths` counts only the requests that matched a route, including a route an MCP client called by tool name. The window defaults to the last 7 days and is capped at 30. History starts at `history_starts_at`, the first request in the last 30 days attributed to this API: requests before it cannot be attributed, so a bucket before it is missing data, not a quiet period. When `history_starts_at` is absent, no request to this API has been attributed in the last 30 days, and no bucket is known to be complete. Dark launch: requires the `hosted_apis_access` entitlement (402 `hosted_apis_not_in_plan` otherwise).

Authentication

AuthorizationBearer

Enter your API key with the Bearer prefix, e.g. ‘Bearer sk_…’.

Path parameters

api_idstringRequired

Hosted API id (prefixed external id, api_...).

Headers

Speechify-VersionstringOptional

Query parameters

startdatetimeOptional

Inclusive start of the window (RFC-3339). Defaults to 7 days ago; the window is capped at 30 days.

enddatetimeOptional

Exclusive end of the window (RFC-3339). Defaults to now.

granularityenumOptionalDefaults to 1h

Time-bucket size for the analytics series.

Response headers

Speechify-Request-IdstringOptional
Unique identifier for this request, present on every response (2xx and non-2xx alike). If the caller sends a `Speechify-Request-Id` request header the server echoes it back (sanitized and length-capped) so one logical request can be traced end-to-end; otherwise the server generates a fresh value. Log it on every response and quote it in support requests - it is the stable handle that ties your observation to Speechify's server-side logs, and it matches the `request_id` field in the error envelope. The legacy alias `X-Request-ID` carries the same value and is still accepted on requests, until 2027-07-24. Prefer the un-prefixed name (RFC 6648).

Response

OK
granularitystring

The time-bucket size of the series.

startdatetime
Inclusive start of the resolved window.
enddatetime
Exclusive end of the resolved window.
totalsobject

Window-wide rollups.

serieslist of objects

Per-bucket time series, oldest first.

top_pathslist of objects

The most-called route patterns in the window, busiest first.

project_filter_truncatedbooleanOptional

True when a project_id filter’s pinned key set exceeded the cap this endpoint applies: the result reflects only the project’s newest keys within the cap, not its full traffic. Omitted (false) when no project filter was requested or its key set fit under the cap.

history_starts_atdatetimeOptional

Hosted API analytics only: the first request in the last 30 days the request log attributes to this API. Requests before it cannot be attributed, so a bucket before it is missing data rather than zero traffic. Absent when no such request exists, in which case no bucket is known to be complete.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error