MATIH Platform is in active MVP development. Documentation reflects current implementation status.
15. Workbench Architecture
Control Plane UI
Billing & Invoicing

Billing and Invoicing

The Billing page provides plan management, usage metering, invoice history, and cost allocation for tenant administrators and platform operators. It integrates with the Billing Service for pricing calculations and the Observability API for usage data collection.


Features

FeatureDescription
Plan overviewCurrent plan details and limits
Usage meteringReal-time usage tracking by category
Invoice historyPast invoices with download links
Cost breakdownDetailed cost allocation by service
Payment methodsCredit card and invoice payment management
AlertsBudget alerts and overage notifications

Plan Overview

Displays the current subscription plan and usage against limits:

Plan TierLLM Tokens/MonthQueries/MonthStorageUsersPrice
Starter500K10,00010 GB5$99/mo
Professional5M100,000100 GB25$499/mo
EnterpriseUnlimitedUnlimited1 TBUnlimitedCustom

Usage Metering

Usage is tracked across multiple dimensions:

CategoryUnitMeteringBilling Cycle
LLM TokensTokensPer requestMonthly
SQL QueriesQueriesPer executionMonthly
Data StorageGBPeak dailyMonthly
API RequestsRequestsPer callMonthly
Compute HoursHoursPer minuteMonthly

Usage Dashboard

interface UsageMetrics {
  period: string;
  llm_tokens: { used: number; limit: number; percentage: number };
  queries: { used: number; limit: number; percentage: number };
  storage_gb: { used: number; limit: number; percentage: number };
  api_requests: { used: number; limit: number; percentage: number };
}

Invoice History

ColumnDescription
Invoice IDUnique invoice identifier
PeriodBilling period (month/year)
AmountTotal invoice amount
StatusPaid, Pending, Overdue
Due DatePayment due date
ActionsDownload PDF, View details

Cost Breakdown

Detailed cost allocation by service and category:

interface CostBreakdown {
  period: string;
  total_usd: number;
  by_service: {
    ai_service: { llm_cost: number; compute_cost: number };
    query_engine: { query_cost: number; storage_cost: number };
    ml_service: { training_cost: number; serving_cost: number };
  };
  by_user: Array<{ user_id: string; name: string; cost_usd: number }>;
}

Budget Alerts

Configurable alerts when usage approaches or exceeds budgets:

Alert TypeTriggerNotification
Usage warning80% of plan limitEmail + in-app
Usage critical95% of plan limitEmail + in-app + SMS
OverageExceeds plan limitEmail + in-app + SMS
Budget alertCustom budget thresholdConfigurable

Payment Methods

MethodDescription
Credit cardStripe integration for card payments
ACH transferBank transfer for US customers
InvoiceNet-30 invoicing for Enterprise plans
Wire transferInternational wire for Enterprise plans

Permissions

ActionPlatform AdminTenant AdminBilling Contact
View usageYesOwn tenantOwn tenant
View invoicesAllOwn tenantOwn tenant
Update planYesRequestNo
Manage paymentYesYesYes
Set budget alertsYesYesYes