def request(self, endpoint: str, payload: Dict[str, Any]) -> Dict[str, Any]:
        """
        Perform a synchronous request to the DeepInfra API.

        Args:
            endpoint (str): The API endpoint to send the request to.
            payload (Dict[str, Any]): The request payload.

        Returns:
                Dict[str, Any]: The API response.

        """

        def perform_request():
            response = requests.post(
                self.get_url(endpoint),
                json={
                    **payload,
                    "stream": False,
                },
                headers=self._get_headers(),
                timeout=self.timeout,
            )
            response.raise_for_status()
            return response.json()

        return retry_request(perform_request, max_retries=self.max_retries)

        Perform a synchronous request to the DeepInfra API.

        Args:
            endpoint (str): The API endpoint to send the request to.
            payload (Dict[str, Any]): The request payload.

        Returns:
                Dict[str, Any]: The API response.

        
llama-index-integrations/llms/llama-index-llms-deepinfra/llama_index/llms/deepinfra/client.py