skopik

Usage

Usage helps you understand activity and cost across a workspace. The usage route has no dedicated SDK method; read it through client.http, the SDK's escape hatch, which sends requests with the client's auth and base URL and converts response fields to camelCase.

Quick Links

Action Description
http.get('/orgs/{orgId}/usage') Summarize workspace usage.

Reference

http.get('/orgs/{orgId}/usage')

Summarize workspace usage. Pass start_at and end_at (millisecond timestamps) to bound the window, and kind to filter to a single usage kind — for example ?kind=model for model spend only.

const { usage } = await client.http.get<{ usage: UsageSummary }>(
	`/orgs/${orgId}/usage?start_at=1767225600000&end_at=1769817600000`,
)

Query parameters

Param Type Required Notes
start_at number No Window start timestamp in milliseconds.
end_at number No Window end timestamp in milliseconds.
kind string No model, tool, embedding, search, or email.

Returns { usage: UsageSummary } — see UsageSummary.

Types

UsageSummary

Field Type Notes
target string Summary target, usually the workspace id.
startAt number Window start timestamp in milliseconds.
endAt number Window end timestamp in milliseconds.
totalCostUsd number Total customer cost in USD.
inputTokens number Input tokens.
outputTokens number Output tokens.
toolCalls number Tool calls.
searchCalls number Search calls.
embeddingCalls number Embedding calls.
emailSends number Email sends.
emailRecipients number Email recipient count.
customerCostMicros number Customer cost in microdollars.
providerCostMicros number Provider cost in microdollars.