provider AI observabilityllm_analytics POST
/api/environments/{environment_id}/llm_analytics/summarization/ @utdk/posthog
/api/environments/{environment_id}/llm_analytics/summarization/ environments_llm_analytics_summarization_create
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:**
1. **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.
2. **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.
- environment_id path required
- Deprecated. Use /api/projects/{project_id}/ instead.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.environmentsLlmAnalyticsSummarizationCreate({
"mode": "minimal",
"force_refresh": false
})