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
| Feature | Description |
|---|---|
| Plan overview | Current plan details and limits |
| Usage metering | Real-time usage tracking by category |
| Invoice history | Past invoices with download links |
| Cost breakdown | Detailed cost allocation by service |
| Payment methods | Credit card and invoice payment management |
| Alerts | Budget alerts and overage notifications |
Plan Overview
Displays the current subscription plan and usage against limits:
| Plan Tier | LLM Tokens/Month | Queries/Month | Storage | Users | Price |
|---|---|---|---|---|---|
| Starter | 500K | 10,000 | 10 GB | 5 | $99/mo |
| Professional | 5M | 100,000 | 100 GB | 25 | $499/mo |
| Enterprise | Unlimited | Unlimited | 1 TB | Unlimited | Custom |
Usage Metering
Usage is tracked across multiple dimensions:
| Category | Unit | Metering | Billing Cycle |
|---|---|---|---|
| LLM Tokens | Tokens | Per request | Monthly |
| SQL Queries | Queries | Per execution | Monthly |
| Data Storage | GB | Peak daily | Monthly |
| API Requests | Requests | Per call | Monthly |
| Compute Hours | Hours | Per minute | Monthly |
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
| Column | Description |
|---|---|
| Invoice ID | Unique invoice identifier |
| Period | Billing period (month/year) |
| Amount | Total invoice amount |
| Status | Paid, Pending, Overdue |
| Due Date | Payment due date |
| Actions | Download 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 Type | Trigger | Notification |
|---|---|---|
| Usage warning | 80% of plan limit | Email + in-app |
| Usage critical | 95% of plan limit | Email + in-app + SMS |
| Overage | Exceeds plan limit | Email + in-app + SMS |
| Budget alert | Custom budget threshold | Configurable |
Payment Methods
| Method | Description |
|---|---|
| Credit card | Stripe integration for card payments |
| ACH transfer | Bank transfer for US customers |
| Invoice | Net-30 invoicing for Enterprise plans |
| Wire transfer | International wire for Enterprise plans |
Permissions
| Action | Platform Admin | Tenant Admin | Billing Contact |
|---|---|---|---|
| View usage | Yes | Own tenant | Own tenant |
| View invoices | All | Own tenant | Own tenant |
| Update plan | Yes | Request | No |
| Manage payment | Yes | Yes | Yes |
| Set budget alerts | Yes | Yes | Yes |