Summary
Show users their token consumption and estimated cost for the current session. Display warnings when approaching budget limits so users can make informed decisions about continued interaction.
UX Requirements
- Token usage display in session header or sidebar (input tokens, output tokens, estimated cost)
- Budget progress bar when budget limits are configured
- Warning notification (toast or banner) when approaching soft budget limit (e.g., 80%)
- Error/blocking notification when hard budget limit is reached
- Per-message token count available on hover or in message metadata popover
- Cost breakdown by model if multiple models are used in the session
- Usage data refreshes after each assistant response, not on a polling interval
- Dismissible warnings — don't nag after acknowledgment
Implementation Notes
Read usage data from GET /v1/sessions/{id}/usage via the gateway. Budget information can also arrive in response headers (X-Token-Usage, X-Budget-Remaining) on each chat completion response. The UI should cache the latest usage snapshot and update incrementally. Budget thresholds are configured server-side; the UI only renders them.
Companion Issues
Companion issues filed on fips-agents/agent-template, fips-agents/gateway-template, fips-agents/fips-agents-cli, and fips-agents/examples.
Size
S-M
Summary
Show users their token consumption and estimated cost for the current session. Display warnings when approaching budget limits so users can make informed decisions about continued interaction.
UX Requirements
Implementation Notes
Read usage data from
GET /v1/sessions/{id}/usagevia the gateway. Budget information can also arrive in response headers (X-Token-Usage,X-Budget-Remaining) on each chat completion response. The UI should cache the latest usage snapshot and update incrementally. Budget thresholds are configured server-side; the UI only renders them.Companion Issues
Companion issues filed on fips-agents/agent-template, fips-agents/gateway-template, fips-agents/fips-agents-cli, and fips-agents/examples.
Size
S-M