fix: Make sure modals are listed when using a free AI credits credential in the OpenAI node (#16030)

This commit is contained in:
Ricardo Espinoza
2025-06-06 12:09:51 -04:00
committed by GitHub
parent 7492944a37
commit 7f7b44ae7c

View File

@@ -77,7 +77,7 @@ export async function modelSearch(
): Promise<INodeListSearchResult> {
const credentials = await this.getCredentials<{ url: string }>('openAiApi');
const url = credentials.url && new URL(credentials.url);
const isCustomAPI = url && url.hostname !== 'api.openai.com';
const isCustomAPI = url && !['api.openai.com', 'ai-assistant.n8n.io'].includes(url.hostname);
return await getModelSearch(
(model) =>
!isCustomAPI &&