Usage & Billing API
Query usage stats, billing information, and manage payments.
Usage statistics
$GET https://api.alltoken.ai/api-account/user/usageReturns token usage, cost summary, daily chart data, and model breakdown. Query parameters: start_date and end_date in YYYY-MM-DD format.
Billing summary
$GET https://api.alltoken.ai/api-account/user/billingReturns plan, credit balance, platform fee rate, payment methods, and invoices.
Credit balance
$GET https://api.alltoken.ai/api-account/user/balanceReturns current credit balance available for API usage.
Add credits
$POST https://api.alltoken.ai/api-account/user/billing/create-checkout| 1 | { |
| 2 | "amount": 100, |
| 3 | "currency": "USD" |
| 4 | } |
Creates a Stripe checkout session. amount and currency are required; optional success_url and cancel_url override the redirect targets. The response includes order_id, checkout_url, and session_id.
Payment status
$GET https://api.alltoken.ai/api-account/user/billing/payment-status/{order_id}Returns the status of one payment order.
Payment orders
$GET https://api.alltoken.ai/api-account/user/billing/orders?limit=20&offset=0Lists payment orders. Query parameters: limit (default 20, max 100) and offset (default 0).
Billing document
$POST https://api.alltoken.ai/api-account/user/billing/document| 1 | { |
| 2 | "order_id": "ord_123", |
| 3 | "type": "invoice" |
| 4 | } |
Generates an invoice or receipt document URL for a payment order. order_id is required; type can be invoice or receipt.