()
| 25 | * (or api-staging.anthropic.com for ant users). |
| 26 | */ |
| 27 | export 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 | } |
no outgoing calls
no test coverage detected