API Endpoints
User Management
The User Management resource group allows you to manage and query information related to the authenticated user account, including unified 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, the current unified credit balance, and subscription information.
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 | Integer | Deprecated compatibility field for the web-task available balance. In the unified credit model this equals total_usable_credits. |
api_credits_balance | Integer | Deprecated compatibility field for the API-task available balance. In the unified credit model this equals total_usable_credits. |
total_usable_credits | Integer | Current unified credit balance available for web and API tasks. |
permanent_usable_credits | Integer | Portion of total_usable_credits that does not expire. |
total_frozen_credits | Integer | Credits currently frozen for ongoing tasks. Frozen credits are not included in total_usable_credits. |
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 credit status for API tasks. 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 | Deprecated compatibility field for API-task available balance. In the unified credit model this equals total_usable_credits. |
frozen | Float | Deprecated compatibility field for API-task frozen balance. In the unified credit model this equals total_frozen_credits. |
total_usable_credits | Float | Current unified credit balance available for web and API tasks. |
permanent_usable_credits | Float | Portion of total_usable_credits that does not expire. |
total_frozen_credits | Float | Credits currently frozen for ongoing tasks. Frozen credits are not included in total_usable_credits. |
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())