FinOps Rail
FinOps Rail
Section titled “FinOps Rail”Financial operations cost tracking, optimization, and resource usage analytics for the platform.
Overview
Section titled “Overview”The FinOps rail provides visibility and control over the operational costs of running Islamic finance infrastructure. It tracks resource consumption across compute, storage, API calls, and third-party service usage at the tenant level, enabling accurate cost allocation and usage-based billing.
For multi-tenant SaaS deployments, the rail meters every API call, ledger transaction, search query, and storage operation, attributing costs to the originating tenant and workspace. This data feeds into the Billing rail for invoice generation and into management dashboards for cost optimization decisions.
The rail also monitors infrastructure spending across cloud providers (AWS, Cloudflare), identifying underutilized resources, cost anomalies, and optimization opportunities. Budget alerts notify administrators when spending approaches or exceeds defined thresholds, and automated recommendations suggest right-sizing actions.
Cost centers can be organized by tenant, workspace, rail, or custom dimensions, supporting the allocation models required by enterprise customers for internal chargeback and showback reporting.
Endpoints
Section titled “Endpoints”Get Cost Summary
Section titled “Get Cost Summary”GET /v1/rails/finops/costs/summaryconst summary = await iof.finops.getCostSummary({ period: "2024-01", group_by: "tenant", currency: "USD",});Response:
{ "period": "2024-01", "total_cost": 12450.8, "currency": "USD", "breakdown": [ { "tenant_id": "ten_001", "tenant_name": "Al-Baraka Bank", "cost": 8200.5, "api_calls": 1250000, "storage_gb": 45.2, "ledger_transactions": 89000 }, { "tenant_id": "ten_002", "tenant_name": "Amanah Capital", "cost": 4250.3, "api_calls": 620000, "storage_gb": 18.7, "ledger_transactions": 34000 } ]}Get Usage Metrics
Section titled “Get Usage Metrics”GET /v1/rails/finops/usageList Cost Centers
Section titled “List Cost Centers”GET /v1/rails/finops/cost-centersCreate Cost Center
Section titled “Create Cost Center”POST /v1/rails/finops/cost-centersconst center = await iof.finops.createCostCenter({ name: "Trade Finance Operations", type: "rail", rail: "trade-finance", budget_monthly: 5000, currency: "USD", alert_threshold_pct: 0.8, owner_id: "user_ops_lead_001",});Set Budget Alert
Section titled “Set Budget Alert”POST /v1/rails/finops/budgetsGet Budget Status
Section titled “Get Budget Status”GET /v1/rails/finops/budgets/:idGet Optimization Recommendations
Section titled “Get Optimization Recommendations”GET /v1/rails/finops/recommendationsExport Cost Report
Section titled “Export Cost Report”POST /v1/rails/finops/reports/exportCost Dimensions
Section titled “Cost Dimensions”| Dimension | Description |
|---|---|
tenant | Cost per tenant |
workspace | Cost per workspace within a tenant |
rail | Cost per rail (murabaha, payments, etc) |
resource | Cost per infrastructure resource type |
provider | Cost per cloud provider (AWS, Cloudflare) |
Metered Resources
Section titled “Metered Resources”| Resource | Unit | Description |
|---|---|---|
api_calls | per request | API endpoint invocations |
ledger_transactions | per transaction | Ledger entries created |
search_queries | per query | Search operations |
storage | per GB-month | Document and data storage |
compute | per vCPU-second | Background job processing |
bandwidth | per GB | Data transfer out |
Budget Status
Section titled “Budget Status”| Status | Description |
|---|---|
ON_TRACK | Spending within budget |
WARNING | Spending approaching threshold |
EXCEEDED | Budget exceeded |
CRITICAL | Spending significantly over budget |
Integration Points
Section titled “Integration Points”- Billing Rail — usage data feeds into tenant invoices
- Analytics Rail — cost trends and forecasting dashboards
- Observability Rail — correlate cost spikes with traffic patterns
- Reporting Rail — periodic cost allocation reports for tenants
- Limits Rail — enforce rate limits based on plan tiers
Webhooks
Section titled “Webhooks”| Event | Description |
|---|---|
finops.budget.warning | Budget approaching threshold |
finops.budget.exceeded | Budget exceeded |
finops.anomaly.detected | Unusual cost spike detected |
finops.report.generated | Cost report ready for download |
finops.recommendation.available | New optimization recommendation |
Standards
Section titled “Standards”- FinOps Foundation - Cloud Cost Management Framework
- ISO 27001 - Information Security (cost audit trails)
- SOC 2 Type II - Cost allocation controls
Next Steps
Section titled “Next Steps”- Billing Rail - Tenant billing and invoices
- Analytics Rail - Usage analytics
- Observability Rail - Infrastructure monitoring