> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost Operations Proposal

> A proposed Admin workflow for spend coverage, cost attribution, budgets and invoice close.

[Cost Discovery Inventory](https://docs.tuturuuu.com/build/devops/cost-discovery.md) documents the current provider
inventory, collectors, Admin permissions and budget alerts. This proposal extends
that surface with subscription renewals, AI credit balances and an evidence trail
for each allocation. All rollout phases require separate approval.

## Compare spend and coverage

The Admin Costs overview compares current and prior periods by group, with
separate views for reconciled invoices, provider-reported charges and forecasts.
Show the cutoff, currency, measured days and missing accounts with each total.
Compare open periods through the same elapsed UTC day. Compare closed periods
on the invoice posting calendar, retaining service dates for attribution.
An empty verified window can show zero. Partial, stale and unavailable sources
carry their own labels. A partial total represents only the covered amount.

| Group | Evidence | Attribution |
| - | - | - |
| Infrastructure | Issued invoices control posted spend. Provider billing exports supply preliminary SKU and resource charges. Usage APIs provide allocation drivers where usage meters match billing units. | Match provider resource or project IDs to app, environment and owner using mappings effective on the service date. Split shared charges using measured billable units or an approved fixed rule. |
| Subscriptions | Invoice or renewal receipt establishes spend. Contract dates, plan, seat roster and committed quantity establish renewal exposure. | Assign named seats to teams, split shared plans by approved seat counts, and retain unused seats with the subscription owner. Show annual cash charges at posting and label any normalized monthly view as planning. |
| AI credits and direct usage | Top-up receipts, balance snapshots, credit grants and expiry records explain prepaid movements. Gateway settlement or direct provider billing supplies monetary consumption. Internal request and session meters supply model, app and workspace attribution. | Match on provider account and service window, then use provider request IDs or covered model usage as allocation evidence. Keep product credits, provider credit units and currency in separate fields. |

Count top-ups in cash spend and credit drawdown in consumption. A combined
operating-cost view uses consumption for prepaid accounts, so the same purchase
is counted once. Reconcile the credit balance from opening balance plus purchases
and grants, less consumption and expiries, with signed adjustments. Preserve
credit denomination and grant restrictions. Conversion to currency requires
documented valuation evidence.

Direct matches take precedence over shared allocations. Store the evidence
reference, mapping version, driver window and denominator with each split.
Round in currency minor units with a deterministic remainder assignment. Record
unmapped or unsupported amounts as unallocated and keep them in account totals.
When attribution coverage is incomplete, show a separately labeled estimate or
leave the cost unallocated. Use complete matching cost and usage windows for
unit costs.

## Visibility and ownership

Keep account charges and invoice drill-down at the existing root Admin boundary
requiring both `view_infrastructure` and `view_finance_stats`. Apply that check
to API responses and exports. Infrastructure owns resource mappings and source
coverage. AI Platform owns provider-credit evidence and feature mappings.
Finance owns invoice approval, currency policy, renewal records and close.
Workspace-facing usage, if introduced, is scoped to the authorized workspace
and carries its own product-credit units. Provider invoices, balances and
cross-workspace allocations stay in root Admin. Restrict evidence attachments
to authorized reviewers and retain references and timestamps in the audit trail.

## Budgets and operating limits

Keep existing provider and total alerts as the baseline. Propose approved
monthly budgets by owner, provider and group, with currency, effective period,
warning ratio and acknowledgment owner. Show billed-to-date and forecast
against the same budget basis, and annotate alerts driven by incomplete data.
Deduplicate by budget, month and severity. Show AI credit balance, expiry and
estimated runway when consumption coverage supports it. Track subscription
renewal dates and committed seats separately from variable spend.

Alerts notify owners. Enforceable operating limits require a separate policy
and a service-specific control, such as an AI request quota or a durable
collector stop fence. Each proposed control needs bounded retries, an explicit
reset rule and evidence that the limit survives restart. Provider alerts remain
advisory where a provider cannot enforce a cap.

## Reconcile and close

1. Snapshot evidence by provider account, invoice window and currency with a
   source reference, retrieval time, coverage state and external line identity.
2. Tie provisional charges to the issued invoice, including taxes, refunds,
   discounts, fees, late adjustments and rounding. Record variance by reason
   and owner. Review residuals against a Finance-approved tolerance.
3. Verify that allocation plus unallocated balance equals the reconciled
   control per account and currency. Link the approved invoice to its Finance
   posting or show its unposted state and reason. Use stable invoice identity
   to prevent duplicate postings after reimport.
4. Record reviewer and close time. Preserve the reviewed snapshot. Handle a
   late correction as a linked adjustment or a Finance-approved reopen, with
   evidence of the resulting revision.

## Proposed rollout

| Phase | Exit evidence |
| - | - |
| 1. Evidence and permissions | Finance and provider owners confirm account inventory, approved evidence paths, currency and close rules. Fixture checks cover scoped access and verified zero, partial and unavailable data. |
| 2. Invoice close and subscriptions | A controlled sample ties invoices to Finance postings. Renewal dates and seat ownership have accountable owners. Reimport and late-adjustment checks preserve totals. |
| 3. Attribution and credit visibility | A sample ties provider-credit movements and AI usage to settlement. Shared splits and missing mappings preserve account totals. Unit cost waits for complete matched denominators. |
| 4. Budget operations | Owners approve thresholds, test deduplication and delivery, and exercise any separately approved hard limits and recovery paths. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.