Loading...
Loading...
Loading...
We use essential storage to operate Lexel Translate. With your permission, we also use analytics, advertising, and marketing technologies. Read our Cookie Policy.
Loading...
Inspect remaining quota, subscription linkage, and recent billed usage for a user or organization. Session auth only.
/api/v1/billing/usageReturn balances, subscription context, and recent monthly usage.
curl -X GET "https://translate.lexel.ai/api/v1/billing/usage?scope=user" \-H "Cookie: better-auth.session_token=your_session_cookie"
| Field | Type | Required | Description |
|---|---|---|---|
| scope | user | organization | No | Billing scope. API keys are not valid billing scopes. |
| scope_id | string | No | Optional organization ID when billing is managed at organization level. |
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | True when the billing view is returned. |
| scope | user | organization | Yes | Resolved billing scope. |
| account | object | No | User account record when scope is user. |
| account.id | string | No | User ID when scope is user. |
| account.membership | free | premium | referral | No | Membership tier when scope is user. |
| organization | object | No | Organization record when scope is organization. |
| organization.id | string | No | Organization ID when scope is organization. |
| organization.membership | free | premium | referral | No | Membership tier when scope is organization. |
| balances.freeRemaining | number | Yes | Remaining free characters for the resolved scope. |
| balances.premiumRemaining | number | Yes | Remaining Premium characters for the resolved scope. Document translation always consumes this balance, including browser submissions. |
| subscription | object | null | No | Resolved subscription information when available. |
| recentPaymentEvents | array | Yes | Recent payment records tied to the scope. |
| recentMonthlyUsage | array | Yes | Recent monthly usage summaries for billing review. |
{"ok": true,"scope": "user","account": {"id": "usr_123","membership": "premium"},"balances": {"freeRemaining": 100000,"premiumRemaining": 5240000},"subscription": {"subscriptionId": "sub_123","customerId": "cus_123"},"recentPaymentEvents": [],"recentMonthlyUsage": []}
User-scope responses include account. Organization-scope responses include organization instead. The billing balances, subscription, recent payment events, and recent monthly usage fields use the same top-level names for both scopes.