Budget Cap Exceeded

budget-cap-exceeded · 402

The new service's monthly price would push the project's spend this month past its budget cap, so the API created nothing.

Only a new service with a fixed monthly price is checked: projectedSpendJod is currentSpendJod plus estimatedMonthlyJod. Services that already run are never stopped by the cap. The amounts are strings in currency, with that currency's decimals: three for JOD, two for SAR.

Besides the members every error carries, this type adds projectId, currency, currentSpendJod, estimatedMonthlyJod, projectedSpendJod and budgetCapJod.

Common causes

  • The project's spend so far, plus the new service's monthly price, is above the cap set with --budget-cap.
  • The size asked for costs more than the cap leaves room for.

How to fix the call

  • Ask the user before raising the cap with ghaym cloud projects update <project> --budget-cap <amount>, or removing it with --budget-cap none.
  • Or launch a smaller size.
  • Check the project's spend first with ghaym cloud billing spend <project>.

Example response

json
{
  "type": "budget-cap-exceeded",
  "title": "Budget Cap Exceeded",
  "detail": "This would bring the project's projected monthly spend to 54.500 JOD, past its 50.000 JOD budget cap. Raise the cap with PATCH /v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401, or choose a smaller resource.",
  "projectId": "0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401",
  "currency": "JOD",
  "currentSpendJod": "42.500",
  "estimatedMonthlyJod": "12.000",
  "projectedSpendJod": "54.500",
  "budgetCapJod": "50.000",
  "requestId": "req-1785231000000-4f7b2c9ae",
  "timestamp": "2026-07-28T09:30:00.000Z",
  "path": "/v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
  "method": "POST",
  "instance": "POST /v1/projects/0199e0a3-6f21-7c4a-9d18-2b7c5f3ad401/services",
  "status": 402,
  "docs": "https://ghaym.me/docs/errors/budget-cap-exceeded"
}