What are the life spans of inactive assistant and thread?

if an assistant is created
then a thread is created
made some conversation using the above assistant and thread

Question1: after above sequence, if I am not using assistant for long time, then will assistant will destroy automatically? if yes, what will be the duration (how long) after which assistant will destroy automatically?

Question2: same as Question1 but regarding a thread.

Or do I have to explicitly delete the assistant and thread if they are not required?

3 Likes

For threads, 60 days.

For assistants, no timeout is given, but probably nothing automatic as that could damage a deployed application.

1 Like

Thanks @_j ,
My takeaways are
For thread: it is 60 days of inactivity (and not 60 days from thread creation).
For assistant: no automatic deletion (only explicit deletion)

2 Likes

Wow. I’ve been “playing” with the Assistants API on-and-off for a couple of months. During this time run my code repeatedly, each time with a call like
“assistant = client.beta.assistants.create()”.

Today when to the Playground for the first time notices options such as “Assistants”, “Fine-Tuning”, “API-Keys”, etc. Totally surprised to find scores, no probably 100s, of “Assistants” waiting to be used/called. Wow, BIG surprise. How do I clean this up? It’s really, REALLY to do this one at a time with movement and clicks of my mouse. I hope there’s an OpenAI tool, and that I don’t need to write a program to enumerate and delete.

1 Like

Well, I did have about 200 assistants “hanging around”. I let them go with code like the following:

from openai import OpenAI
client = OpenAI()

AssistantsList = client.beta.assistants.list()

import json
assistantsInJSON = json.loads(AssistantsList.model_dump_json())

assistantdata = assistantsInJSON[“data”]
for numitems in assistantdata:
print(“This asst id is: \n”, numitems[“id”])
DelResponse = client.beta.assistants.delete(numitems[“id”])
print(DelResponse)

exit()

1 Like

According to the guide, the assistants and threads created are not expired automatically. Users should reuse them or delete explicitly via the API or the dashboard.

** Objects related to the Assistants API are deleted from our servers 30 days after you delete them via the API or the dashboard. Objects that are not deleted via the API or dashboard are retained indefinitely.

Please check this link for more detail. https://platform.openai.com/docs/models/how-we-use-your-data