Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Messages

Build Assistants that can call models and use tools.

Create message
Deprecated
beta.threads.messages.create(thread_id, **kwargs) -> Message { id, assistant_id, attachments, 11 more }
POST/threads/{thread_id}/messages
Delete message
Deprecated
beta.threads.messages.delete(message_id, **kwargs) -> MessageDeleted { id, deleted, object }
DELETE/threads/{thread_id}/messages/{message_id}
List messages
Deprecated
beta.threads.messages.list(thread_id, **kwargs) -> CursorPage<Message { id, assistant_id, attachments, 11 more } >
GET/threads/{thread_id}/messages
Retrieve message
Deprecated
beta.threads.messages.retrieve(message_id, **kwargs) -> Message { id, assistant_id, attachments, 11 more }
GET/threads/{thread_id}/messages/{message_id}
Modify message
Deprecated
beta.threads.messages.update(message_id, **kwargs) -> Message { id, assistant_id, attachments, 11 more }
POST/threads/{thread_id}/messages/{message_id}
ModelsExpand Collapse
Annotation = FileCitationAnnotation { end_index, file_citation, start_index, 2 more } | FilePathAnnotation { end_index, file_path, start_index, 2 more }

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

AnnotationDelta = FileCitationDeltaAnnotation { index, type, end_index, 3 more } | FilePathDeltaAnnotation { index, type, end_index, 3 more }

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

class FileCitationAnnotation { end_index, file_citation, start_index, 2 more }

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

class FileCitationDeltaAnnotation { index, type, end_index, 3 more }

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

class FilePathAnnotation { end_index, file_path, start_index, 2 more }

A URL for the file that’s generated when the assistant used the code_interpreter tool to generate a file.

class FilePathDeltaAnnotation { index, type, end_index, 3 more }

A URL for the file that’s generated when the assistant used the code_interpreter tool to generate a file.

class ImageFile { file_id, detail }
class ImageFileContentBlock { image_file, type }

References an image File in the content of a message.

class ImageFileDelta { detail, file_id }
class ImageFileDeltaBlock { index, type, image_file }

References an image File in the content of a message.

class ImageURL { url, detail }
class ImageURLContentBlock { image_url, type }

References an image URL in the content of a message.

class ImageURLDelta { detail, url }
class ImageURLDeltaBlock { index, type, image_url }

References an image URL in the content of a message.

class Message { id, assistant_id, attachments, 11 more }

Represents a message within a thread.

MessageContent = ImageFileContentBlock { image_file, type } | ImageURLContentBlock { image_url, type } | TextContentBlock { text, type } | RefusalContentBlock { refusal, type }

References an image File in the content of a message.

MessageContentDelta = ImageFileDeltaBlock { index, type, image_file } | TextDeltaBlock { index, type, text } | RefusalDeltaBlock { index, type, refusal } | ImageURLDeltaBlock { index, type, image_url }

References an image File in the content of a message.

MessageContentPartParam = ImageFileContentBlock { image_file, type } | ImageURLContentBlock { image_url, type } | TextContentBlockParam { text, type }

References an image File in the content of a message.

class MessageDeleted { id, deleted, object }
class MessageDelta { content, role }

The delta containing the fields that have changed on the Message.

class MessageDeltaEvent { id, delta, object }

Represents a message delta i.e. any changed fields on a message during streaming.

class RefusalContentBlock { refusal, type }

The refusal content generated by the assistant.

class RefusalDeltaBlock { index, type, refusal }

The refusal content that is part of a message.

class Text { annotations, value }
class TextContentBlock { text, type }

The text content that is part of a message.

class TextContentBlockParam { text, type }

The text content that is part of a message.

class TextDelta { annotations, value }
class TextDeltaBlock { index, type, text }

The text content that is part of a message.