TRIVERSE Docs
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.

FieldTypeDescription
idUUIDUnique identifier for the user.
emailStringUser's email address.
web_credits_balanceIntegerDeprecated compatibility field for the web-task available balance. In the unified credit model this equals total_usable_credits.
api_credits_balanceIntegerDeprecated compatibility field for the API-task available balance. In the unified credit model this equals total_usable_credits.
total_usable_creditsIntegerCurrent unified credit balance available for web and API tasks.
permanent_usable_creditsIntegerPortion of total_usable_credits that does not expire.
total_frozen_creditsIntegerCredits currently frozen for ongoing tasks. Frozen credits are not included in total_usable_credits.
plan_nameString | NullName 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.

FieldTypeDescription
balanceFloatDeprecated compatibility field for API-task available balance. In the unified credit model this equals total_usable_credits.
frozenFloatDeprecated compatibility field for API-task frozen balance. In the unified credit model this equals total_frozen_credits.
total_usable_creditsFloatCurrent unified credit balance available for web and API tasks.
permanent_usable_creditsFloatPortion of total_usable_credits that does not expire.
total_frozen_creditsFloatCredits 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())

On this page