Sample - OpenAI API
GET/threads/{thread_id}/runs

List runs in a thread

Lists the runs belonging to a thread. Use limit, order, after, and before to page through runs in the required order.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

5 parameters
thread_idstringrequired
The identifier of the thread whose runs to list.
limitintegeroptional
Maximum number of runs to return, from 1 to 100. Defaults to 20 when omitted.
Default:20
orderstringoptional
Sort order by creation time: `asc` or `desc`. Defaults to `desc` when omitted.
Allowed:ascdescDefault:desc
afterstringoptional
Cursor containing the run ID after which to return the next page.
beforestringoptional
Cursor containing the run ID before which to return the previous page.

2 status codes
200Returns a paginated run collection containing the object type, run data, first and last run IDs, and a `has_more` indicator.
objectstringrequired
dataarray<ARunOnAThread>required
first_idstringrequired
last_idstringrequired
has_morebooleanrequired
429Returned when the request was rejected because a rate limit was exceeded.
errorobjectrequired

Error handling

A 429 is returned when the request exceeds the rate limit. limit must be between 1 and 100, order must be asc or desc, and thread_id must identify the target thread.