API cost tracking and Stripe invoice generation