Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a676bbe

Browse files
committed
docs: apply spend management review feedback
1 parent 2f7337a commit a676bbe

4 files changed

Lines changed: 36 additions & 54 deletions

File tree

docs/ai-coder/agents/platform-controls/advisor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Once the experiment is enabled, configure the advisor under **AI Settings** >
3939
| Advisor model | Use chat model | Optional dedicated chat model config for the advisor. When unset, the advisor reuses the root agent's model. |
4040
| Reasoning effort | Model default | Overrides the selected advisor model's reasoning effort. Available only when the model supports selectable effort. |
4141

42-
The advisor is not available in plan mode or to subagents. Failed advisor
43-
invocations refund the per-turn budget.
42+
The advisor is not available in plan mode or to subagents.
43+
Failed advisor invocations refund the per-turn budget.
4444

4545
The same configuration is available at:
4646

docs/ai-coder/agents/platform-controls/index.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,15 @@ none, if the template does not define any).
116116

117117
### Spend management
118118

119-
AI Gateway budgets cap each user's AI spend, including Coder Agents chats,
120-
over a monthly period. Budgets are set per group, and the deployment policy
121-
selects the group with the largest spend limit when a user belongs to several
122-
budgeted groups. A per-user override takes priority over group budgets.
119+
AI Gateway budgets cap each user's AI spend, including Coder Agents chats, over a monthly period.
120+
Coder sets budgets per group, and the deployment policy selects the group with the largest spend limit when a user belongs to several budgeted groups.
121+
A per-user override takes priority over all group budgets.
123122

124-
Budgets are the only spend cap for Coder Agents chats; chats no longer
125-
enforce a separate limit of their own, and existing native limit values are
126-
not migrated to budgets. Budget controls in the Coder UI, the group budget
127-
endpoints, and the AI spend status endpoints all require a license that
128-
includes AI Gateway.
123+
Budgets are the only spend cap for Coder Agents chats.
124+
Chats no longer enforce a separate limit of their own, and existing native limit values are not migrated to budgets.
125+
Budget controls in the Coder UI, the group budget endpoints, and the AI spend status endpoints all require a license that includes AI Gateway.
129126

130-
See [Spend Management](./usage-insights.md) for details.
127+
Refer to [Spend Management](./usage-insights.md) for details.
131128

132129
### Git providers
133130

