in src/anthropic/_client.py [0:0]
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
if self.api_key and headers.get("X-Api-Key"):
return
if isinstance(custom_headers.get("X-Api-Key"), Omit):
return
if self.auth_token and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return
raise TypeError(
'"Could not resolve authentication method. Expected either api_key or auth_token to be set. Or for one of the `X-Api-Key` or `Authorization` headers to be explicitly omitted"'
)