fix(api): complete anthropic direct profile support

This commit is contained in:
Tam Nhu Tran
2026-03-07 15:58:36 +07:00
parent fedb4d4cde
commit 1f29fa0b6a
11 changed files with 270 additions and 33 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ export function formatExportLine(shell: ShellType, key: string, value: string):
* can discover the model without additional configuration. */
export function transformToOpenAI(envVars: Record<string, string>): Record<string, string> {
const baseUrl = envVars['ANTHROPIC_BASE_URL'] || '';
const apiKey = envVars['ANTHROPIC_AUTH_TOKEN'] || '';
const apiKey = envVars['ANTHROPIC_AUTH_TOKEN'] || envVars['ANTHROPIC_API_KEY'] || '';
const model = envVars['ANTHROPIC_MODEL'] || '';
const result: Record<string, string> = {};
if (apiKey) result['OPENAI_API_KEY'] = apiKey;