Expire Time for Run Object in OpenAI Assistant API


I am currently working with the OpenAI Assistant API and have a question regarding the time constraints for function execution within the API workflow. Specifically, when a request to the API necessitates further action, such as the execution of a function, I understand there is a time limit within which the function’s results must be submitted back to the API.

I’m wondering if there’s any document mentioning about it? Or if there’s any way to setup the expiration time?


Hi Kaylin,

I am not sure there is a documented time limit - but usually there are a lot of other things that (also) create time limits. Can you share a little bit more what you are running into?

Sorry I didn’t make it clear. Within the Assistant API’s Run object, there is an argument called expired_at , as detailed here: https://platform.openai.com/docs/api-reference/runs/object#runs/object-expires_at.

I attempted to execute a Run, leading to perform tool calling. However, upon receiving the response and preparing to submit the tool output back to the run object, I encountered a ‘Bad Request’ error because the Run had expired.

Yet, in the document there’s no any further detailed information on it though.

When you investigate the run json, you can find that a function call waits for 600 Seconds to submit a reply. After 10 mins, it goes to expired state.

I have written a detailed blog post here: Explained Intuitively - Master the Art of Function Calling in OpenAI Assistants API: A Comprehensive Guide for Beginners


Thanks for the detailed reply. That’s really helpful, and the blog is also amazing.
However, I was still wondering if there’s any way to set this expiration time on our own.

1 Like