{"record":{"id":"3448399a2a7e82e6","repo":"BerriAI/litellm","slug":"azure-client-is-not-an-instance-of-asyncazureopena-344839","errorCode":null,"errorMessage":"azure_client is not an instance of AsyncAzureOpenAI","messagePattern":"azure_client is not an instance of AsyncAzureOpenAI","errorType":"exception","errorClass":"AzureOpenAIError","httpStatus":500,"severity":"error","filePath":"litellm/llms/azure/completion/handler.py","lineNumber":216,"sourceCode":"        azure_ad_token: str | None = None,\n        client=None,  # this is the AsyncAzureOpenAI\n        litellm_params: dict = {},\n    ):\n        response = None\n        try:\n            # init AzureOpenAI Client\n            # setting Azure client\n            azure_client: Final = self.get_azure_openai_client(\n                api_version=api_version,\n                api_base=api_base,\n                api_key=api_key,\n                model=model,\n                _is_async=True,\n                client=client,\n                litellm_params=litellm_params,\n            )\n            if not isinstance(azure_client, AsyncAzureOpenAI):\n                raise AzureOpenAIError(\n                    status_code=500,\n                    message=\"azure_client is not an instance of AsyncAzureOpenAI\",\n                )\n\n            ## LOGGING\n            logging_obj.pre_call(\n                input=data[\"prompt\"],\n                api_key=azure_client.api_key,\n                additional_args={\n                    \"headers\": {\"Authorization\": f\"Bearer {azure_client.api_key}\"},\n                    \"api_base\": azure_client._base_url._uri_reference,\n                    \"acompletion\": True,\n                    \"complete_input_dict\": data,\n                },\n            )\n            raw_response: Final = await azure_client.completions.with_raw_response.create(**data, timeout=timeout)\n            response = raw_response.parse()\n            return openai_text_completion_config.convert_to_chat_model_response_object(","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/completion/handler.py#L198-L234","documentation":"Error \"azure_client is not an instance of AsyncAzureOpenAI\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/completion/handler.py:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an AsyncAzureOpenAI client instance."],"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"}