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 });
| Method | Signature |
|---|---|
balance | balance(officeId) |
add | add(officeId, req) |
history | history(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');
| Method | Returns |
|---|---|
usage | Raw resource usage |
usageCurrent | Usage in the current period |
usageSummary | Aggregated summary |
llmUsage / llmUsageSummary | Model-call usage |
agentUsage | Usage 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);