{"record":{"id":"79b58168abe92e68","repo":"BerriAI/litellm","slug":"unexpected-string-response-from-azure-response","errorCode":null,"errorMessage":"Unexpected string response from Azure: {response[:500]}","messagePattern":"Unexpected string response from Azure: (.+?)","errorType":"exception","errorClass":"AzureOpenAIError","httpStatus":500,"severity":"error","filePath":"litellm/llms/azure/azure.py","lineNumber":350,"sourceCode":"                    api_version=api_version,\n                    api_base=api_base,\n                    api_key=api_key,\n                    model=model,\n                    client=client,\n                    _is_async=False,\n                    litellm_params=litellm_params,\n                )\n                if not isinstance(azure_client, (AzureOpenAI, OpenAI)):\n                    raise AzureOpenAIError(\n                        status_code=500,\n                        message=\"azure_client is not an instance of AzureOpenAI or OpenAI\",\n                    )\n\n                headers, response = self.make_sync_azure_openai_chat_completion_request(\n                    azure_client=azure_client, data=data, timeout=timeout\n                )\n                if isinstance(response, str):\n                    raise AzureOpenAIError(\n                        status_code=500,\n                        message=f\"Unexpected string response from Azure: {response[:500]}\",\n                    )\n                stringified_response: Final = response.model_dump()\n                ## LOGGING\n                logging_obj.post_call(\n                    input=messages,\n                    api_key=api_key,\n                    original_response=stringified_response,\n                    additional_args={\n                        \"headers\": headers,\n                        \"api_version\": api_version,\n                        \"api_base\": api_base,\n                    },\n                )\n                return convert_to_model_response_object(\n                    response_object=stringified_response,\n                    model_response_object=model_response,","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/azure.py#L332-L368","documentation":"Error \"Unexpected string response from Azure: {response[:500]}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/azure.py:350 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the string response shown in the error; Azure returned a non-JSON body (often an auth or endpoint error page).","Verify api_base, api_version, and deployment name."],"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-23T08:17:48.524Z"}