
Building a multi-tenant SaaS on top of TokenRex
Per-customer keys, per-customer billing, and how to mark up AI cost.
If you're building AI features into a SaaS, you have two accounting problems: attributing cost to a customer, and pricing it back to them.
Attribution#
Tag every request with metadata.customer_id. The response header X-Cost-Paise tells you what to bill.
Pricing#
- Cost-plus: TokenRex cost × 2 → your price
- Credit bundles: prepaid, expire in 12 months
- Included in plan: cap usage per tier
Never expose raw token counts to end customers. Package as 'messages' or 'documents' — units they understand.
Build this with TokenRex
TokenRex is an LLM marketplace by Asirex Labs. Choose an enabled model, create a private API key and use the supported endpoint shown in Docs. Check live prices before your first request.