[reporter nazkhan-8451]: @whiskyboy `max_token` solved the cutoff problem! Are you using Azure Dalle? Because for Dalle I get the following error. But the api key is fine because when I forced it to accept it (showed above comment) it works. `AuthenticationError Traceback (most recent call last) Cell In[11], [line 7](vscode-notebook-cell:?execution_count=11&line=7) [4](vscode-notebook-cell:?execution_count=11&line=4) img_prompt = "A happy dog wearing a shirt saying 'I Love AutoGen'. Make sure the text is clear." [5](vscode-notebook-cell:?execution_count=11&line=5) # img_prompt = "Ask me how I'm doing" ----&gt; [7](vscode-notebook-cell:?execution_count=11&line=7) result = dalle.initiate_chat(critic, message=img_prompt) AuthenticationError: Error code: 401 - {'error': {'code': 'invalid_api_key', 'message': 'Incorrect API key provided: f***************************4e23. You can find your API key at https://platform.openai.com/account/api-keys.', 'param': None, 'type': 'invalid_request_error'}}`

Context: Issue microsoft/autogen#2510 (closed, 29 comments): ### Describe the bug Followed the notebook [https://github.com/microsoft/autogen/blob/main/notebook/agentchat_image_generation_capability.ipynb](url), but getting the following response: [image] Code: ```python import autogen config_list_gpt4 = autogen.config_list_from_json( "OAI_CONFIG_LIST", filter_dict={ "model": ["wag-gpt4-128k"], }, ) config_list_gpt4_vision = autogen.config_list_from_json( "OAI_CONFIG_LIST", filter_dict={ "model": ["gpt4-