MCPcopy
hub / github.com/codeaashu/claude-code / is1PApiCustomer

Function is1PApiCustomer

src/utils/auth.ts:1586–1609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1584}
1585
1586export 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.

Callers 2

isBigQueryMetricsEnabledFunction · 0.85
tipRegistry.tsFile · 0.85

Calls 2

isEnvTruthyFunction · 0.85
isClaudeAISubscriberFunction · 0.70

Tested by

no test coverage detected