diff --git a/litellm/llms/xai/oauth.py b/litellm/llms/xai/oauth.py index 2773733444b..afce21b037e 100644 --- a/litellm/llms/xai/oauth.py +++ b/litellm/llms/xai/oauth.py @@ -308,15 +308,15 @@ class XAIOAuthAuthenticator: def _exchange_token( self, token_endpoint: str, data: Dict[str, str] ) -> Dict[str, Any]: - response = self._client().post( - token_endpoint, - headers={ - "Accept": "application/json", - "Content-Type": "application/x-www-form-urlencoded", - }, - data=data, - ) try: + response = self._client().post( + token_endpoint, + headers={ + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + data=data, + ) response.raise_for_status() except httpx.HTTPStatusError as exc: raise XAIOAuthError(