Questions regarding Threads in the Assistant API

I have some questions regarding Threads in the Assistant API:

  1. What is the live cycle of a thread? There is no “status field”.
  2. How long do they live?
  3. Can I have a permanent thread for a user with the all conversations in the context? What’s the context window, 128k tokens? If so, what happens when it goes above? Or maybe threads are designed as “per single conversation” objects?


1 Like

Based on this → Context window management, I suppose it is based on the model you choose and the context window is managed by OpenAI.

But you can store all interactions/conversations along the way, then create a new thread with the interactions/conversations of your choice. You can also ask the chat completion model to summarize the past interactions/conversations before you open a new thread, then you can have a lighter context.

thread = client.beta.threads.create(
      "role": "user",
      "content": "Create 3 data visualizations based on the trends in this file.",
      "file_ids": []