How do you estimate per-plugin cost in a multi-provider LiveKit Agents platform?

I am building a platform on LiveKit Agents where users assemble their own pipeline. The plugin list is close to everything LiveKit supports across STT, LLM, TTS, VAD, and turn detection.

The hard part is cost. Each provider bills in a different unit:

  • STT: per audio minute, sometimes rounded up per request
  • LLM: per input token and output token, different rates per model
  • TTS: per character for some, per second of synthesized audio for others
  • Realtime models: per audio input and output token, which does not map to any of the above

Questions for anyone who has shipped something similar:

  1. Has anyone built a multi-provider platform on LiveKit Agents and exposed a per-session cost breakdown to end users?
  2. Is MetricsCollectedEvent plus the UsageCollector summary enough to attribute cost per plugin, or did you have to instrument the plugins yourself?
  3. Do you compute cost live during the session, or post-process after the session ends from stored metrics?
  4. How do you maintain the pricing table as providers change rates? Hand-maintained JSON, scraped, or something else?

Is MetricsCollectedEvent plus the UsageCollector summary enough to attribute cost per plugin, or did you have to instrument the plugins yourself?

Yes this should give good info on how to come up with the cost of a session.

A common pattern you can follow is this:

  • LLM cost = prompt/completion tokens × model pricing
  • STT cost = streamed audio seconds/minutes × provider rate
  • TTS cost = characters or generated audio duration × provider rate

Do you compute cost live during the session, or post-process after the session ends from stored metrics?

You will have to do this after the session ends.

How do you maintain the pricing table as providers change rates? Hand-maintained JSON, scraped, or something else?

You will need to keet track of how much each provider you’re using charges and then use that to compute price. You can do this by scraping it every week/day or ping their API to know their pricing.