MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isFirstPartyAnthropicBaseUrl

Function isFirstPartyAnthropicBaseUrl

src/utils/model/providers.ts:27–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 * (or api-staging.anthropic.com for ant users).
26 */
27export function isFirstPartyAnthropicBaseUrl(): boolean {
28 const baseUrl = process.env.ANTHROPIC_BASE_URL
29 if (!baseUrl) {
30 return true
31 }
32 try {
33 const host = new URL(baseUrl).host
34 const allowedHosts = ['api.anthropic.com']
35 if (process.env.USER_TYPE === 'ant') {
36 allowedHosts.push('api-staging.anthropic.com')
37 }
38 return allowedHosts.includes(host)
39 } catch {
40 return false
41 }
42}

Callers 10

toolToAPISchemaFunction · 0.85
isPolicyLimitsEligibleFunction · 0.85
isUsingOAuthFunction · 0.85
buildFetchFunction · 0.85
queryModelFunction · 0.85
isUsingOAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected