API
Billing
Usage tracking and billing portal
Trunx uses usage-based billing powered by Stripe. You only pay for what you use — no monthly minimums or committed volumes.
Get Usage Summary
GET /api/billing/usage
Returns your current billing period usage broken down by meter.
curl "https://api.trunx.io/api/billing/usage" \
-H "Authorization: Bearer tk_live_..."const res = await fetch("https://api.trunx.io/api/billing/usage", {
headers: { "Authorization": "Bearer tk_live_..." },
});
const data = await res.json();import requests
res = requests.get(
"https://api.trunx.io/api/billing/usage",
headers={"Authorization": "Bearer tk_live_..."},
)
data = res.json()Response
{
"usage": [
{ "meter": "sms.send", "displayName": "SMS Sent", "total": 1250 },
{ "meter": "sms.receive", "displayName": "SMS Received", "total": 430 },
{ "meter": "voice.outbound", "displayName": "Outbound Calls", "total": 890 },
{ "meter": "voice.inbound", "displayName": "Inbound Calls", "total": 215 },
{ "meter": "voice.ai", "displayName": "AI-Powered Calls", "total": 340 },
{ "meter": "did.monthly", "displayName": "Monthly DID Fee", "total": 12 }
],
"message": "Usage for current billing period"
}Get Billing Portal
GET /api/billing/portal
Returns a URL to your Stripe billing portal where you can view invoices, update payment methods, and manage your subscription.
curl "https://api.trunx.io/api/billing/portal" \
-H "Authorization: Bearer tk_live_..."const res = await fetch("https://api.trunx.io/api/billing/portal", {
headers: { "Authorization": "Bearer tk_live_..." },
});
const { url } = await res.json();
// Redirect user to the portal
window.location.href = url;import requests
res = requests.get(
"https://api.trunx.io/api/billing/portal",
headers={"Authorization": "Bearer tk_live_..."},
)
portal_url = res.json()["url"]Response
{
"url": "https://billing.stripe.com/p/session/..."
}Pricing Model
Trunx uses usage-based pricing via Stripe metering. Every billable action is tracked as a usage event:
| Meter | Description |
|---|---|
sms.send | Outbound SMS message sent |
sms.receive | Inbound SMS message received |
voice.outbound | Outbound voice call |
voice.inbound | Inbound voice call |
voice.ai | AI-powered voice call (Ultravox) |
did.monthly | Monthly fee per active DID |
Usage is aggregated per billing period and invoiced automatically through Stripe. View your current usage at any time via the /api/billing/usage endpoint or in the dashboard billing page.