diff --git a/codersdk/aibridge.go b/codersdk/aibridge.go index a826b753d7..fd6adb1859 100644 --- a/codersdk/aibridge.go +++ b/codersdk/aibridge.go @@ -40,7 +40,7 @@ type AIBridgeListSessionsResponse struct { } // AIBridgeSessionThreadsResponse is the response for GET -// /api/v2/aibridge/sessions/{session_id} which returns a single +// /api/v2/ai-gateway/sessions/{session_id} which returns a single // session with fully expanded threads. type AIBridgeSessionThreadsResponse struct { ID string `json:"id"` diff --git a/site/src/api/api.ts b/site/src/api/api.ts index ed8e78e1dd..363a83c3bd 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -416,6 +416,7 @@ export type DeploymentConfig = Readonly<{ }>; const aiProviderConfigsPath = "/api/v2/ai/providers"; +const aiGatewayPath = "/api/v2/ai-gateway"; const chatModelConfigsPath = "/api/experimental/chats/model-configs"; const userSkillsPath = (user: string) => `/api/experimental/users/${encodeURIComponent(user)}/skills`; @@ -3157,21 +3158,21 @@ class ApiMethods { }; getAIBridgeModels = async (options: SearchParamOptions) => { - const url = getURLWithSearchParams("/api/v2/aibridge/models", options); + const url = getURLWithSearchParams(`${aiGatewayPath}/models`, options); const response = await this.axios.get(url); return response.data; }; getAIBridgeClients = async (options: SearchParamOptions) => { - const url = getURLWithSearchParams("/api/v2/aibridge/clients", options); + const url = getURLWithSearchParams(`${aiGatewayPath}/clients`, options); const response = await this.axios.get(url); return response.data; }; getAIBridgeSessionList = async (options: SearchParamOptions) => { - const url = getURLWithSearchParams("/api/v2/aibridge/sessions", options); + const url = getURLWithSearchParams(`${aiGatewayPath}/sessions`, options); const response = await this.axios.get(url); return response.data; @@ -3182,7 +3183,7 @@ class ApiMethods { options?: { after_id?: string; before_id?: string; limit?: number }, ) => { const url = getURLWithSearchParams( - `/api/v2/aibridge/sessions/${sessionId}`, + `${aiGatewayPath}/sessions/${sessionId}`, options, ); const response = @@ -3233,7 +3234,7 @@ class ApiMethods { getAIGatewayKeys = async (): Promise => { const response = await this.axios.get( - "/api/v2/aibridge/keys", + `${aiGatewayPath}/keys`, ); return response.data; }; @@ -3242,14 +3243,14 @@ class ApiMethods { req: TypesGen.CreateAIGatewayKeyRequest, ): Promise => { const response = await this.axios.post( - "/api/v2/aibridge/keys", + `${aiGatewayPath}/keys`, req, ); return response.data; }; deleteAIGatewayKey = async (id: string): Promise => { - await this.axios.delete(`/api/v2/aibridge/keys/${encodeURIComponent(id)}`); + await this.axios.delete(`${aiGatewayPath}/keys/${encodeURIComponent(id)}`); }; } diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index ac47576c58..9301a9eb79 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -146,7 +146,7 @@ export interface AIBridgeSession { // From codersdk/aibridge.go /** * AIBridgeSessionThreadsResponse is the response for GET - * /api/v2/aibridge/sessions/{session_id} which returns a single + * /api/v2/ai-gateway/sessions/{session_id} which returns a single * session with fully expanded threads. */ export interface AIBridgeSessionThreadsResponse {