Account API
Manage your account resources, view API usage statistics, check credit balance, and track transactions.
All Account API endpoints require authentication. Include a valid JWT Bearer token in the Authorization header.
GET/auth/account/usage
Account Usage
Retrieve usage statistics for your account over a specified time period.
Query Parameters
- Name
period- Type
- string
- Description
- Time period: daily, monthly, yearly (default: monthly)
- Name
from- Type
- string
- Description
- Start date in ISO 8601 format (default: start of current month)
- Name
to- Type
- string
- Description
- End date in ISO 8601 format (default: now)
Request
GET
/auth/account/usageResponse
GET/auth/account/credits
Credit Balance
Retrieve your current credit balance, reserved credits, and available credits.
Request
GET
/auth/account/creditsResponse
GET/auth/account/ledger
Credit Ledger
Retrieve a paginated list of credit transactions (debits, credits, adjustments).
Query Parameters
- Name
type- Type
- string
- Description
- Filter by transaction type: credit, debit, adjustment
- Name
from- Type
- string
- Description
- Start date in ISO 8601 format
- Name
to- Type
- string
- Description
- End date in ISO 8601 format
- Name
limit- Type
- integer
- Description
- Results per page (default: 50, max: 100)
- Name
offset- Type
- integer
- Description
- Pagination offset (default: 0)
Request
GET
/auth/account/ledgerResponse
GET/auth/account/summary
Account Summary
Retrieve a complete account overview including credit balance, subscription status, and usage statistics.
Request
GET
/auth/account/summaryResponse
Schema
UsageStats Object
| Field | Type | Description |
|---|---|---|
user_id | integer | User ID |
period | string | Time period: daily, monthly, yearly |
total_requests | integer | Total API requests |
successful_requests | integer | Successful requests |
failed_requests | integer | Failed requests |
credits_consumed | float | Credits consumed |
requests_by_endpoint | object | Request counts by endpoint |
period_start | datetime | Period start time |
period_end | datetime | Period end time |
CreditBalance Object
| Field | Type | Description |
|---|---|---|
user_id | integer | User ID |
balance | float | Total balance |
reserved | float | Reserved/held credits |
available | float | Available for use |
currency | string | Currency code |
last_updated | datetime | Last update timestamp |
auto_reload_enabled | boolean | Auto-reload enabled |
auto_reload_threshold | float | Trigger threshold |
auto_reload_amount | float | Reload amount |
CreditLedgerEntry Object
| Field | Type | Description |
|---|---|---|
id | integer | Entry ID |
user_id | integer | User ID |
type | string | Transaction type: credit, debit, adjustment |
amount | float | Transaction amount |
balance_after | float | Balance after transaction |
description | string | Transaction description |
reference | string | External reference (payment ID, etc.) |
metadata | object | Additional metadata |
created_at | datetime | Transaction timestamp |
AccountSummary Object
| Field | Type | Description |
|---|---|---|
user_id | integer | User ID |
email | string | User email |
credit_balance | CreditBalance | Current credit balance |
subscription | Subscription | Active subscription details |
usage_this_month | UsageStats | Current month usage |
total_requests_all_time | integer | Total lifetime requests |
account_created_at | datetime | Account creation time |
last_login_at | datetime | Last login time |