diff --git a/pkg/providers/factory_provider.go b/pkg/providers/factory_provider.go index fb5191bf8..cfd516ee4 100644 --- a/pkg/providers/factory_provider.go +++ b/pkg/providers/factory_provider.go @@ -266,22 +266,11 @@ func CreateProviderFromConfig(cfg *config.ModelConfig) (LLMProvider, string, err } return provider, modelID, nil } - // Use API key with HTTP API - apiBase := cfg.APIBase - if apiBase == "" { - apiBase = "https://api.anthropic.com/v1" - } + // Use API key with native Anthropic SDK (not OpenAI-compatible HTTPProvider) if cfg.APIKey() == "" { return nil, "", fmt.Errorf("api_key is required for anthropic protocol (model: %s)", cfg.Model) } - return NewHTTPProviderWithMaxTokensFieldAndRequestTimeout( - cfg.APIKey(), - apiBase, - cfg.Proxy, - cfg.MaxTokensField, - cfg.RequestTimeout, - cfg.ExtraBody, - ), modelID, nil + return NewClaudeProviderWithBaseURL(cfg.APIKey(), cfg.APIBase), modelID, nil case "anthropic-messages": // Anthropic Messages API with native format (HTTP-based, no SDK)