Documentation Index
Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt
Use this file to discover all available pages before exploring further.
Inspect and update your org’s spend cap, credit alert thresholds, and Opus model access. Both endpoints require the control:read scope.
Get budget settings
GET https://api.usehasp.com/v1/usage/budget
Authorization: Bearer wa_live_...
Response
{
"success": true,
"data": {
"spend_cap": 50000,
"alert_thresholds": [75, 90],
"credits_allotment": 100000,
"opus_enabled": false
}
}
Fields
| Field | Description |
|---|
spend_cap | Credit cap for this billing cycle. Requests return 402 AI_CREDITS_EXHAUSTED when credits used reaches this value. null means no cap (full allotment applies). |
alert_thresholds | Sorted list of percentage integers (1–99) at which usage notifications are sent. Empty array means no alerts configured. Max 3 thresholds. |
credits_allotment | Total credits available this cycle (read-only — set by your plan). |
opus_enabled | Whether the Opus model is enabled for this org. When false, requests using claude-opus-4-7 return 403 OPUS_NOT_ENABLED. |
Update budget settings
PUT https://api.usehasp.com/v1/usage/budget
Authorization: Bearer wa_live_...
Content-Type: application/json
All fields are optional. Send only what you want to change. An empty body returns the current state without modifying anything.
Body
{
"spend_cap": 50000,
"alert_thresholds": [75, 90],
"opus_enabled": false
}
| Field | Type | Description |
|---|
spend_cap | integer or null | Credit cap. Min 0. Set null to remove the cap. |
alert_thresholds | array or null | Percentage integers, each 1–99. Max 3 entries. Sorted automatically. Set [] or null to clear. |
opus_enabled | boolean | true to enable Opus model access; false to disable. |
Response
Returns the updated budget state in the same shape as the GET response.
{
"success": true,
"data": {
"spend_cap": 50000,
"alert_thresholds": [75, 90],
"credits_allotment": 100000,
"opus_enabled": false
}
}
Every successful update is recorded in the audit log with action: budget.updated.
Error codes
| Code | HTTP | Description |
|---|
INVALID_API_KEY | 401 | Invalid or revoked token |
MISSING_SCOPE | 403 | Key lacks control:read scope |
VALIDATION_FAILED | 422 | spend_cap is negative; threshold out of 1–99 range; more than 3 thresholds |