Budgets & Spending Caps
Manage your videos, ask questions, and build applications with the Platform API. Explore the operations below for request details, responses, and examples.
No matching documentation. Try a different search.
Budgets & Spending Caps
Set monthly spending caps for your account and for each project. A cap pauses work — it never bills past it. Amounts ending in _atomic_at are in thousandths of a token: divide by 1,000 to display tokens. The examples show selected response fields.
GET/api/v1/projects/:projectId/budgetGet a project's budget status
Get a project's budget status
Caps, spend this month and the current mode, taking both the account cap and the project cap into account — the stricter one wins.
normal — spending is within the cap
base — less than base_mode_pct (default 10%) of the cap is left. Alerts keep working; queued scans and other background work wait until the cap is raised or the month rolls over.
stopped — the cap is reached. No new billable work starts; nothing is deleted, and raising the cap resumes work straight away.
Optional query param: fresh=true to skip the 15-second cache.
{
"data": {
"project_id": "PROJECT_ID",
"period": "2026-10",
"mode": "normal",
"limiting_scope": null,
"base_mode_pct": 10,
"account": {
"cap_atomic_at": 200000000,
"spend_atomic_at": 48200000,
"remaining_atomic_at": 151800000,
"used_pct": 24.1,
"mode": "normal"
},
"project": {
"cap_atomic_at": 50000000,
"spend_atomic_at": 12500000,
"remaining_atomic_at": 37500000,
"used_pct": 25,
"mode": "normal"
}
}
}project is null when the project has no cap of its own; limiting_scope names the cap (account or project) that set the mode.
PUT/api/v1/projects/:projectId/budgetSet a project's monthly cap
Set a project's monthly cap
Needs a write role. Send only what you want to change; monthly_cap_atomic_at: null removes the project cap. Returns the updated status.
{
"monthly_cap_atomic_at": 50000000,
"base_mode_enabled": true,
"base_mode_pct": 10
}# Cap this project at 50,000 tokens a month
curl -X PUT https://platform.endlessai.com/api/v1/projects/PROJECT_ID/budget \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "monthly_cap_atomic_at": 50000000 }'
# Check where the project stands
curl -s "https://platform.endlessai.com/api/v1/projects/PROJECT_ID/budget" \
-H "X-Api-Key: YOUR_KEY" | jq '.data.mode'import requests
headers = {"X-Api-Key": API_KEY}
requests.put(
f"{BASE}/projects/{PROJECT_ID}/budget",
headers=headers,
json={"monthly_cap_atomic_at": 50_000_000}, # 50,000 tokens
)
status = requests.get(
f"{BASE}/projects/{PROJECT_ID}/budget", headers=headers
).json()["data"]
project = status["project"]
print(status["mode"], project["spend_atomic_at"] / 1000, "tokens used")await fetch(`${BASE}/projects/${PROJECT_ID}/budget`, {
method: "PUT",
headers: { "X-Api-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ monthly_cap_atomic_at: 50000000 }) // 50,000 tokens
});
const res = await fetch(`${BASE}/projects/${PROJECT_ID}/budget`, {
headers: { "X-Api-Key": API_KEY }
});
const { data } = await res.json();
console.log(data.mode);GET/api/v1/budget/accountGet the account budget
Get the account budget
Org admin, with a user token. The account cap, spend this month, and auto-reload settings for your active organization.
{
"data": {
"account_id": "ORG_ID",
"period": "2026-10",
"monthly_cap_atomic_at": 200000000,
"spend_this_period_atomic_at": 48200000,
"base_mode_enabled": true,
"base_mode_pct": 10,
"auto_reload": {
"enabled": true,
"threshold_atomic_at": 10000000,
"amount_atomic_at": 25000000,
"ceiling_atomic_at": 100000000,
"max_per_period": 3,
"used_this_period": 1,
"used_amount_atomic_at": 25000000,
"has_payment_method": true
},
"payment_method": { "saved": true, "label": "visa •••• 4242", "known": true }
}
}spend_this_period_atomic_at is null when spend could not be read — not zero. payment_method.known: false means the saved card could not be checked right now.
PUT/api/v1/budget/accountUpdate the account budget
Update the account budget
Org admin, with a user token. Send only what you want to change; monthly_cap_atomic_at: null removes the account cap.
{
"monthly_cap_atomic_at": 200000000,
"base_mode_pct": 10,
"auto_reload": {
"enabled": true,
"threshold_atomic_at": 10000000,
"amount_atomic_at": 25000000,
"ceiling_atomic_at": 100000000
}
}Auto-reload tops up your balance from your saved card when it drops below threshold_atomic_at. The reload amount must be at least the threshold, and the monthly ceiling at least one reload amount — otherwise 400.
GET/api/v1/budget/account/reloadsList auto-reload history
List auto-reload history
Org admin. Newest first, every attempt including failed and skipped ones. Query param: limit (default 12).
{
"data": {
"reloads": [
{
"id": "RELOAD_ID",
"period": "2026-10",
"amount_atomic_at": 25000000,
"status": "succeeded",
"error": null,
"created_at": "2026-10-06T03:10:00.000Z"
}
]
}
}