Skip to main content
These methods are read-mostly account helpers. They use the same YoukaClient authentication and per-request options as project and export calls.

client.account.get(options?)

Fetch the account identity for the active API key.
const account = await client.account.get();
console.log(account.email, account.userId, account.apiKeyId);
Use this to validate a key at startup or show which account an automation is using.

client.credits.overview(options?)

Fetch available balance, renewal dates, top-ups, and subscription renewal metadata.
const credits = await client.credits.overview();

if (!credits.availableBalance) {
  console.log("No credits available");
}

client.billing.getCatalog(options?)

Fetch subscription and top-up pricing for the authenticated account.
const catalog = await client.billing.getCatalog();
console.log(
  catalog.unitCredits,
  catalog.subscription.monthly.unitPriceFormatted,
);
The catalog also reports top-up eligibility and whether the account already has an active subscription.

client.billing.createCheckout(body, options?)

Create a Stripe checkout URL.
const checkout = await client.billing.createCheckout({
  productType: "subscription",
  cycle: "monthly",
  quantity: 1,
});

console.log(checkout.url);
For top-ups, pass productType: "topup" and a positive quantity. The SDK defaults platform to "sdk" unless you override it.

client.billing.getManageUrl(input?, options?)

Create a billing portal URL.
const portal = await client.billing.getManageUrl();
console.log(portal.url);
The URL is short-lived and should be opened by the user who owns the account.

What’s next

  • Projects - quote and create projects
  • Exports - quote and render exports
  • Errors - handle authentication and billing errors