{"record":{"id":"0f20f982aca7ad62","repo":"BerriAI/litellm","slug":"azure-client-is-not-an-instance-of-azureopenai","errorCode":null,"errorMessage":"azure_client is not an instance of AzureOpenAI","messagePattern":"azure_client is not an instance of AzureOpenAI","errorType":"exception","errorClass":"AzureOpenAIError","httpStatus":500,"severity":"error","filePath":"litellm/llms/azure/completion/handler.py","lineNumber":154,"sourceCode":"                        \"api_base\": api_base,\n                        \"complete_input_dict\": data,\n                    },\n                )\n                if not isinstance(max_retries, int):\n                    raise AzureOpenAIError(status_code=422, message=\"max retries must be an int\")\n                # init AzureOpenAI Client\n                azure_client: Final = self.get_azure_openai_client(\n                    api_key=api_key,\n                    api_base=api_base,\n                    api_version=api_version,\n                    client=client,\n                    litellm_params=litellm_params,\n                    _is_async=False,\n                    model=model,\n                )\n\n                if not isinstance(azure_client, AzureOpenAI):\n                    raise AzureOpenAIError(\n                        status_code=500,\n                        message=\"azure_client is not an instance of AzureOpenAI\",\n                    )\n\n                raw_response: Final = azure_client.completions.with_raw_response.create(**data, timeout=timeout)\n                response: Final = raw_response.parse()\n                stringified_response: Final = response.model_dump()\n                ## LOGGING\n                logging_obj.post_call(\n                    input=prompt,\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                )","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/completion/handler.py#L136-L172","documentation":"Error \"azure_client is not an instance of AzureOpenAI\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/completion/handler.py:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an AzureOpenAI client instance (sync)."],"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"}