Repository navigation
feat: add provider, model, and client spend to the AI spend users endpoint - #32330
Draft
ssncferreira wants to merge 1 commit into
Draft
ssncferreira wants to merge 1 commit into
ssncferreira wants to merge 1 commit into
Conversation
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends the experimental
GET /api/experimental/organizations/{organization}/ai/spend/usersendpoint with the per-user details behind the AI spend overview (the unpriced models tooltip and the cost details dialog) and the detailed report. Each user now returns their spend per provider, model, and client, and the number of models with unpriced usage.Changes
ListOrganizationAISpendUserswithGROUPING SETS, returning one row per user and provider, model, or client:user_idsandgroup_idfilters.ai_providers, including deleted providers. The live provider wins when a name was reused, likeGetAIProviderFilterOptions.unpriced_model_countandprovider_spend,model_spend, andclient_spend, most expensive first.totalsreturnshas_unpriced_usage.providers,clients, andmodelsname arrays andunpriced_usage_count.user_ids(comma-separated, maximum 100) andgroup_id.Closes AIGOV-734
Note
Generated by Coder Agents on behalf of @ssncferreira.