GET
/chat/completions/{completion_id}/messagesGet 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.
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.
orderstringoptional
Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`.
200A list of messages
objectstringrequired
The type of this object. It is always set to "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.
400Invalid message pagination parameters.
errorobjectrequired
404No stored chat completion was found with the specified ID.
errorobjectrequired
429The request was rejected because a rate limit was exceeded.
errorobjectrequired
500An internal error prevented the request from being completed.
errorobjectrequired
Error handling
A 400 is returned: Invalid message pagination parameters. A 404 is returned: No stored chat completion was found with the specified ID. A 429 is returned: The request was rejected because a rate limit was exceeded. A 500 is returned: An internal error prevented the request from being completed.