{"record":{"id":"3d2d27c3589e84a8","repo":"BerriAI/litellm","slug":"rate-limit-reached-status-code-429","errorCode":null,"errorMessage":"Rate limit reached. status_code: 429","messagePattern":"Rate limit reached\\. status_code: 429","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py","lineNumber":307,"sourceCode":"    async def _send_request(self, url, headers, data):\n        async_client: Final = get_async_httpx_client(llm_provider=httpxSpecialProvider.LoggingCallback)\n\n        response: Final = await async_client.post(\n            f\"{url}\",\n            headers=headers,\n            json=data,\n            timeout=self.timeout,\n        )\n        response.raise_for_status()\n        return response\n\n    def _handle_response(self, response, direction):\n        # Raise exceptions on critical errors to stop the request\n        if response.status_code == 429:  # Rate limit\n            verbose_proxy_logger.error(\"Zscaler AI Guard rate limit reached. Blocking request.\")\n            user_facing_error = self._create_user_facing_error(\"Rate limit reached. status_code: 429\")\n            # This exception will be caught by the proxy and returned to the user\n            raise HTTPException(status_code=500, detail=user_facing_error)\n\n        if response.status_code >= 500:  # Server error\n            verbose_proxy_logger.error(\n                \"Zscaler AI Guard service is unavailable (Status: %s). Blocking request.\", response.status_code\n            )\n            user_facing_error = self._create_user_facing_error(f\"Service is unavailable (HTTP {response.status_code})\")\n            raise HTTPException(status_code=500, detail=user_facing_error)\n\n        if response.status_code == 200:\n            json_response: Final = response.json()\n            statusCode_in_response: Final = json_response.get(\"statusCode\", None)\n            if statusCode_in_response == 200:\n                guardrail_result: Final = json_response.get(\"action\", None)\n                verbose_proxy_logger.info(\"Zscaler AI Guard response: %s\", json_response)\n\n                if guardrail_result == \"BLOCK\":\n                    verbose_proxy_logger.info(\n                        \"Violated Zscaler AI Guard guardrail policy. zscaler_ai_guard_response: %s\", json_response","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py#L289-L325","documentation":"Error \"Rate limit reached. status_code: 429\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce request rate to the Zscaler AI Guard API or retry after the rate limit window.","Contact Zscaler to raise the API rate limit if sustained throughput is needed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}