AI Help

How do I measure time to first token versus total response time in a streaming AI app?

Measure time to first meaningful token and time to final completion separately using a monotonic clock and consistent boundaries.

Steps to follow

  1. Record request start, first content event, final completion event and connection close in the client.
  2. Define how to count tool calls, reasoning events and empty chunks so measurements remain comparable.
  3. Compare the same task, model and network conditions across runs and report distributions. Include failed or interrupted streams separately.

Example in practice

Illustrative example. A reply can start after one second but finish after twelve, so both figures are needed to describe the user experience.

Related AI help

Official guidance

OpenAI documentation