We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d4dbabb + 3cec579 commit 093cf32Copy full SHA for 093cf32
src/providers/anthropic/api.ts
@@ -2,9 +2,17 @@ import { ProviderAPIConfig } from '../types';
2
3
const AnthropicAPIConfig: ProviderAPIConfig = {
4
getBaseURL: () => 'https://api.anthropic.com/v1',
5
- headers: ({ providerOptions, fn, gatewayRequestBody }) => {
+
6
+ headers: ({
7
+ providerOptions,
8
+ fn,
9
+ headers: requestHeaders,
10
+ gatewayRequestBody,
11
+ }) => {
12
+ const apiKey =
13
+ providerOptions.apiKey || requestHeaders?.['x-api-key'] || '';
14
const headers: Record<string, string> = {
- 'X-API-Key': `${providerOptions.apiKey}`,
15
+ 'X-API-Key': apiKey,
16
};
17
18
// Accept anthropic_beta and anthropic_version in body to support enviroments which cannot send it in headers.
0 commit comments