mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user