diff --git a/src/api/providers/fetchers/requesty.ts b/src/api/providers/fetchers/requesty.ts index 7d73519a94..2fa8c1bdb5 100644 --- a/src/api/providers/fetchers/requesty.ts +++ b/src/api/providers/fetchers/requesty.ts @@ -17,6 +17,8 @@ export async function getRequestyModels(baseUrl?: string, apiKey?: string): Prom const resolvedBaseUrl = toRequestyServiceUrl(baseUrl) // Ensure the base URL ends with a slash so "models" is appended correctly + // Without this, new URL("models", "https://custom.requesty.ai/v1") would incorrectly + // resolve to "https://custom.requesty.ai/models" instead of "https://custom.requesty.ai/v1/models" const baseWithSlash = resolvedBaseUrl.endsWith("/") ? resolvedBaseUrl : `${resolvedBaseUrl}/` const modelsUrl = new URL("models", baseWithSlash)