feat: support Anthropic base url option (#702)
commitae3a31fcad4e9e3f8dfe935d24ab34bec08a750f
authorTony Wang <tony@initialcommit.net>
dateTue 26 Aug 2025, 02:08 (1 year ago)
parentc761a6a
internal/llm/provider/anthropic.go+4
@@ -79,6 +79,10 @@ func createAnthropicClient(opts providerClientOptions, tp AnthropicClientType) a
7979 slog.Debug("Skipping X-Api-Key header because Authorization header is provided")
8080 }
8181
82+ if opts.baseURL != "" {
83+ anthropicClientOptions = append(anthropicClientOptions, option.WithBaseURL(opts.baseURL))
84+ }
85+
8286 if config.Get().Options.Debug {
8387 httpClient := log.NewHTTPClient()
8488 anthropicClientOptions = append(anthropicClientOptions, option.WithHTTPClient(httpClient))