Chat

Get chat messages

Changed on

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.

get/chat/completions/{completion_id}/messages

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/chat/completions/{completion_id}/messages
  • Auth
    HTTP bearer

Path parameters

completion_idstring required

The ID of the chat completion to retrieve messages from.

Query parameters

afterstring

Identifier for the last message from the previous pagination request.

limitinteger

Number of messages to retrieve.

order'asc' | 'desc'

Sort order for messages by timestamp. Use asc for ascending order or desc for descending order. Defaults to asc.

Response

A list of messages

object'list' required

The type of this object. It is always set to "list".

first_idstring nullable required

The identifier of the first chat message in the data array.

last_idstring nullable required

The identifier of the last chat message in the data array.

has_moreboolean required

Indicates whether there are more chat messages available.

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the / response's property type changed from no type to object for status

    • info

      added the optional property // to the response with the status

    • info

      removed subschema #2 from the / response property allOf list for the response status

    • info

      added the required property // to the response with the status

    • info

      added the required property // to the response with the status

    • info

      added the required property // to the response with the status

    • info

      added the required property // to the response with the status