All Questions
Llm Gateway Cost And Caching hard

Your LLM bill doubled month over month, and finance asks which product feature caused it. Gateway logs record only the tenant ID, and two internal services call the provider directly with a shared API key. What gives reliable attribution from now on?

  1. A Allocate the bill to features in proportion to each service's request count, which approximates spend closely enough for internal chargeback.
  2. B Estimate per-feature cost from prompt lengths in application logs, since input tokens dominate the bill for most LLM features.
  3. C Issue a separate provider API key per tenant, so the provider's usage dashboard reports exact spend per feature without gateway changes.
  4. D Route all calls through the gateway and require tenant and feature tags on each, logging input, output, and cached tokens per request.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions