diff --git a/crates/forge_domain/src/provider.rs b/crates/forge_domain/src/provider.rs index 107084e1f2..1f1fa3e8eb 100644 --- a/crates/forge_domain/src/provider.rs +++ b/crates/forge_domain/src/provider.rs @@ -39,6 +39,7 @@ pub enum ProviderId { Cerebras, Xai, Anthropic, + ClaudeCode, VertexAi, BigModel, Azure, diff --git a/crates/forge_infra/src/auth/strategy.rs b/crates/forge_infra/src/auth/strategy.rs index 584e2346c8..040e067675 100644 --- a/crates/forge_infra/src/auth/strategy.rs +++ b/crates/forge_infra/src/auth/strategy.rs @@ -662,7 +662,7 @@ impl StrategyFactory for ForgeAuthStrategyFactory { required_params, ))), forge_domain::AuthMethod::OAuthCode(config) => { - if let ProviderId::Anthropic = provider_id { + if let ProviderId::ClaudeCode = provider_id { return Ok(AnyAuthStrategy::OAuthCodeAnthropic(OAuthCodeStrategy::new( AnthropicHttpProvider, provider_id, diff --git a/crates/forge_repo/src/provider.json b/crates/forge_repo/src/provider.json index 7f913d62bd..46c4ef7697 100644 --- a/crates/forge_repo/src/provider.json +++ b/crates/forge_repo/src/provider.json @@ -86,8 +86,16 @@ "response_type": "Anthropic", "url": "https://api.anthropic.com/v1/messages", "models": "https://api.anthropic.com/v1/models", + "auth_methods": ["api_key"] + }, + { + "id": "claude_code", + "api_key_vars": "ANTHROPIC_API_KEY", + "url_param_vars": [], + "response_type": "Anthropic", + "url": "https://api.anthropic.com/v1/messages", + "models": "https://api.anthropic.com/v1/models", "auth_methods": [ - "api_key", { "oauth_code": { "auth_url": "https://claude.ai/oauth/authorize",