()
| 1584 | } |
| 1585 | |
| 1586 | export function is1PApiCustomer(): boolean { |
| 1587 | // 1P API customers are users who are NOT: |
| 1588 | // 1. Claude.ai subscribers (Max, Pro, Enterprise, Team) |
| 1589 | // 2. Vertex AI users |
| 1590 | // 3. AWS Bedrock users |
| 1591 | // 4. Foundry users |
| 1592 | |
| 1593 | // Exclude Vertex, Bedrock, and Foundry customers |
| 1594 | if ( |
| 1595 | isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || |
| 1596 | isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || |
| 1597 | isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) |
| 1598 | ) { |
| 1599 | return false |
| 1600 | } |
| 1601 | |
| 1602 | // Exclude Claude.ai subscribers |
| 1603 | if (isClaudeAISubscriber()) { |
| 1604 | return false |
| 1605 | } |
| 1606 | |
| 1607 | // Everyone else is an API customer (OAuth API customers, direct API key users, etc.) |
| 1608 | return true |
| 1609 | } |
| 1610 | |
| 1611 | /** |
| 1612 | * Gets OAuth account information when Anthropic auth is enabled. |
no test coverage detected