diff --git a/coderd/aibridge/aibridge.go b/coderd/aibridge/aibridge.go index 74484fca3a..d91efa7dbb 100644 --- a/coderd/aibridge/aibridge.go +++ b/coderd/aibridge/aibridge.go @@ -28,6 +28,12 @@ const ( HostCopilotEnterprise = "api.enterprise.githubcopilot.com" ) +// ChatGPT provider. +const ( + ProviderChatGPT = "chatgpt" + BaseURLChatGPT = "https://chatgpt.com/backend-api/codex" +) + // IsBYOK reports whether the request is using BYOK mode, determined // by the presence of the X-Coder-AI-Governance-Token header. func IsBYOK(header http.Header) bool { diff --git a/enterprise/cli/aibridged.go b/enterprise/cli/aibridged.go index 2dd5ca6c78..7c9952c901 100644 --- a/enterprise/cli/aibridged.go +++ b/enterprise/cli/aibridged.go @@ -65,6 +65,12 @@ func newAIBridgeDaemon(coderAPI *coderd.API) (*aibridged.Server, error) { BaseURL: "https://" + agplaibridge.HostCopilotEnterprise, CircuitBreaker: cbConfig, }), + aibridge.NewOpenAIProvider(aibridge.OpenAIConfig{ + Name: agplaibridge.ProviderChatGPT, + BaseURL: agplaibridge.BaseURLChatGPT, + CircuitBreaker: cbConfig, + SendActorHeaders: cfg.SendActorHeaders.Value(), + }), } reg := prometheus.WrapRegistererWithPrefix("coder_aibridged_", coderAPI.PrometheusRegistry)