Swagger Petstore - OpenAPI 3.0
GET/chat/completions/{completion_id}/messages

List messages from a stored chat completion

Retrieves the messages contained within a stored chat completion in paginated form. Only chat completions created with the store parameter set to true will be returned. Results can be sorted chronologically in ascending or descending order.

4 parameters
completion_idstringrequired
The unique identifier of the chat completion to retrieve messages from.
afterstringoptional
Pagination cursor. Pass the identifier of the last message from the previous request to fetch the next page.
limitintegeroptional
Number of messages to retrieve per page. Defaults to 20 when omitted.
Default:20
orderstringoptional
Sort order for messages by timestamp: `asc` for ascending or `desc` for descending. Defaults to `asc` when omitted.
Allowed:ascdescDefault:asc

1 status code
200Returns a paginated list of message objects with metadata including the first and last message identifiers and a flag indicating whether more messages are available.
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.

Error handling

completion_id must identify an existing chat completion that was created with store set to true. limit must be a positive integer, and order must be either asc or desc.