@@ -164,10 +161,8 @@ For chat debug logging (not experiment-gated), see [Chat debug logging](./chat-d
164161

165162
## Where we are headed
166163

167-
The controls above cover providers, models, system prompts, templates, MCP
168-
servers, AI Gateway budgets, and data retention. We are continuing to invest in platform controls
169-
based on what we hear from customers deploying agents in regulated and
170-
enterprise environments.
164+
The controls above cover providers, models, system prompts, templates, MCP servers, AI Gateway budgets, and data retention.
165+
We are continuing to invest in platform controls based on what feedback we get from customers deploying agents in regulated and enterprise environments.
171166

172167
### Infrastructure-level enforcement
173168

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
# Spend Management
22

3-
Coder controls agent spend with AI Gateway budgets, and surfaces the
4-
resulting spend to both admins and users.
3+
Coder controls agent spend with AI Gateway budgets, and surfaces the resulting spend to both admins and users.
54

65
## Budgets
76

8-
Coder Agents spend is controlled by AI Gateway budgets, which cap all AI
9-
Gateway usage (including Coder Agents chats) per user over the budget
10-
period.
7+
Coder Agents spend is controlled by AI Gateway budgets, which cap all AI Gateway usage (including Coder Agents chats) per user over the budget period.
118

12-
- **Group budgets**: set a budget for a group from the group's settings
13-
page. The deployment budget policy resolves which group budget applies
14-
when a user belongs to multiple budgeted groups.
15-
- **Per-user overrides**: set a custom budget for an individual user,
16-
attributed to one of their groups. Takes priority over group budgets.
9+
- **Group budgets**: set a budget for a group from the group's settings page.
10+
The deployment budget policy resolves which group budget applies when a user belongs to multiple budgeted groups, which defaults to the group with the highest budget.
11+
- **Per-user overrides**: set a custom budget for an individual user, attributed to one of their groups.
12+
Per-user overrides take priority over group budgets.
1713

1814
The deployment flags `--ai-budget-policy` and `--ai-budget-period` currently
1915
support only `highest` and `month`. `highest` selects the group with the
@@ -24,45 +20,36 @@ deployment-wide budget amount, and a configured spend limit cannot exceed
2420
$1,000,000 per member per period.
2521

2622
> [!IMPORTANT]
27-
> Budget controls in the Coder UI, the group budget endpoints
28-
> (`/api/v2/groups/{group}/ai/budget`), and the AI spend status and reporting
29-
> endpoints all require the AI Gateway entitlement. No experiment is needed.
23+
> Budget controls in the Coder UI, the group budget endpoints (`/api/v2/groups/{group}/ai/budget`), and the AI spend status and reporting endpoints all require the AI Gateway entitlement.
24+
> No experiment is needed.
3025
>
31-
> Native chat usage limits are removed from the application. Existing native
32-
> limit values are not migrated to AI Gateway budgets and are no longer
33-
> enforced. Configure AI Gateway budgets separately.
26+
> Native chat usage limits are removed from the application.
27+
> Existing native limit values are not migrated to AI Gateway budgets and are no longer enforced.
28+
> Configure AI Gateway budgets separately.
29+
30+
The API reference documents how to [get](../../../reference/api/enterprise.md#get-group-ai-budget), [upsert](../../../reference/api/enterprise.md#upsert-group-ai-budget), and [delete](../../../reference/api/enterprise.md#delete-group-ai-budget) a group budget.
3431

3532
### Enforcement
3633

37-
- The AI Gateway checks the user's current spend before forwarding each
38-
request. When spend meets or exceeds the budget, the request is rejected
39-
and the chat shows a terminal error explaining that the budget was
40-
exceeded.
41-
- Brief overage is possible when concurrent requests are in flight, because
42-
cost is recorded after the LLM responds.
34+
- The AI Gateway checks the user's current spend before forwarding each request.
35+
When spend meets or exceeds the budget, the request is rejected and the chat shows a terminal error explaining that the budget was exceeded.
36+
- Brief overage is possible when concurrent requests are in flight, because cost is recorded after the LLM responds.
4337

4438
### User-facing status
4539

46-
The usage indicator on the Agents page and the summary in the user menu both
47-
show the signed-in user's current AI spend, their budget, and the period
48-
reset date. Both appear only when the deployment has the AI Gateway
49-
entitlement.
40+
The usage indicator on the Agents page and the summary in the user menu both show the signed-in user's current AI spend, their budget, and the period reset date.
41+
Both appear only when the deployment has the AI Gateway entitlement.
5042

5143
## Spend visibility
5244

5345
Spend is shown where it is actionable:
5446

55-
- **Agents page and user menu**: the signed-in user's spend against their
56-
budget, as described above.
57-
- **Group settings**: each member's spend against the group's budget, for
58-
admins who can manage the group.
47+
- **Agents page and user menu**: the signed-in user's spend against their budget, as described previously.
48+
- **Group settings**: each member's spend against the group's budget, for admins who can manage the group.
5949
- **Chat summary panel**: the cost of one chat tree, on a chat's Summary tab.
60-
A subagent reports the total for its whole tree, including the chat that
61-
started it.
62-
- **Agents** > **Settings** > **Manage Agents** > **Spend**: deployment-wide
63-
chat cost per user, with per-user drill-down.
50+
A subagent reports the total for its whole tree, including the chat that started it.
51+
- **Agents** > **Settings** > **Manage Agents** > **Spend**: deployment-wide chat cost per user, with per-user drill-down.
6452

6553
> [!NOTE]
66-
> Per-chat cost comes from AI Gateway records, which are pruned according to
67-
> `--ai-gateway-retention` (60 days by default). A chat whose gateway records
68-
> have been pruned reports no cost.
54+
> Per-chat cost comes from AI Gateway records, which are pruned according to `--ai-gateway-retention` (60 days by default).
55+
> A chat for which gateway records have been pruned reports no cost.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@
10801080
},
10811081
{
10821082
"title": "Spend Management",
1083-
"description": "Cap Coder Agents spend with AI Gateway budgets and see the resulting spend.",
1083+
"description": "Cap Coder Agents spend with AI Gateway budgets and track the resulting spend.",
10841084
"path": "./ai-coder/agents/platform-controls/usage-insights.md",
10851085
"state": ["beta"]
10861086
},

0 commit comments

Comments
 (0)