MCPcopy Create free account
hub / github.com/Noumena-Network/code / is1PApiCustomer

Function is1PApiCustomer

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

Source from the content-addressed store, hash-verified

1859}
1860
1861export 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.

Callers

nothing calls this directly

Calls 2

isEnvTruthyFunction · 0.90
isClaudeAISubscriberFunction · 0.85

Tested by

no test coverage detected