MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / configureApiKeyHeaders

Function configureApiKeyHeaders

src/services/api/client.ts:361–376  ·  view source on GitHub ↗
(
  headers: Record<string, string>,
  isNonInteractiveSession: boolean,
)

Source from the content-addressed store, hash-verified

359}
360
361async function configureApiKeyHeaders(
362 headers: Record<string, string>,
363 isNonInteractiveSession: boolean,
364): Promise<void> {
365 const activeProvider = getActiveProviderConfig()
366 const token =
367 getConfiguredProviderAuthToken() ||
368 (isOpenAICompatibleProviderType(activeProvider.type)
369 ? getConfiguredProviderApiKey()
370 : undefined) ||
371 process.env.ANTHROPIC_AUTH_TOKEN ||
372 (await getApiKeyFromApiKeyHelper(isNonInteractiveSession))
373 if (token) {
374 headers['Authorization'] = `Bearer ${token}`
375 }
376}
377
378function getCustomHeaders(): Record<string, string> {
379 const customHeaders: Record<string, string> = {}

Callers 1

getAnthropicClientFunction · 0.85

Tested by

no test coverage detected