Skip to main content

get_credits

The workspace's current credit position: the spendable total, this billing cycle'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": "team",
"planName": "Team",
"remaining": 67000,
"monthlyCredits": 16000,
"monthlyRemaining": 12000,
"monthlyUsed": 4000,
"purchased": 55000,
"usedPercent": 25
}
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 effective billing cycle. 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​

Subject to the shared authentication, plan, rate, and availability errors. A valid key alone does not bypass plan admission.

Amounts in examples are illustrative, not a plan price or allowance promise. The effective cycle starts on the calendar boundary by default or the configured billing anniversary when enabled. Read the current balance and allowance from the API.