Nurama Developers
Namespaces

credits

Methods and types of the `credits` namespace (`client.credits` / `bot.credits`).

Interfaces

GetBalanceResponse

Properties

PropertyTypeDescription
balancenumberTotal spendable balance — sum of planBalance + purchasedBalance.
hasPriorTopUp?booleanTrue when the workspace has at least one prior manual top-up (a subscriptionGrant order). Auto top-up can only be enabled once this is true — users must top up manually once first.
planBalancenumberPlan-granted credits for the current billing cycle. Refreshed (SET, not added) on every Stripe renewal. Unspent plan credits do NOT carry over.
purchasedBalancenumberPurchased credits — accumulated from one-off top-ups, auto-top-ups, admin grants. Carries over indefinitely.

UsageReportIntegrationRow

Properties

PropertyType
billedCreditsnumber
callCountnumber
integrationPointstring

UsageReportParams

Properties

PropertyTypeDescription
endDate?stringISO date string. Server defaults to "now" when omitted.
integrationPoint?stringNarrow the per-user breakdown to a single integration point.
startDate?stringISO date string. Server defaults to 30 days ago when omitted.
userId?stringNarrow the per-integration breakdown to a single user's calls.

UsageReportResponse

Properties

PropertyType
byIntegrationUsageReportIntegrationRow[]
byUserUsageReportUserRow[]
filters{ endDate: string; integrationPoint: string | null; startDate: string; userId: string | null; }
filters.endDatestring
filters.integrationPointstring | null
filters.startDatestring
filters.userIdstring | null
total{ billedCredits: number; callCount: number; tokensIn: number; tokensOut: number; }
total.billedCreditsnumber
total.callCountnumber
total.tokensInnumber
total.tokensOutnumber

UsageReportUserRow

Properties

PropertyType
avatarunknown
billedCreditsnumber
callCountnumber
colorstring | null
displayNamestring | null
userIdstring

Functions

default()

function default(client): {
  getBalance: Promise<GetBalanceResponse>;
  getUsageReport: Promise<UsageReportResponse>;
};

Service-agnostic Nurama Credit balance + usage endpoints.

The /v1/credits/* route shape and SDK namespace are deliberately decoupled from any single service's naming so future services (convos, etc.) can draw from the same balance without callers having to know where the spend originated. Today the metered data is AI-only because AI is the only service that's metered, but the contract is stable.

Parameters

ParameterType
clientdefault

Returns

NameTypeDescription
getBalance()(workspaceId) => Promise<GetBalanceResponse>Get the workspace's spendable credit balance.
getUsageReport()(workspaceId, params?) => Promise<UsageReportResponse>Get the workspace's credit usage report. Same shape as the AI usage report — today the data is AI-only because AI is the only service that's metered.

On this page