Skip to main content
GET
/
v1
/
chat
/
completions
/
{completion_id}
/
messages
Chat Completion Messages
curl --request GET \
  --url https://api.example.com/v1/chat/completions/{completion_id}/messages
{
  "data": [
    {
      "id": "<string>",
      "role": "<string>",
      "content": "<string>",
      "content_parts": [
        {
          "text": "<string>",
          "type": "input_text"
        }
      ],
      "name": "<string>"
    }
  ],
  "first_id": "<string>",
  "has_more": true,
  "last_id": "<string>",
  "object": "<string>"
}

Path Parameters

completion_id
string
required

ID of the chat completion

Query Parameters

after
string

Identifier for the last message from the previous pagination request.

limit
integer<int32>

Number of messages to retrieve.

Required range: x >= 0
order
string

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

Response

Chat completion messages gotten successfully

Represents a list of messages in a chat completion.

data
object[]
required

A list of chat messages.

first_id
string
required

The ID of the first message in the list.

has_more
boolean
required

Whether there are more messages to retrieve.

last_id
string
required

The ID of the last message in the list.

object
string
required

The object type, which is always list.