Skip to main content

list_credit_usage

The workspace's credit consumption (usage debits): a per-activity rollup for the current UTC-month cycle — Generation, Test runs, Load testing, Assistant — each split into sandbox compute vs AI credits, plus the recent usage entries, newest first. This is the credits out counterpart of the (additions-only) list_billing_history.

Request

GET /api/v1/ops/credits/usage?limit=50

Workspace-scoped — it takes no project parameter.

ParameterInTypeRequiredDescription
limitqueryintegernoMax usage entries to return (default 50, max 200).
curl -H "Authorization: Bearer $TESTVIBE_API_KEY" \
"$TESTVIBE_SERVER/api/v1/ops/credits/usage?limit=20"

Response

{
"breakdown": [
{ "activity": "generation", "total": 4120, "compute": 3600, "ai": 520 },
{ "activity": "assistant", "total": 1340, "compute": 0, "ai": 1340 },
{ "activity": "run", "total": 880, "compute": 880, "ai": 0 }
],
"entries": [
{
"createdUtc": "2026-06-17T15:10:43Z",
"amount": -409,
"reason": "Generation compute (409s)",
"activity": "generation",
"category": "session"
},
{
"createdUtc": "2026-06-17T13:21:56Z",
"amount": -1340,
"reason": "AI usage",
"activity": "assistant",
"category": "ai_tokens"
}
]
}

breakdown totals cover the current cycle (this UTC calendar month); entries is a flat chronological list (newest first) of the underlying debits. Every amount in entries is negative. activity is the product area (generation / run / load / assistant); category is the cost driver (session = sandbox compute, ai_tokens = AI).

info

The breakdown totals sum to the same number get_credits reports as monthlyUsed + any purchased-pool spend this cycle. Usage draws monthly-first, then purchased.

Errors

Always returns the object (empty breakdown/entries when there's no usage). Authentication errors follow the standard conventions.