()
| 437 | * is absent for direct-API users. Hostname only — no path/query/creds. |
| 438 | */ |
| 439 | export function getApiBaseUrlHost(): string | undefined { |
| 440 | const baseUrl = process.env.ANTHROPIC_BASE_URL |
| 441 | if (!baseUrl) return undefined |
| 442 | try { |
| 443 | const host = new URL(baseUrl).host |
| 444 | if (host === 'api.anthropic.com') return undefined |
| 445 | return host |
| 446 | } catch { |
| 447 | return undefined |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Get user attributes for GrowthBook from CoreUserData |