Repository navigation
feat: add organization AI spend overview endpoint - #31709
Draft
ssncferreira wants to merge 1 commit into
Draft
ssncferreira wants to merge 1 commit into
ssncferreira wants to merge 1 commit into
Conversation
ssncferreira
force-pushed
the
ssncf/ai-spend-overview-endpoint
branch
from
November 3, 2026 20:03
19849a9 to
793d96e
Compare
ssncferreira
changed the base branch from
main
to
ssncf/ai-spend-overview-queries
November 3, 2026 20:04
ssncferreira
force-pushed
the
ssncf/ai-spend-overview-endpoint
branch
from
November 3, 2026 20:11
793d96e to
af5b8bd
Compare
This branch has not been 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
Adds the experimental
GET /api/experimental/organizations/{organization}/ai/spendendpoint that backs the new Overview tab of the organization AI spend page. It returns the organization's spend summary, daily spend, and a page of users with their per-group spend, using the queries from #31711.Changes
organizationAISpendhandler andExperimentalClient.OrganizationAISpend:period_start/period_endtogether, at most 31 days, default to the current UTC month narrowed to retention). Bounds must be at UTC midnight; a default period narrowed by retention starts at the next UTC day.count,totals(spend_micros,median_spend_micros),daily(one bucket per UTC day, zeros included), andusers(paginated withlimit/offset, most spend first, with per-group spend).parseOrganizationAISpendPage, shared with/ai/spend/users.Closes AIGOV-728
Note
Generated by Coder Agents on behalf of @ssncferreira.