feat: add ai-gateway-cost-control experiment flag (#26399)

Adds the `ai-gateway-cost-control` experiment flag to gate new cost
control endpoints and upcoming frontend UI behind an explicit opt-in.

Currently AI Gateway cost control supports the following endpoints:
- `GET/PUT/DELETE /api/v2/organizations/{org}/groups/{group}/ai/budget`
- `GET/PUT/DELETE /api/v2/users/{user}/ai/budget`

Note: the group-level endpoints were already released in v2.34.0 and
remain ungated. Only the user-level endpoints are gated behind this
experiment. Future cost control endpoints and UI should use this
experiment for gating until the feature is stable.

> Generated by Coder Agents on behalf of @ssncferreira
This commit is contained in:
Susana Ferreira
2026-06-16 10:33:34 +01:00
committed by GitHub
parent a1330e3a8c
commit 12d7ad6100
7 changed files with 29 additions and 9 deletions
+7 -3
View File
@@ -19279,9 +19279,11 @@ const docTemplate = `{
"mcp-server-http",
"workspace-build-updates",
"nats_pubsub",
"minimum-implicit-member"
"minimum-implicit-member",
"ai-gateway-cost-control"
],
"x-enum-comments": {
"ExperimentAIGatewayCostControl": "Enables AI Gateway cost control functionality.",
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
"ExperimentExample": "This isn't used for anything.",
"ExperimentMCPServerHTTP": "Enables the MCP HTTP server functionality.",
@@ -19301,7 +19303,8 @@ const docTemplate = `{
"Enables the MCP HTTP server functionality.",
"Enables publishing workspace build updates to the all builds pubsub channel.",
"Enables embedded NATS pubsub.",
"Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts."
"Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts.",
"Enables AI Gateway cost control functionality."
],
"x-enum-varnames": [
"ExperimentExample",
@@ -19312,7 +19315,8 @@ const docTemplate = `{
"ExperimentMCPServerHTTP",
"ExperimentWorkspaceBuildUpdates",
"ExperimentNATSPubsub",
"ExperimentMinimumImplicitMember"
"ExperimentMinimumImplicitMember",
"ExperimentAIGatewayCostControl"
]
},
"codersdk.ExternalAPIKeyScopes": {
+7 -3
View File
@@ -17493,9 +17493,11 @@
"mcp-server-http",
"workspace-build-updates",
"nats_pubsub",
"minimum-implicit-member"
"minimum-implicit-member",
"ai-gateway-cost-control"
],
"x-enum-comments": {
"ExperimentAIGatewayCostControl": "Enables AI Gateway cost control functionality.",
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
"ExperimentExample": "This isn't used for anything.",
"ExperimentMCPServerHTTP": "Enables the MCP HTTP server functionality.",
@@ -17515,7 +17517,8 @@
"Enables the MCP HTTP server functionality.",
"Enables publishing workspace build updates to the all builds pubsub channel.",
"Enables embedded NATS pubsub.",
"Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts."
"Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts.",
"Enables AI Gateway cost control functionality."
],
"x-enum-varnames": [
"ExperimentExample",
@@ -17526,7 +17529,8 @@
"ExperimentMCPServerHTTP",
"ExperimentWorkspaceBuildUpdates",
"ExperimentNATSPubsub",
"ExperimentMinimumImplicitMember"
"ExperimentMinimumImplicitMember",
"ExperimentAIGatewayCostControl"
]
},
"codersdk.ExternalAPIKeyScopes": {