About Tanso
Tanso tells you which customers and features are profitable, and gives you the tools to act on it.
If you're building on AI APIs, your cost of goods sold is someone else's pricing. It shifts when models change, when usage spikes, or when a customer's workflow hits an expensive path you didn't anticipate. Your provider invoices you monthly. But that invoice doesn't tell you what each customer cost you, which features are underwater, or whether your pricing actually covers your costs.
Tanso captures cost, revenue, and usage at the moment each request happens, broken down by customer, feature, and model. You see your margins in real time, not at the end of the quarter.
Two ways to use Tanso
Tanso Observe
Track cost, revenue, and margin per customer without setting up billing. Add one API call after each AI request and see where your money goes.
// Add after any AI API call
await fetch('https://api.tansohq.com/api/v1/client/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
eventIdempotencyKey: crypto.randomUUID(),
eventName: 'chat_completion',
customerReferenceId: 'cus_123',
featureKey: 'ai_summarization',
costInput: {
model: 'gpt-4o',
modelProvider: 'openai',
},
usageUnits: response.usage.total_tokens,
})
})Pass the model and provider. Tanso looks up current pricing automatically. Override with costAmount if you have negotiated rates.
Observe gives you:
- Per-customer profitability -- which customers make you money and which don't
- Per-feature cost breakdown -- which features are expensive and what their margins look like
- Per-model comparison -- how costs vary across providers and models
No plans, no subscriptions, no Stripe. Start here.
Tanso Platform
When you're ready to enforce limits and bill customers, upgrade to Platform. Your event pipeline carries over with zero code changes.
Platform adds two API calls to the pattern:
// Before processing: can this customer use this feature?
const check = await fetch('https://api.tansohq.com/api/v1/client/entitlements/check', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
customerReferenceId: 'cus_123',
featureKey: 'ai_summarization',
})
})
const { allowed } = await check.json()
if (!allowed) return res.status(403).json({ error: 'Usage limit reached' })
// Process the request, then report usage (same event call as Observe)Platform gives you:
- Plans and pricing rules -- bundle features, set prices, manage tiers
- Entitlement enforcement -- real-time access checks before serving requests
- Usage caps and credits -- hard limits, credit pools, rollover policies
- Stripe integration -- usage rolls up into invoices automatically
Core Concepts
| Concept | What It Is |
|---|---|
| Event | A usage record with cost and revenue attached. The foundation for everything. |
| Customer | A billing entity keyed by your own ID. No sync required. |
| Feature | Something you track or gate: ai_summarization, api_calls, seats |
| Plan | A bundle of features with pricing (Platform) |
| Subscription | Links a customer to a plan (Platform) |
| Entitlement | Real-time answer to "can this customer use this feature?" (Platform) |
| Credit | Pre-paid balance with rollover policies and hard limits (Platform) |
LLM-Friendly Docs
Feed your AI coding assistant:
https://docs.tansohq.com/llms.txt-- concise summaryhttps://docs.tansohq.com/llms-full.txt-- complete referencenpm install @tansohq/sdk-- typed autocomplete
Updated about 7 hours ago