mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add chatgpt support for aibridge (#23822)
Registers a new aibridge provider for ChatGPT by reusing the existing OpenAI provider with a different `Name` and `BaseURL` (https://chatgpt.com/backend-api/codex). The ChatGPT backend API is OpenAI-compatible, so no new provider type is needed. ChatGPT authenticates exclusively via per-user OAuth JWTs (BYOK mode) — no centralized API key is configured. The OpenAI provider already handles this: when no key is set, it falls through to the bearer token from the request's Authorization header. Depends on #23811
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user