spend_cap_reached
Past the plan's monthly quota and this month's spend beyond it has reached the account's own monthly spend cap. Raise or remove the cap in Dashboard → Billing, or wait for the month to reset.
When it fires
Your account set a monthly spend cap: a hard limit on what it spends each month on requests beyond the plan's quota (billed from credits at $1 per 1,000). This month's spend has reached it, so requests past the quota are refused instead of billed.
Requests within your plan's quota are not affected. Usage and billing endpoints, Connect, and webhook deliveries are never blocked by the cap. Nothing about your data, listings or connections changes.
Response shape
Every Repull error follows the same envelope. The code is stable and safe to switch on.
{
"error": {
"code": "spend_cap_reached",
"message": "<human-readable explanation of what went wrong>",
"docs_url": "https://repull.dev/docs/errors/spend_cap_reached"
}
}How to fix
- Raise or remove the cap in Dashboard → Billing (https://repull.dev/dashboard/billing). Owners and admins of the account can change it. Requests resume within a minute.
- Or set it from code: `PUT /v1/usage/spend-cap` with `{"monthlyCapUsd": 100}`, or `{"monthlyCapUsd": null}` to remove it. This call always works, even with the cap reached.
- Or wait: the cap applies per calendar month (UTC), and requests resume when the month resets at `resets_at`.
- If you regularly spend near the cap, an upgrade may cost less: Starter includes 100,000 requests a month.
Common gotchas
- Waiting a minute does not help. This is a 402 with no
Retry-After: the answer only changes when the cap is raised or removed, or the month resets. - The cap belongs to the account and covers all its sub-workspaces, like the quota itself.
- The account owner is emailed at 80% and at 100% of the cap, once each per month.
GET /v1/usage/summaryreportsspendCap(monthlyCapUsd,spentUsd,remainingUsd,reached) at any time. - Different from credits_exhausted, where the credits ran out: here you still have credit, and your own cap stopped the spend.
Examples
curl
# Past the quota with the month's spend at the cap
curl -i https://api.repull.dev/v1/reservations \
-H "Authorization: Bearer $REPULL_API_KEY"
# HTTP/2 402
# {"error":{"code":"spend_cap_reached","spend_cap_usd":50,"spent_usd":50,
# "limit":100000,"used":150000,"resets_at":"2027-01-01T00:00:00.000Z",...}}
# Raise the cap to $100 (never blocked by the cap)
curl -X PUT https://api.repull.dev/v1/usage/spend-cap \
-H "Authorization: Bearer $REPULL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"monthlyCapUsd": 100}'
# { "monthlyCapUsd": 100, "spentUsd": 50, "remainingUsd": 50, "reached": false, ... }TypeScript
const res = await fetch('https://api.repull.dev/v1/reservations', {
headers: { Authorization: `Bearer ${process.env.REPULL_API_KEY}` },
})
if (res.status === 402) {
const { error } = await res.json()
if (error.code === 'spend_cap_reached') {
// Retrying will not help until the cap is raised or the month resets.
console.error(`Repull spend cap reached: $${error.spent_usd} of $${error.spend_cap_usd}. Resets ${error.resets_at}.`)
return
}
}
// Watch the cap before it is reached.
const summary = await fetch('https://api.repull.dev/v1/usage/summary', {
headers: { Authorization: `Bearer ${process.env.REPULL_API_KEY}` },
}).then((r) => r.json())
const { monthlyCapUsd, spentUsd } = summary.spendCap
if (monthlyCapUsd != null && spentUsd >= monthlyCapUsd * 0.8) console.warn('Repull spend cap at 80%')If you're an AI agent
The account's own monthly spend cap is reached: requests beyond the plan's quota are refused until the cap is raised or removed, or the month (UTC) resets at resets_at. Do NOT retry on a timer. Ask the human whether to raise or remove the cap (Dashboard → Billing, or PUT /v1/usage/spend-cap with {monthlyCapUsd}); never raise it without their say. Requests within the quota, usage/billing endpoints, Connect and webhook deliveries keep working.
Related
- Error reference — the full table of error codes
- Using Repull from AI agents — patterns for handling errors in agent loops
- Rate limits
- Credits and usage
Hit an error that isn't covered? Email hello@repull.dev with the request id from the response headers.