Auth Backend Selection Matrix
- Entity ID:
ent-20260420-b01a00000007 - Type:
concept - Scope:
shared - Status:
active - Aliases: API backend selector, multi-provider auth, Bedrock/Vertex/Foundry/OAuth/direct
Description
Runtime logic in src/services/api/client.ts + src/utils/auth.ts that selects one of five Anthropic-compatible API backends based on env vars: (1) Direct API via ANTHROPIC_API_KEY (simplest); (2) OAuth via Claude.ai subscription (browser flow); (3) AWS Bedrock via AWS_* credentials; (4) Google Vertex AI via GCP creds; (5) Azure Foundry via ANTHROPIC_FOUNDRY_API_KEY. Also honors ANTHROPIC_BASE_URL override and ANTHROPIC_SMALL_FAST_MODEL for fast/cheap calls.
Key claims
- Claude Code supports five API backends selected via environment variables
- Verified OAuth bypass for dev only requires ANTHROPIC_API_KEY
Relations
- Auth Backend Selection Matrix --[includes]--> OAuth Service
- Auth Backend Selection Matrix --[populates]--> Environment Variable Atlas
- scripts/test-auth.ts --[verifies]--> Auth Backend Selection Matrix