fix: respect ANTHROPIC_BASE_URL in all client instantiations

This commit is contained in:
Yeachan-Heo
2026-04-01 01:40:43 +00:00
parent 387a8bb13f
commit d018276fc1
9 changed files with 12 additions and 6 deletions

View File

@@ -520,7 +520,7 @@ fn read_auth_token() -> Option<String> {
.and_then(std::convert::identity)
}
fn read_base_url() -> String {
pub fn read_base_url() -> String {
std::env::var("ANTHROPIC_BASE_URL").unwrap_or_else(|_| DEFAULT_BASE_URL.to_string())
}

View File

@@ -4,8 +4,8 @@ mod sse;
mod types;
pub use client::{
oauth_token_is_expired, resolve_saved_oauth_token, resolve_startup_auth_source,
AnthropicClient, AuthSource, MessageStream, OAuthTokenSet,
oauth_token_is_expired, read_base_url, resolve_saved_oauth_token,
resolve_startup_auth_source, AnthropicClient, AuthSource, MessageStream, OAuthTokenSet,
};
pub use error::ApiError;
pub use sse::{parse_frame, SseParser};