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
- CLI
- MCP
curl -H "Authorization: Bearer $TESTVIBE_API_KEY" \
"$TESTVIBE_SERVER/api/v1/ops/credits"
testvibe credits
Tool get_credits — no arguments.
Response
{
"planCode": "free",
"planName": "Free",
"remaining": 56500,
"monthlyCredits": 1500,
"monthlyRemaining": 1500,
"monthlyUsed": 0,
"purchased": 55000,
"usedPercent": 0
}
| 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 UTC calendar month. 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. |
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.