feat(Anthropic Chat Model Node): Add configurable base URL for Anthropic API (#15063)

This commit is contained in:
oleg
2025-05-05 09:57:10 +02:00
committed by GitHub
parent 54499fc6d1
commit 4b5f045281
4 changed files with 56 additions and 6 deletions

View File

@@ -15,8 +15,11 @@ export async function searchModels(
this: ILoadOptionsFunctions,
filter?: string,
): Promise<INodeListSearchResult> {
const credentials = await this.getCredentials<{ url?: string }>('anthropicApi');
const baseURL = credentials.url ?? 'https://api.anthropic.com';
const response = (await this.helpers.httpRequestWithAuthentication.call(this, 'anthropicApi', {
url: 'https://api.anthropic.com/v1/models',
url: `${baseURL}/v1/models`,
headers: {
'anthropic-version': '2023-06-01',
},