Metrics

This page explains the metrics sent to clients over the WebRTC data channel.


1. Enable Metrics in the Connect API Request

To receive metrics on the WebRTC data channel, set debug to true when calling the connect API.

HTTP request:

POST https://live.convai.com/connect
X-Api-Key: <X-Api-Key>
Content-Type: application/json

Request body:

{
  "character_id": "<your character_id>",
  "debug": true
}

2. Receiving Metrics on the Client

Metrics are sent as RTVI messages on the WebRTC data channel.

Filter incoming messages with:

  • label === "rtvi-ai"

  • type === "metrics"


3. Metrics Message Shape

A: TTFB message

B: Processing message

C: Custom (NeuroSync) message

Notes:

  • data contains only one key (ttfb or processing or custom) in a message.

  • Over a single response turn, you will receive multiple metrics messages.


4. Metric Types and Meaning

Metric bucket
Where
Meaning
Unit

ttfb

data.ttfb[]

Time from first input at a processor to first output from that processor.

seconds

processing

data.processing[]

Total active processing time for that processor for the emitted span/turn window.

seconds

custom

data.custom[]

Custom processor metrics (currently NeuroSync quality/throughput signals).

number

Entry fields:

  • processor (string): stage instance identifier

  • model (string, optional): model identifier when available

  • value (number): metric value (or placeholder value in docs examples)

  • metric (string, custom only): metric key such as neurosync.output_fps

  • type (string, custom only): currently NeuroSyncMetricsData

NeuroSync custom metrics currently emitted:

  • neurosync.output_fps

  • neurosync.blendshapes_received

  • neurosync.blendshapes_sent

  • neurosync.frames_dropped


5. Example code to view metrics


6. Usage Notes

These metrics provide immediate per-turn context during live conversations and can be used as a practical troubleshooting signal. When a response feels slow or quality drops, the payload helps identify which stage is contributing most to delay (STT, LLM, TTS, or NeuroSync).

Last updated

Was this helpful?