Mitosis Labs

SDK

Credits and usage

Balance, history, per-agent usage, and quotas.

Offices run on credits. Compute and LLM usage are metered and deducted; at zero balance, agents are suspended until the office is topped up.

Balance and history

const balance = await client.credits.balance(officeId);
const history = await client.credits.history(officeId, { limit: 50 });
MethodSignature
balancebalance(officeId)
addadd(officeId, req)
historyhistory(officeId, { limit, offset })

Usage

const summary = await client.credits.usageSummary(officeId);
const current = await client.credits.usageCurrent(officeId);
const llm     = await client.credits.llmUsageSummary(officeId);
const perAgent = await client.credits.agentUsage(officeId, 'scout');
MethodReturns
usageRaw resource usage
usageCurrentUsage in the current period
usageSummaryAggregated summary
llmUsage / llmUsageSummaryModel-call usage
agentUsageUsage for one agent by name

Quotas

Cap spend before it happens rather than reconciling after:

await client.credits.setQuota(officeId, { monthlyCredits: 200 });
const quota = await client.credits.quota(officeId);