The message object
Beta

Represents a message within a thread.source

The identifier, which can be referenced in API endpoints.source

The object type, which is always thread.message.source

The Unix timestamp (in seconds) for when the message was created.source

The thread ID that this message belongs to.source

The status of the message, which can be either in_progress, incomplete, or completed.source

On an incomplete message, details about why the message is incomplete.source

The Unix timestamp (in seconds) for when the message was completed.source

The Unix timestamp (in seconds) for when the message was marked as incomplete.source

The entity that produced the message. One of user or assistant.source

The content of the message in array of text and/or images.source

If applicable, the ID of the assistant that authored this message.source

The ID of the run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.source

A list of files attached to the message, and the tools they were added to.source

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.source

OBJECT The message object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "id": "msg_abc123",
  "object": "thread.message",
  "created_at": 1698983503,
  "thread_id": "thread_abc123",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": {
        "value": "Hi! How can I help you today?",
        "annotations": []
      }
    }
  ],
  "assistant_id": "asst_abc123",
  "run_id": "run_abc123",
  "attachments": [],
  "metadata": {}
}