AI observability
llm_analytics
Generate an AI-powered summary of an LLM trace or event.
This endpoint analyzes the provided trace/event, generates a line-numbered text representation, and uses an LLM to create a concise summary with line references.
Two ways to use this endpoint:
- By ID (recommended): Pass trace_id or generation_id with an optional date_from/date_to. The backend fetches the data automatically. summarize_type is inferred.
- By data: Pass the full trace/event data blob in data with summarize_type. This is how the frontend uses it.
Summary Format:
- Title (concise, max 10 words)
- Mermaid flow diagram showing the main flow
- 3-10 summary bullets with line references
- "Interesting Notes" section for failures, successes, or unusual patterns
- Line references in [L45] or [L45-52] format pointing to relevant sections
The response includes the structured summary, the text representation, and metadata.
post/api/projects/{project_id}/llm_analytics/summarization/
Request
- Base URL: https://us.posthog.com
- URL: https://us.posthog.com/api/projects/{project_id}/llm_analytics/summarization/
- Auth: HTTP bearer
Path parameters
project_idstring required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Request body
Response
Changes
No recorded changes to this operation across all 1 revision of this API.