--- title: "clear ChatGPT history()" slug: "ai-clear-chat" updated: 2026-08-10T05:59:20Z published: 2026-08-10T05:59:20Z canonical: "docs.lobstersoftware.com/ai-clear-chat" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # clear ChatGPT history() This function deletes the chat history of chat session ***a***. The return value is *true* if successful, *false* otherwise (e.g. if the chat session key ***a*** is incorrect). Parameter ***b*** can be used to pass content to the chat session ***a*** for the role *system* (after the history has been deleted). ## Parameters | Parameter | Description | | --- | --- | | a | (optional) Chat session key. **NOTE:** If no specific session key is set, the internal session key is used. See functions [setup OpenAI ChatGPT()](/v1/docs/en/ai-open-ai-chat-gpt-setup) and [setup Azure ChatGPT()](/v1/docs/en/ai-azure-chat-gpt-setup). | | b | (optional) Content for the role *system*. **Example:** You are a database SQL expert and answer questions related to SQL statements. |