跳转至

apogee-ai-billing

Multi-tenant usage metering, plan management and RLS-isolated invoicing.

This page is being expanded

The tables below are generated from the package source, so they are accurate. Narrative guides and worked examples are being written module by module.

Public API

Everything below is exported from the package root, so from apogee_ai_billing import X works for each name.

Layer Symbols
Application · DTOs BenchDTO, InvoiceDTO, RecordDTO, SubscribeDTO
Application · Use cases BenchInvoicingUseCase, GenerateInvoiceUseCase, ListPlansUseCase, RecordUsageUseCase, SubscribePlanUseCase
Domain BillingPeriod, Invoice, InvoiceLine, InvoiceStatus, Plan, PriceTier, Subscription, UsageRecord
Domain · Enums PlanKind
Domain · Exceptions BillingError, InvoiceNotFoundException, PlanNotFoundException, SubscriptionNotFoundException
Domain · Protocols (ports) IInvoiceRepository, IMeter, IPlanRepository, ISubscriptionRepository
Infrastructure CompositeMeter, FlatPlan, InMemoryInvoiceRepository, InMemoryMeter, InMemoryPlanRepository, InMemorySubscriptionRepository, InvoiceBuilder, JsonInvoiceFormatter, MarkdownInvoiceFormatter, RequestMeter, TieredPlan, TokenMeter, UsagePlan

Install

Bash
pip install apogee-ai-billing

The base install has no required third-party dependency. Each extra unlocks one adapter.

Extra Pulls in
stripe stripe>=8.0

CLI

Installed as a console script, and registered as an apogee plugin so the same subcommands work under the global binary.

Bash
apogee-billing --help