User Management
The User Management resource group allows you to manage and query information related to the authenticated user account, including credit balances and subscription details.
Get Current User Info
Retrieves detailed information about the user associated with the provided API key. This includes account identifiers, email, and current credit balances across different platforms.
Endpoint
GET /users/me
Authentication
Required (Bearer Token)
Response
Returns a StandardResponse containing a UserInfo object.
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier for the user. |
email | String | User's email address. |
web_credits_balance | Float | Credit balance available for the web platform. |
api_credits_balance | Float | Available API credit balance (Total - Frozen). |
plan_name | String | Null | Name of the active subscription plan, or null if none. |
Example Request
cURL
curl -X 'GET' \
'https://api.triverse.ai/api/v1/users/me' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <YOUR_API_KEY>'Get Credit Balance
Queries the current user's API credit status, specifically distinguishing between available and frozen credits. Credits are frozen when a task is initiated and officially deducted upon successful completion.
Endpoint
GET /users/balance
Authentication
Required (Bearer Token)
Response
Returns a StandardResponse containing a UserBalance object.
| Field | Type | Description |
|---|---|---|
balance | Float | Available balance for new tasks (Total - Frozen). |
frozen | Float | Credits currently frozen for ongoing tasks. |
Example Request
JavaScript
const response = await fetch("https://api.triverse.ai/api/v1/users/balance", {
method: "GET",
headers: {
Accept: "application/json",
Authorization: "Bearer <YOUR_API_KEY>",
},
});
const data = await response.json();
console.log(data);Python
import requests
response = requests.get(
"https://api.triverse.ai/api/v1/users/balance",
headers={
"Accept": "application/json",
"Authorization": "Bearer <YOUR_API_KEY>",
},
)
print(response.json())