Sample - OpenAI API
GET/chat/completions/{completion_id}/messages

Get chat messages

Get the messages in a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned.

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

4 parameters
completion_idstringrequired
The ID of the chat completion to retrieve messages from.
afterstringoptional
Identifier for the last message from the previous pagination request.
limitintegeroptional
Number of messages to retrieve.
Default:20
orderstringoptional
Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
Allowed:ascdescDefault:asc

1 status code
200A list of messages
objectstringrequired
The type of this object. It is always set to "list".
Allowed:listDefault:list
dataarray<object>required
An array of chat completion message objects.
first_idstringrequired
The identifier of the first chat message in the data array.
last_idstringrequired
The identifier of the last chat message in the data array.
has_morebooleanrequired
Indicates whether there are more chat messages available.