AI credits
AI & MCPAI credits
Meter AI usage against a monthly cap.
Each AI generation consumes a credit; when the balance runs out, generation is blocked until the next month. Usage starts again at zero on the first of each month (UTC). Check the balance or consume programmatically:
bash
GET /v3/ai-credits → { used, limit, remaining }
POST /v3/ai-credits/consume { "amount": 1 } → 200, or 429 when exhaustedEvery workspace starts with a monthly cap of 1,000 credits. See also plans & entitlements.
Settings & webhooks#
bash
GET /v3/ai-credits/settings → { monthly_limit, alert_threshold, webhook_secret }
PUT /v3/ai-credits/settings { "monthly_limit": 5000, "alert_threshold": 0.5 }
POST /v3/ai-credits/settings/rotate-secret → { webhook_secret }How consume behaves
amountis optional and defaults to 1. A value below 1 counts as 1.- A request that would go over the limit is refused as a whole: the API returns
429withallowed: falseand deducts nothing, even when a few credits are left. Checkremainingfirst when you consume several at once. - Both responses carry
allowed,used,limitandremaining.
bash
POST /v3/ai-credits/consume { "amount": 5 }
→ 429 { "allowed": false, "used": 998, "limit": 1000, "remaining": 2 }Settings rules
- Every route needs a secret server key (
sk_live_…); any other token gets401. - Until you change them,
monthly_limitis 1000 andalert_thresholdis 0.8. monthly_limitmust be above 0. A 0 is ignored and the old limit stays; decimals are rounded down.alert_thresholdis a fraction, kept between 0 and 1.- The webhook secret starts with
aiwh_. Rotating it replaces the old secret at once.