支持Anthropic端点客户端x-api-key:\n- /v1/messages读取x-api-key并优先作为客户端授权传递\n- getAnthropicHeaders转发x-api-key并透传anthropic-version\n- CORS允许X-API-Key与anthropic-version
This commit is contained in:
@@ -162,8 +162,9 @@ export function getAnthropicHeaders(authHeader, clientHeaders = {}, isStreaming
|
||||
const headers = {
|
||||
'accept': 'application/json',
|
||||
'content-type': 'application/json',
|
||||
'anthropic-version': '2023-06-01',
|
||||
'x-api-key': 'placeholder',
|
||||
'anthropic-version': clientHeaders['anthropic-version'] || '2023-06-01',
|
||||
// Prefer client-provided x-api-key for anthropic endpoint format
|
||||
...(clientHeaders['x-api-key'] ? { 'x-api-key': clientHeaders['x-api-key'] } : {}),
|
||||
'authorization': authHeader || '',
|
||||
'x-api-provider': 'anthropic',
|
||||
'x-factory-client': 'cli',
|
||||
|
||||
Reference in New Issue
Block a user