docs: periodic token budget reset & guardrail member budgets#78
Conversation
Add coverage for two new spending-control features: - Custom API Keys: periodic budget reset (balance_reset_period / balance_reset_amount), documented both in the dashboard (Spending Limit → Reset allowance / Resets) and via the API. - Guardrails: per-member budget caps (Member budget → Budget / Per), including how the cap behaves and how it resolves across member/role levels, plus a note that budgets are ignored on token-attached guardrails. - Users & Organisation: mention member spend caps in the guardrails summary.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe documentation adds periodic reset configuration for custom API key budgets and documents per-member budget caps within guardrails, including setup, enforcement, resolution, and usage rules. Related organization terminology and metadata timestamps are also updated. ChangesBudget controls documentation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@v3/general/custom-api-keys.mdx`:
- Around line 139-164: Replace the YOUR_API_KEY placeholder with <api_key> in
the Authorization headers of both the Python requests example and the cURL
example, preserving the documented Bearer header format.
In `@v3/organization/users-organisation.mdx`:
- Line 65: Update the guardrails description to clarify that token-level
resolution applies to model/provider access and rate limits, while budget caps
do not resolve at the token level and token-attached budget settings are
ignored. Preserve the existing token → member → role → organisation resolution
wording for the settings it supports, and reference the relevant budget-cap
limitation if available.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b4030c74-e5e2-4439-8237-aa433860c3d3
📒 Files selected for processing (3)
v3/general/custom-api-keys.mdxv3/organization/guardrails.mdxv3/organization/users-organisation.mdx
| headers = { | ||
| "Authorization": "Bearer YOUR_API_KEY", | ||
| "Content-Type": "application/json" | ||
| } | ||
|
|
||
| response = requests.post( | ||
| "https://api.edenai.run/v2/user/custom_token/", | ||
| headers=headers, | ||
| json={ | ||
| "name": "team-daily", | ||
| "token_type": "api_token", | ||
| "balance_reset_amount": "10.00", | ||
| "balance_reset_period": "daily" | ||
| } | ||
| ) | ||
| ``` | ||
|
|
||
| ```bash cURL | ||
| curl -X POST https://api.edenai.run/v2/user/custom_token/ \ | ||
| -H "Authorization: Bearer YOUR_API_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "name": "team-daily", | ||
| "balance_reset_amount": "10.00", | ||
| "balance_reset_period": "daily" | ||
| }' |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the documented API-key placeholder.
Replace YOUR_API_KEY with <api_key> in both authorization examples. As per coding guidelines, use Authorization: Bearer <api_key> header format for API authentication in code examples.
🧰 Tools
🪛 Betterleaks (1.6.1)
[high] 157-158: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@v3/general/custom-api-keys.mdx` around lines 139 - 164, Replace the
YOUR_API_KEY placeholder with <api_key> in the Authorization headers of both the
Python requests example and the cURL example, preserving the documented Bearer
header format.
Source: Coding guidelines
The Users & Organisation guardrails summary implied all guardrail settings resolve token → member → role. Per-member budget caps only resolve at member/role levels (token-attached budgets are ignored), so split the sentence to state the model-rule/rate-limit resolution and the budget resolution separately. Addresses CodeRabbit review feedback on PR #78.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
The intro claimed a token budget is one-time "by default", but the dashboard pre-selects a recurring Monthly reset whenever a spending limit is enabled — "Never" (one-time) is an option, not the default. - Reframe the intro so neither reset nor one-time is stated as the universal default. - Note in the dashboard section that a frequency is always selected and defaults to Monthly, with Never for a one-time budget. - Qualify the API field table: `none` is the default only when the field is omitted from the API request.
What
Documents two new spending-control features:
Custom API Keys — periodic budget reset
balance_reset_period/balance_reset_amount.none.Guardrails — per-member budget cap
Users & Organisation
Verification
custom-api-keys.mdxPython snippets pass against staging (4 passed), including the new periodic-reset snippet.🤖 Generated with Claude Code
Summary by CodeRabbit
balance_reset_periodoptions (includingnone),balance_reset_amountrequirements, and reset behavior/timing (automaticactive_balanceenforcement and Paris midnight schedule).