diff --git a/src/openai/_base_client.py b/src/openai/_base_client.py index c2c2db5f49..fa0373fa80 100644 --- a/src/openai/_base_client.py +++ b/src/openai/_base_client.py @@ -420,8 +420,8 @@ def _prepare_url(self, url: str) -> URL: # Copied from httpx's `_merge_url` method. merge_url = URL(url) if merge_url.is_relative_url: - merge_raw_path = self.base_url.raw_path + merge_url.raw_path.lstrip(b"/") - return self.base_url.copy_with(raw_path=merge_raw_path) + merge_raw_path = self._base_url.raw_path + merge_url.raw_path.lstrip(b"/") + return self._base_url.copy_with(raw_path=merge_raw_path) return merge_url