Namespaces
credits
Methods and types of the `credits` namespace (`client.credits` / `bot.credits`).
Interfaces
GetBalanceResponse
Properties
UsageReportIntegrationRow
Properties
UsageReportParams
Properties
UsageReportResponse
Properties
| Property | Type |
|---|---|
byIntegration | UsageReportIntegrationRow[] |
byUser | UsageReportUserRow[] |
filters | { endDate: string; integrationPoint: string | null; startDate: string; userId: string | null; } |
filters.endDate | string |
filters.integrationPoint | string | null |
filters.startDate | string |
filters.userId | string | null |
total | { billedCredits: number; callCount: number; tokensIn: number; tokensOut: number; } |
total.billedCredits | number |
total.callCount | number |
total.tokensIn | number |
total.tokensOut | number |
UsageReportUserRow
Properties
| Property | Type |
|---|---|
avatar | unknown |
billedCredits | number |
callCount | number |
color | string | null |
displayName | string | null |
userId | string |
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
| Parameter | Type |
|---|---|
client | default |
Returns
| Name | Type | Description |
|---|---|---|
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. |