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
- CLI
- MCP
curl -H "Authorization: Bearer $TESTVIBE_API_KEY" \
"$TESTVIBE_SERVER/api/v1/ops/credits"
testvibe credits
Tool get_credits — no arguments.
Response
{
"planCode": "team",
"planName": "Team",
"remaining": 67000,
"monthlyCredits": 16000,
"monthlyRemaining": 12000,
"monthlyUsed": 4000,
"purchased": 55000,
"usedPercent": 25
}
| Field | Meaning |
|---|---|
remaining | Spendable total — monthlyRemaining + purchased. The number the gates allow on. |
monthlyCredits | This month's plan allowance (the included grant for planCode). |
monthlyRemaining | What's left of the monthly allowance this effective billing cycle. Use-it-or-lose-it — it does not carry over. |
monthlyUsed | Monthly allowance consumed this cycle (monthlyCredits − monthlyRemaining). |
purchased | The never-expiring purchased balance (credit packs). Spent only after the monthly allowance runs out. |
usedPercent | monthlyUsed as a percentage of monthlyCredits. |
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.