Account and organization | Uthana API Docs

On this page

Get information about your user account, organization, and subscription details.

User information

Retrieve information about the currently authenticated user:

curl -X POST https://uthana.com/graphql \
  -u $API_KEY: \
  -H "Content-Type: application/json" \
  -d '{\n    "query": "{ user { id email email_verified name roles tz tos_accepted survey_completed } }"\n  }'
import asyncio
from uthana import Uthana

client = Uthana("your-api-key")

async def main():
    user = await client.org.get_user()
    print(user.get("id"), user.get("name"), user.get("email"))

asyncio.run(main())
import { UthanaClient } from "@uthana/client";

const client = new UthanaClient(process.env.UTHANA_API_KEY!);

const user = await client.org.getUser();
console.log(user.id, user.name, user.email);
import { useUthanaUser } from "@uthana/react";

function UserInfo() {
  const { user } = useUthanaUser();
  if (!user) return <p>Loading...</p>;
  return (
    <div>
      <p>{user.name} ({user.email})</p>
    </div>
  );
}
private const string ApiUrl = "https://uthana.com/graphql";
private readonly string _apiKey = "your-api-key";

public async Task<User> GetUserAsync()
{
    var query = @"
        query {
            user {
                id
                email
                email_verified
                name
                roles
                tz
                tos_accepted
                survey_completed
            }
        }";

var request = new { query = query };
    var json = JsonSerializer.Serialize(request);
    var content = new StringContent(json, Encoding.UTF8, "application/json");

var authValue = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{_apiKey}:"));
    _httpClient.DefaultRequestHeaders.Authorization =
        new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", authValue);

var response = await _httpClient.PostAsync(ApiUrl, content);
    response.EnsureSuccessStatusCode();

var responseJson = await response.Content.ReadAsStringAsync();
    var result = JsonSerializer.Deserialize<GraphQLResponse<UserData>>(responseJson);

return result.Data.User;
}

// Usage
var user = await GetUserAsync();
Console.WriteLine($"User: {user.Name} ({user.Email})");
Console.WriteLine($"Email verified: {user.EmailVerified}");
Console.WriteLine($"Roles: {string.Join(", ", user.Roles)}");

Organization information

Get information about your organization, including download allowances and character limits:

curl -X POST https://uthana.com/graphql \
  -u $API_KEY: \
  -H "Content-Type: application/json" \
  -d '{\n    "query": "{ org { id name motion_download_secs_per_month motion_download_secs_per_month_remaining characters_allowed characters_allowed_remaining users { id name email } } }"\n  }'
async def main():
    org = await client.org.get_org()
    print(org.get("name"))
    print(org.get("motion_download_secs_per_month_remaining"), "seconds remaining")

asyncio.run(main())
const org = await client.org.getOrg();
console.log(org.name);
console.log(`${org.motion_download_secs_per_month_remaining} seconds remaining`);
import { useUthanaOrg } from "@uthana/react";

function OrgInfo() {
  const { org } = useUthanaOrg();
  if (!org) return <p>Loading...</p>;
  return (
    <div>
      <p>{org.name}</p>
      <p>{org.motion_download_secs_per_month_remaining} seconds remaining this month</p>
      <p>
        Characters: {org.characters_allowed_remaining} of {org.characters_allowed} remaining
      </p>
    </div>
  );
}
public async Task<Org> GetOrgAsync()
{
    var query = @"
        query {
            org {
                id
                name
                motion_download_secs_per_month
                motion_download_secs_per_month_remaining
                characters_allowed
                characters_allowed_remaining
                users {
                    id
                    name
                    email
                }
            }
        }";

var request = new { query = query };
    var json = JsonSerializer.Serialize(request);
    var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await _httpClient.PostAsync(ApiUrl, content);
    response.EnsureSuccessStatusCode();

var responseJson = await response.Content.ReadAsStringAsync();
    var result = JsonSerializer.Deserialize<GraphQLResponse<OrgData>>(responseJson);

return result.Data.Org;
}

// Usage
var org = await GetOrgAsync();
Console.WriteLine($"Organization: {org.Name}");
Console.WriteLine($"Download allowance: {org.MotionDownloadSecsPerMonth} seconds/month");
Console.WriteLine($"Remaining: {org.MotionDownloadSecsPerMonthRemaining} seconds");
Console.WriteLine($"Characters: {org.CharactersAllowedRemaining} of {org.CharactersAllowed} remaining");
Console.WriteLine($"Users: {org.Users.Count}");

Subscription information

Subscription and billing details are managed through the Uthana web interface. For API access to plan limits and usage, see the Pricing and Rate limits pages.

Tracking usage via API

You can query your organization's usage and limits through the API to monitor your balance and set up alerts when approaching limits.

Motion seconds (download allowance)

The org query returns motion download usage directly:

motion_download_secs_per_month_remaining updates as you download motions. Use it to check how much of your monthly allowance is left before hitting limits.

Characters (rigs)

The org query returns character usage for the current month:

characters_allowed_remaining updates as you create (upload, generate, or rig) characters. Use it to check how many character creation slots you have left before hitting limits.

Example query for usage monitoring:

curl -X POST https://uthana.com/graphql \
  -u $API_KEY: \
  -H "Content-Type: application/json" \
  -d '{\n    "query": "{ org { id name motion_download_secs_per_month motion_download_secs_per_month_remaining characters_allowed characters_allowed_remaining } }"\n  }'
async def main():
    org = await client.org.get_org()
    print(
        f"Motion seconds: {org.get('motion_download_secs_per_month_remaining')} of "
        f"{org.get('motion_download_secs_per_month')} remaining"
    )
    print(
        f"Characters: {org.get('characters_allowed_remaining')} of "
        f"{org.get('characters_allowed')} remaining"
    )

asyncio.run(main())
const org = await client.org.getOrg();
console.log(
  `Motion seconds: ${org.motion_download_secs_per_month_remaining} of ${org.motion_download_secs_per_month} remaining`,
);
console.log(`Characters: ${org.characters_allowed_remaining} of ${org.characters_allowed} remaining`);
function UsageSummary() {
  const { org } = useUthanaOrg();
  if (!org) return null;
  return (
    <div>
      <p>
        Motion seconds: {org.motion_download_secs_per_month_remaining} / {org.motion_download_secs_per_month}
      </p>
      <p>
        Characters: {org.characters_allowed_remaining} / {org.characters_allowed}
      </p>
    </div>
  );
}
var query = @"
    query {
        org {
            id
            name
            motion_download_secs_per_month
            motion_download_secs_per_month_remaining
            characters_allowed
            characters_allowed_remaining
        }
    }";

var request = new { query = query };
var json = JsonSerializer.Serialize(request);
var content = new StringContent(json, Encoding.UTF8, "application/json");

var response = await _httpClient.PostAsync(ApiUrl, content);
response.EnsureSuccessStatusCode();

var responseJson = await response.Content.ReadAsStringAsync();
var result = JsonSerializer.Deserialize<GraphQLResponse<OrgData>>(responseJson);
var org = result.Data.Org;

Console.WriteLine($"Motion seconds: {org.MotionDownloadSecsPerMonthRemaining} of {org.MotionDownloadSecsPerMonth} remaining");
Console.WriteLine($"Characters: {org.CharactersAllowedRemaining} of {org.CharactersAllowed} remaining");

Next steps