GET
/threads/{thread_id}/messagesList messages in a thread
Lists the messages belonging to a thread. Use limit, order, and cursor parameters to control the page, and use run_id to filter messages generated by a particular run.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
thread_idstringrequired
The identifier of the thread whose messages to list.
limitintegeroptional
Maximum number of messages to return, from 1 to 100. Defaults to 20 when omitted.
orderstringoptional
Sort order by creation time: `asc` or `desc`. Defaults to `desc` when omitted.
afterstringoptional
Cursor containing the message ID after which to return the next page.
beforestringoptional
Cursor containing the message ID before which to return the previous page.
run_idstringoptional
Filter the results to messages generated by the specified run.
200Returns a paginated message collection containing the object type, message data, first and last message IDs, and a `has_more` indicator.
objectstringrequired
dataarray<TheMessageObject>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.