Analytics

Return an AI-generated summary of API traffic for the given window.

The response always includes enabled and unavailable_reason so the client can render a meaningful onboarding state even when no AI provider is configured or the project has not opted in. The summary field is non-null only when all of the following are true:

  • projects.ai_api_traffic_summary_enabled = true
  • An AI provider is configured and available
  • The AI call returns parseable JSON within the bounded summary deadline

This endpoint never returns a 5xx from an AI failure — it always returns 200 with summary: null and a human-readable unavailable_reason.

get/projects/{project_id}/api-analytics/summary

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/projects/{project_id}/api-analytics/summary
  • Auth: HTTP bearer

Path parameters

project_idinteger required

Project ID

Query parameters

environment_idinteger

Environment ID (optional)

start_datestring required

Window start (ISO 8601)

end_datestring required

Window end (ISO 8601)

refreshboolean

Bypass and replace the backend AI summary cache

Response

AI traffic summary (summary field may be null when AI is unavailable)

cachedboolean required

Whether this response was served from the backend AI-result cache.

enabledboolean required

Whether the project has ai_api_traffic_summary_enabled = true.

unavailable_reasonstring nullable

Why the summary is null when summary is None and enabled is true: either AI is not configured or the call failed/timed out.

Changes

No recorded changes to this operation across all 53 revisions of this API.