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
+4
View File
@@ -5108,6 +5108,7 @@ const (
ExperimentWorkspaceBuildUpdates Experiment = "workspace-build-updates" // Enables publishing workspace build updates to the all builds pubsub channel.
ExperimentNATSPubsub Experiment = "nats_pubsub" // Enables embedded NATS pubsub.
ExperimentMinimumImplicitMember Experiment = "minimum-implicit-member" // Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts.
ExperimentAIGatewayCostControl Experiment = "ai-gateway-cost-control" // Enables AI Gateway cost control functionality.
)
func (e Experiment) DisplayName() string {
@@ -5130,6 +5131,8 @@ func (e Experiment) DisplayName() string {
return "NATS Pubsub"
case ExperimentMinimumImplicitMember:
return "Gateway Accounts (minimum implicit member)"
case ExperimentAIGatewayCostControl:
return "AI Gateway Cost Control"
default:
// Split on hyphen and convert to title case
// e.g. "mcp-server-http" -> "Mcp Server Http"
@@ -5149,6 +5152,7 @@ var ExperimentsKnown = Experiments{
ExperimentNATSPubsub,
ExperimentWorkspaceBuildUpdates,
ExperimentMinimumImplicitMember,
ExperimentAIGatewayCostControl,
}
// ExperimentsSafe should include all experiments that are safe for