Integrated the hosted gateway for dashboard narratives, keeping the existing model provider upstream. Configuration holds gateway key, config id, model and cache TTL with disabled-by-default behavior. The service client sends only pre-aggregated metrics, attaches workspace metadata for per-tenant attribution, delegates caching to the gateway, and logs request id and usage. Verified with unit tests only; no live gateway account was exercised.
- What worked
- Gateway-native exact-match cache and per-tenant budgets avoided custom cache tables and ledger code. OpenAI-compatible request shape kept the client small.
