Skip to content

Commit 093cf32

Browse files
authored
Merge pull request #1381 from siddharthsambharia-portkey/feat/claude-code-gateway
feat: support claude code oauth/max plans on Portkey
2 parents d4dbabb + 3cec579 commit 093cf32

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/providers/anthropic/api.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ import { ProviderAPIConfig } from '../types';
22

33
const AnthropicAPIConfig: ProviderAPIConfig = {
44
getBaseURL: () => 'https://api.anthropic.com/v1',
5-
headers: ({ providerOptions, fn, gatewayRequestBody }) => {
5+
6+
headers: ({
7+
providerOptions,
8+
fn,
9+
headers: requestHeaders,
10+
gatewayRequestBody,
11+
}) => {
12+
const apiKey =
13+
providerOptions.apiKey || requestHeaders?.['x-api-key'] || '';
614
const headers: Record<string, string> = {
7-
'X-API-Key': `${providerOptions.apiKey}`,
15+
'X-API-Key': apiKey,
816
};
917

1018
// Accept anthropic_beta and anthropic_version in body to support enviroments which cannot send it in headers.

0 commit comments

Comments
 (0)