Skip to content

feat(site/src): add the AI spend total spend card - #32338

Draft
ssncferreira wants to merge 1 commit into
ssncf/ai-spend-overview-shellfrom
ssncf/ai-spend-total-card
Draft

ssncferreira wants to merge 1 commit into
ssncf/ai-spend-overview-shellfrom
ssncf/ai-spend-total-card

Conversation

@ssncferreira

Copy link
Copy Markdown
Collaborator

Description

Adds the Total spend card to the AI spend Overview tab. The total comes from the fast overview endpoint, and the "N models not set up" warning from GET /api/experimental/organizations/{organization}/ai/model-prices/unpriced, which is slower, so the total renders first and the warning follows with its own loading state.

Changes

  • Add API.experimental.getOrganizationUnpricedAIModels, the organizationUnpricedAIModels query, and canReadOrganizationAIModelPrices. The endpoint requires read on the organization's model prices, so the page only requests it for viewers who pass that check.
  • Add StatCard, the labeled figure the overview cards share, and TotalSpendCard, which shows a skeleton until the total loads and a spinner while the unpriced models load.
  • If the unpriced models request fails, hide the warning instead of blocking the total.
  • If an overview refetch fails, keep the cached cards below the error.
  • Add MockUnpricedAIModels, tests for the unpriced models requests and the permission gate, and stories for the card states.

Related to AIGOV-732

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Nov 17, 2026

Copy link
Copy Markdown

AIGOV-732

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant