@@ -39,6 +39,8 @@ class ClaudeSDK(BaseAPIModel):
3939 wrapping of any meta instructions.
4040 base_url (str, optional): Anthropic-compatible base URL. If omitted,
4141 use ANTHROPIC_BASE_URL from environment.
42+ extra_headers (Dict, optional): Extra default HTTP headers passed to
43+ the Anthropic SDK client.
4244 stream (bool): Whether to use streaming response. Defaults to False.
4345 retry (int): Number of retires if the API call fails. Defaults to 2.
4446 think_tag (str): Separator used between thinking content and final
@@ -59,6 +61,7 @@ def __init__(
5961 base_url : Optional [str ] = None ,
6062 stream : bool = False ,
6163 retry : int = 2 ,
64+ extra_headers : Optional [Dict [str , str ]] = None ,
6265 think_tag : str = '</think>' ,
6366 claude_extra_kwargs : Optional [Dict ] = None ,
6467 ):
@@ -83,6 +86,8 @@ def __init__(
8386 client_kwargs = {'api_key' : key }
8487 if base_url :
8588 client_kwargs ['base_url' ] = base_url
89+ if extra_headers is not None :
90+ client_kwargs ['default_headers' ] = extra_headers
8691
8792 self .anthropic = Anthropic (** client_kwargs )
8893 self .model = path
0 commit comments