Limits
Limits are set per key. Today the enforced limit is the monthly spend cap; there are no published per-minute request limits. If you expect heavy or bursty traffic, tell us at api@failure.fail first so we can plan for it. Teams can ask for higher caps; see enterprise.
Monthly spend caps
Set a cap on each key in the Console. Spend counts the tokens you send and receive at that model's rates — including reasoning tokens: the brief, drafts and audit that stream as reasoning_content. Token counts are estimated at roughly four characters per token.
When a key's spend reaches its cap, every billed request returns 402 until the 1st of the next month (UTC):
{ "error": { "message": "Monthly spend cap reached for this key.", "type": "insufficient_quota" } }
Raise the cap in the console to resume straight away.
Reading usage
GET /v1/usage returns the calling key's spend this month, its cap, what remains, and a per-model breakdown.
curl https://api.failure.fail/v1/usage \
-H "Authorization: Bearer $FAILURE_API_KEY"
import os, httpx
r = httpx.get(
"https://api.failure.fail/v1/usage",
headers={"Authorization": f"Bearer {os.environ['FAILURE_API_KEY']}"},
)
r.raise_for_status()
print(r.json())
Illustrative shape:
{
"month": "2026-11",
"spend_usd": 12.40,
"cap_usd": 50,
"remaining_usd": 37.60,
"models": {
"failure-tempest-1": { "spend_usd": 10.10 },
"failure-tempest-1-flash": { "spend_usd": 2.30 }
}
}
Guarding a budget in code
Check remaining spend before a large batch, and stop cleanly on a 402.
const res = await fetch("https://api.failure.fail/v1/usage", {
headers: { Authorization: `Bearer ${process.env.FAILURE_API_KEY}` },
});
const usage = await res.json();
console.log(usage); // month spend, cap, remaining, per-model breakdown
Per-request cost
Every response's usage.cost and tempest.billed_usd give the USD cost of that request, so you can meter your own users without calling /v1/usage.