Below is the Python code for developing the chat application. import os from openai import AzureOpenAI client = AzureOpenAI( api_key = os.getenv("AZURE_OPENAI_API_KEY"), api_version = "2024-02-01", azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") ) response = client.chat.completions.create( model="gpt-35-turbo", # model = "deployment_name". messages=[ {"role": "system", "content": "Assistant is a large language model trained by OpenAI."}, {"role": "user", "content": "Who were the founders of Microsoft?"} ] ) all = response['choices'][0]['message']['content'] usage = all['usage'] Usage variable contains token for both prompt and completion.