> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wardin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Team Budgets

> Set spending limits per developer, per team, and org-wide.

Wardin's budget model gives managers full control over AI spend at every granularity — per key, per user, and org-wide — enforced atomically before any token is spent.

## Budget hierarchy

```mermaid theme={null}
flowchart TD
    A[Tenant budget\norg ceiling] --> B[User budget\nper-person ceiling across all their keys]
    A --> C[Key budget\nmost common · per virtual key]
    B --> C
```

All three are checked independently. A request is blocked if **any** limit is exceeded.

## Step 1: Set up team keys

Create one key per developer or team role:

```bash theme={null}
# Engineering team — individual keys
for name in alice bob carol; do
  curl -X POST https://api.wardin.ai/v1/keys \
    -H "Authorization: Bearer wardin_sk_ADMIN_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"name\": \"$name-dev\", \"monthlyBudgetUsd\": 100}"
done

# Shared CI key
curl -X POST https://api.wardin.ai/v1/keys \
  -H "Authorization: Bearer wardin_sk_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "engineering-ci", "monthlyBudgetUsd": 300, "rpmLimit": 20}'
```

## Step 2: Configure alerts

Set a webhook alert so you're notified before budgets run out:

**Console → Webhooks → Add endpoint**

```json theme={null}
{
  "url": "https://hooks.slack.com/...",
  "events": ["budget.threshold_reached"],
  "thresholdPercent": 80
}
```

## Step 3: Distribute keys

Send each developer their `wardin_sk_` key. They set it as `ANTHROPIC_AUTH_TOKEN` (and `ANTHROPIC_BASE_URL=https://gw.wardin.ai`) in their environment. No other changes to their workflow.

## Budget increase requests

Developers can request a budget increase from **MY LANE** in the dashboard. Requests land in **LEDGER**, where you can approve, deny, or set an expiry date for temporary increases.

* **Approved with expiry**: The limit is elevated immediately and automatically reverts at the expiry date.
* **Approved permanent**: The limit is raised and stays until you change it.
* **Revoked**: You can revoke an approved increase at any time before expiry.

The full request history is retained as an audit trail.

## Viewing spend

**Overview** shows org-wide spend and allocation; **LEDGER** breaks it down by team and developer. Each developer sees their own sessions with per-session cost under **MY LANE**.

To pull spend data programmatically:

```bash theme={null}
curl "https://api.wardin.ai/v1/analytics/usage?period=2025-01" \
  -H "Authorization: Bearer wardin_sk_ADMIN_KEY"
```

## Recommended budget levels

| Role                                 | Suggested monthly budget |
| ------------------------------------ | ------------------------ |
| Individual contributor (interactive) | $50–$150                 |
| Senior / staff (heavy AI usage)      | $150–$300                |
| CI / automation                      | $200–$500                |
| Tenant ceiling                       | Sum of key budgets × 1.2 |

Start conservative — developers can request increases self-serve, and approvals apply instantly.
