Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Billing Multi‑Tenant AI Usage – Platform Records, Internal Counters, and Recovery

Description and use

Multi‑tenant AI platforms need accurate billing that accounts for retries and crashes. Monthly reconciliation of platform usage records and internal counters ensures precision and auditability.

Problem

Multi‑tenant AI platforms need accurate billing while handling retries, crashes, and varying attribution granularity.

Outcome

Monthly reconciliation of platform and internal ledgers prevents billing errors, ensures traceability, and supports auditability while maintaining operational control over prepaid balances.

Workflow

  • 1. Fetch platform usage via Infrai API with retry logic and exponential backoff.
  • 2. Persist the frozen platform response as the authoritative snapshot for the invoice run.
  • 3. Record internal usage with dimensions (tenant, property, workflow, model, job ID, attempt ID) and platform request ID when available.
  • 4. Compare platform aggregate with internal aggregate using decimal arithmetic; apply tolerance to trigger human investigation.
  • 5. If discrepancy exceeds tolerance, investigate retry drift or missing records before generating invoice.
  • 6. Use stable idempotency keys for retries to avoid duplicate writes; honor Retry‑After for rate limits.
  • 7. Publish invoice with its own stable idempotency identity.
  • 8. Rotate credentials per service boundary and keep them server‑side only.

Evidence

Use the platform total as the invoice basis. Treat the internal total as an allocation ledger.

Source

Persist that response as the frozen platform-side input for the invoice run, then compare its documented aggregate with the internal aggregate using decimal arithmetic.

Source

  • Record date: 2026-09-21T16:30:36.049Z