> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call quality signals

> Per-call quality record for AI Assistant voice calls, with latency, turns, end reason, provider failures, loop detection, silence timeouts and task success.

Every AI Assistant voice call gets a **quality record** when it ends. The record summarizes how the call went in one place: how fast the assistant answered, how the call ended, whether a speech or language provider failed, and whether the assistant got stuck repeating itself.

Records are computed after the call ends, so they never add latency to the conversation. Calls that ended before quality tracking was available have no record.

> [!NOTE]
>
> Quality records cover AI Assistant voice calls only. Web chat and SMS conversations don't have one, and neither do Conversation Relay calls or calls from assistants with data retention turned off.

## Reading the record

Get the record for one conversation:

```bash theme={null}
curl https://api.telnyx.com/v2/ai/conversations/{conversation_id}/quality \
  -H "Authorization: Bearer $TELNYX_API_KEY"
```

List records, newest call first, filtered by assistant, assistant version and the time the call ended:

```bash theme={null}
curl -G https://api.telnyx.com/v2/ai/conversations/quality \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  --data-urlencode "assistant_id=assistant-6fa1f2b4-1b2c-4d3e-9f10-2a3b4c5d6e7f" \
  --data-urlencode "assistant_version_id=20250812T114318034399" \
  --data-urlencode "ended_at[gte]=2026-11-01T00:00:00Z" \
  --data-urlencode "ended_at[lte]=2026-11-30T23:59:59Z" \
  --data-urlencode "page[size]=50"
```

| Parameter | Description |
| - | - |
| `assistant_id` | Only calls handled by this assistant. |
| `assistant_version_id` | Only calls that ran this assistant version. |
| `ended_at[gte]`, `ended_at[lte]` | Only calls that ended in this window (ISO 8601). |
| `page[number]`, `page[size]` | Pagination. `page[size]` is at most 100. |

A record looks like this:

```json theme={null}
{
  "data": {
    "conversation_id": "1d3c7b9a-5e2f-4a61-8b0d-7c9e2f4a6b13",
    "assistant_id": "assistant-6fa1f2b4-1b2c-4d3e-9f10-2a3b4c5d6e7f",
    "assistant_version_id": "20250812T114318034399",
    "started_at": "2026-11-20T12:00:00Z",
    "ended_at": "2026-11-20T12:01:05Z",
    "duration_ms": 65000,
    "time_to_first_speech_ms": 1250,
    "response_latency_p50_ms": 820,
    "response_latency_p95_ms": 1900,
    "user_turn_count": 6,
    "assistant_turn_count": 7,
    "end_reason": "assistant_hangup",
    "error_count": 0,
    "stt_failure": false,
    "llm_failure": false,
    "tts_failure": false,
    "loop_detected": false,
    "max_repeated_replies": 1,
    "silence_timeout_count": 1,
    "task_success": true
  }
}
```

In the Mission Control Portal, open an assistant, go to **Analysis > Conversation History**, select a conversation and open the **Quality** tab.

## How each signal is defined

### Time to first speech

`time_to_first_speech_ms` is the time from Telnyx receiving the request to start the assistant until the first assistant audio is sent to the call. It includes the greeting's speech synthesis. It is `null` when it wasn't measured: the assistant never spoke, or the call is a Realtime WebSocket session, where first audio isn't measured.

### Response latency

For each assistant reply that answers something the caller said, the response latency is the time from the end of the caller's speech to the start of the assistant's speech. Replies that don't follow a caller turn, like the greeting or a follow-up after the assistant's own reply, are not counted.

`response_latency_p50_ms` is the median and `response_latency_p95_ms` the 95th percentile of those latencies, using the nearest-rank method. Both are `null` when there's no such reply.

### Turns and duration

* `user_turn_count`: caller utterances that were transcribed to non-empty text.
* `assistant_turn_count`: spoken assistant replies. Tool calls are not counted.
* `duration_ms`: from the start of the assistant to the end of the call.

### End reason

`end_reason` is the first of these that applies:

| Value | Meaning |
| - | - |
| `error` | A failure ended the call, for example a speech-to-text failure or an internal error. |
| `timeout` | The caller stayed silent past the assistant's user idle timeout, or the call reached its maximum duration. |
| `transfer` | The assistant transferred the call and the transfer completed. |
| `assistant_hangup` | The assistant ended the call with its hangup tool. |
| `user_hangup` | The caller hung up. |
| `other` | Anything else, for example the assistant was stopped through the API or voicemail detection stopped it. |

### Errors and provider failures

* `error_count`: errors reported during the call, including ones the call recovered from (a skipped reply) and the one that ended it.
* `stt_failure`: speech-to-text (transcription) failed at least once.
* `llm_failure`: the language model failed at least once, including a speech-to-speech model session failing.
* `tts_failure`: text-to-speech failed at least once, including a greeting that produced no audio.

Errors that aren't a provider's, like a failing webhook tool, count in `error_count` but raise no provider flag.

### Loop detection

`loop_detected` is `true` when the assistant gave **3 or more near-identical replies in a row**. `max_repeated_replies` is the longest such run in the call.

Two replies are near-identical when at least 80% of their distinct words are shared, after lowercasing and removing punctuation.

Normal confirmation-style repetition isn't a loop:

* Replies under 5 words, like "Got it." or "Okay, one moment.", never count toward a loop, however often they repeat.
* Confirmations that echo different details, like "Great, I've noted your phone number." and "Great, I've noted your email address.", aren't near-identical.
* A question repeated with other replies in between, like "Is there anything else I can help you with today?", isn't a run.

A short acknowledgement between two repeats breaks the run.

### Silence timeouts

`silence_timeout_count` counts the times the caller's silence hit a timeout: each time the assistant re-prompted after the user idle reply time, plus 1 when the user idle timeout ended the call. Reaching the maximum call duration is not a silence timeout.

### Task success

`task_success` comes from [AI Insights](https://developers.telnyx.com/docs/inference/ai-insights/structured-insights.md). Create a structured insight whose JSON schema has a boolean `task_success` property, and add it to the insight group your assistant runs. For example:

```json theme={null}
{
  "type": "object",
  "properties": {
    "task_success": {
      "type": "boolean",
      "description": "Whether the caller's goal for this call was achieved"
    },
    "reason": { "type": "string" }
  },
  "required": ["task_success", "reason"]
}
```

Insights run after the call, so `task_success` is `null` until the insight has finished. It's also `null` when no insight reports a boolean `task_success`. When several insights report one, the most recently completed one is used.
