Skip to main content

Get Message

Retrieve a message from a thread.

Path Parameters
thread_id Thread Id REQUIRED
message_id Message Id REQUIRED

Successful Response


MongoDB document ObjectID

id Id

The identifier, which can be referenced in API endpoints.

object Object25

Possible values: [thread.message]

The object type, which is always thread.message.

created_at Created At

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

thread_id Thread Id

The thread ID that this message belongs to.

role Role7

Possible values: [user, assistant, tool_call, tool_output]

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

content undefined[]

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

assistant_id Assistant Id

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

run_id Run Id

If applicable, the ID of the run associated with the authoring of this message.

file_ids string[]

A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access files. A maximum of 10 files can be attached to a message.

metadata object

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 maxium of 512 characters long.


Validation Error

detail object[] OPTIONAL
loc undefined[]
msg Message
type Error Type