---
title: "get session analytics"
method: GET
path: "/v1/sessions/{id}/analytics"
tags: ["Sessions"]
---

# get session analytics

`GET /v1/sessions/{id}/analytics`

Returns per-turn latency analytics for a session — where time was spent in the transcription → LLM → TTS → first-audio path for each conversational turn, plus session-level summary metrics. Analytics become available once the session has ended and the engine has delivered its session report; until then this endpoint returns 404. Analytics exist only for sessions where Anam runs the conversational pipeline (turnkey, custom LLM and ElevenLabs agent sessions) — LiveKit and audio-passthrough sessions never produce them. Message text is omitted unless `includeMessages=true` is passed and transcripts were enabled for the session. Anam-internal admin API keys may fetch analytics for sessions of any organization.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `includeMessages` boolean

## Response `200`

Successfully retrieved session analytics

- object
  - `sessionId` string, uuid
  - `startTime` string, date-time
  - `endTime` string, date-time, nullable
  - `durationSeconds` number, nullable
  - `sessionType` 'turnkey' | 'custom_llm_server' | 'custom_llm_client' | 'livekit' | 'elevenlabs_agent' | 'null', nullable
  - `exitStatus` string, nullable
  - `clientLabel` string, nullable
  - `clientMetadata` object, nullable
  - `personaId` string, uuid, nullable
  - `apiKeyId` string, uuid, nullable
  - `config` object — Snapshot of the configuration the session ran with.
    - `llmProvider` string, nullable
    - `llmModel` string, nullable
    - `ttsProvider` string, nullable
    - `ttsVoice` string, nullable
    - `avatarKey` string, nullable
    - `personaName` string, nullable
    - `languageCode` string, nullable
    - `transcriptsEnabled` boolean
  - `summary` object
    - `totalTurns` integer — Number of entries in `turns`.
    - `completedTurns` integer — Turns whose assistant response completed.
    - `interruptedTurns` integer — Turns whose assistant response was interrupted.
    - `interruptionRate` number, nullable — interruptedTurns / turns with an assistant response.
    - `totalUserSpeechDurationSeconds` number, nullable
    - `totalUserWords` integer, nullable
    - `totalAssistantWords` integer, nullable
    - `totalWarnings` integer
    - `totalErrors` integer
    - `toolCalls` object
      - `total` integer
      - `succeeded` integer
      - `failed` integer
      - `byName` object
    - `averageLatencies` object — Engine-computed per-session averages.
      - `transcriptionLatencySeconds` number, nullable
      - `llmTimeToFirstOutputSeconds` number, nullable
      - `ttsGenerationDurationSeconds` number, nullable
      - `firstAudioLatencySeconds` number, nullable
  - `turns` SessionAnalyticsTurn[]
    - `turnIndex` integer
    - `correlationId` string, nullable — The user action correlation ID shared by SDK events for this turn.
    - `userSpeechStartTime` string, date-time, nullable
    - `userSpeechEndTime` string, date-time, nullable
    - `userSpeechDurationSeconds` number, nullable
    - `userTranscriptionTime` string, date-time, nullable — When the user's speech transcript was finalised.
    - `transcriptionLatencySeconds` number, nullable — User speech end → transcript complete.
    - `llmFirstOutputTime` string, date-time, nullable
    - `llmFinalOutputTime` string, date-time, nullable
    - `llmTimeToFirstOutputSeconds` number, nullable — Transcript complete → first LLM output.
    - `llmGenerationDurationSeconds` number, nullable — First LLM output → final LLM output.
    - `ttsStartTime` string, date-time, nullable
    - `ttsEndTime` string, date-time, nullable
    - `ttsGenerationDurationSeconds` number, nullable
    - `ttsTimeToFirstAudioSeconds` number, nullable — TTS start → persona starts speaking.
    - `personaStartSpeakingTime` string, date-time, nullable
    - `personaStopSpeakingTime` string, date-time, nullable
    - `firstAudioLatencySeconds` number, nullable — User speech end → persona starts speaking. The end-to-end latency the user experienced.
    - `speakingDurationSeconds` number, nullable
    - `finishReason` 'completed' | 'interrupted' | 'null', nullable
    - `wasInterrupted` boolean
    - `interruptedStage` 'before_llm_output' | 'during_llm_generation' | 'before_audio' | 'while_speaking' | 'null', nullable — Best-effort classification of when the interruption happened, derived from which pipeline timestamps were recorded.
    - `toolCalls` SessionAnalyticsToolCall[]
      - `toolCallId` string, nullable — The engine's ID for this tool call, matching the ID surfaced in SDK tool events.
      - `toolName` string, nullable
      - `toolType` string, nullable
      - `status` 'started' | 'completed' | 'failed' | 'null', nullable
      - `startedAt` string, date-time, nullable
      - `completedAt` string, date-time, nullable
      - `durationSeconds` number, nullable
      - `errorMessage` string, nullable
    - `userMessage` string — Only present with includeMessages=true and transcripts enabled.
    - `assistantMessage` string — Only present with includeMessages=true and transcripts enabled.

## Other responses

- `400` — Bad request - Invalid session ID or query parameters
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - API key lacks the required permission
- `404` — Not Found - Session not found, still in progress, of a session type that does not produce analytics (e.g. livekit), or its report was never received. The error message says which.
- `410` — Gone - Session report was deleted
- `500` — Server error

---

[API](https://skmtc.net/anam/apis/anam-ai-api.md) · [All operations](https://skmtc.net/anam/apis/anam-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/anam/anam-ai-api/versions/67afd1c5db59/schema)
