()
| 1859 | } |
| 1860 | |
| 1861 | export function is1PApiCustomer(): boolean { |
| 1862 | // 1P API customers are users who are NOT: |
| 1863 | // 1. Claude.ai subscribers (Max, Pro, Enterprise, Team) |
| 1864 | // 2. Vertex AI users |
| 1865 | // 3. AWS Bedrock users |
| 1866 | // 4. Foundry users |
| 1867 | |
| 1868 | // Exclude Vertex, Bedrock, and Foundry customers |
| 1869 | if ( |
| 1870 | isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || |
| 1871 | isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || |
| 1872 | isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) |
| 1873 | ) { |
| 1874 | return false |
| 1875 | } |
| 1876 | |
| 1877 | // Exclude Claude.ai subscribers |
| 1878 | if (isClaudeAISubscriber()) { |
| 1879 | return false |
| 1880 | } |
| 1881 | |
| 1882 | // Everyone else is an API customer (OAuth API customers, direct API key users, etc.) |
| 1883 | return true |
| 1884 | } |
| 1885 | |
| 1886 | /** |
| 1887 | * Gets OAuth account information when Anthropic auth is enabled. |
nothing calls this directly
no test coverage detected