Skip to main content

get_credits

The workspace's current credit position: the spendable total, this UTC month's plan allowance and what's left of it (use-it-or-lose-it), and the never-expiring purchased balance — the same numbers the run, generation, and assistant credit gates spend against.

Request

GET /api/v1/ops/credits

Workspace-scoped — it takes no project parameter.

curl -H "Authorization: Bearer $TESTVIBE_API_KEY" \
"$TESTVIBE_SERVER/api/v1/ops/credits"

Response

{
"planCode": "free",
"planName": "Free",
"remaining": 56500,
"monthlyCredits": 1500,
"monthlyRemaining": 1500,
"monthlyUsed": 0,
"purchased": 55000,
"usedPercent": 0
}
FieldMeaning
remainingSpendable total — monthlyRemaining + purchased. The number the gates allow on.
monthlyCreditsThis month's plan allowance (the included grant for planCode).
monthlyRemainingWhat's left of the monthly allowance this UTC calendar month. Use-it-or-lose-it — it does not carry over.
monthlyUsedMonthly allowance consumed this cycle (monthlyCredits − monthlyRemaining).
purchasedThe never-expiring purchased balance (credit packs). Spent only after the monthly allowance runs out.
usedPercentmonthlyUsed as a percentage of monthlyCredits.
info

A credit is TestVibe's normalized unit of metered cost (AI tokens + sandbox compute). Debits draw monthly-first, then purchased.

See list_billing_history for the per-entry ledger behind these totals.

Errors

Beyond the standard authentication errors, this operation always returns for a valid key.