FLUX 3 and Gemini 3.7 Flash are now live on CometAPI โ†’
Transparent performance research

AI API Latency Benchmark: TTFT, Throughput and Reliability

A transparent methodology for measuring AI API latency without confusing time-to-first-token, generation speed and total response time.

AI API benchmark instrument measuring latency and throughput signals
CA
CometAPI Research
AI model and API engineering
August 6, 2026 8 min read

Key takeaways

TTFT measures responsiveness; tokens per second measures generation speed.
Use the same model version, prompt, output target and streaming mode for every route.
Report median and p95 values instead of one fastest request.
Publish errors, timeouts, region and test window alongside performance numbers.

Measure four different latency signals

A single latency number hides where users are waiting. Streaming chat can feel fast with a low TTFT even when the full completion takes longer, while batch extraction may care only about end-to-end duration.

  • Time to first token: request start to first streamed token.
  • Generation throughput: output tokens divided by generation time.
  • End-to-end duration: request start to completed response.
  • Reliability: successful responses divided by total attempts.

Control the benchmark workload

Use a fixed prompt set that represents the intended workload. Record model ID, provider route, region, request parameters, input tokens and requested output length.

  • Run warm-up requests before recording measurements.
  • Randomize provider order to reduce time-of-day bias.
  • Repeat tests during more than one traffic window.
  • Keep streaming and non-streaming results separate.

Use distributions, not a leaderboard screenshot

Report median, p90 and p95 values with sample size. A route with the fastest median but frequent extreme delays may provide a worse production experience than a slightly slower but more stable route.

{
  "sample_size": 100,
  "ttft_ms": { "median": 640, "p95": 1840 },
  "output_tokens_per_second": { "median": 42.1 },
  "end_to_end_ms": { "median": 5120, "p95": 9080 },
  "success_rate": 0.98
}

The values above are an illustrative reporting format, not a live CometAPI benchmark result.

Publish methodology with every report

A benchmark is useful only when a reader can understand what was measured and reproduce the approach. Include limitations and explain whether the provider route was pinned or automatically selected.

Frequently asked questions

What is TTFT in an AI API?

Time to first token is the duration between sending the request and receiving the first generated token from a streaming response.

Is the fastest AI API always the best route?

No. Production selection should also consider error rate, p95 latency, output quality, price and whether the route supports the required features.

Continue with Benchmarks & Reports
Return to the section overview and future articles.
View section