The ID of the thread to delete.
Delete a thread.
Path Parameters
Response
200 application/json
Response
OK
DeleteThreadResponse
Allowed values:thread.deleted
Authentication
Path Parameters
Returns a list of messages for a given thread.
Query Parameters
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Default:20
Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.
Allowed values:ascdesc
Default:desc
A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
Filter messages by the run ID that generated them.
Path Parameters
The ID of the thread the messages belong to.
Response
200 application/json
Response
OK
ListMessagesResponse
Example:list
Represents a message within a thread.
Show Child Parameters
Example:msg_abc123
Example:msg_abc123
Example:false
Authentication
Path Parameters
Query Parameters
Create a message.
Path Parameters
The ID of the thread to create a message for.
Body
application/json
Body
CreateMessageRequest
The role of the entity that is creating the message. Allowed values include:
user: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.assistant: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
Allowed values:userassistant
One OfThe text contents of the message.
A list of files attached to the message, and the tools they should be added to.
Show Child Parameters
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.
Response
200 application/json
Response
OK
The message object
Represents a message within a thread.
The identifier, which can be referenced in API endpoints.
The object type, which is always thread.message.
Allowed values:thread.message
The Unix timestamp (in seconds) for when the message was created.
The thread ID that this message belongs to.
The status of the message, which can be either in_progress, incomplete, or completed.
Allowed values:in_progressincompletecompleted
On an incomplete message, details about why the message is incomplete.
Show Child Parameters
The Unix timestamp (in seconds) for when the message was completed.
The Unix timestamp (in seconds) for when the message was marked as incomplete.
The entity that produced the message. One of user or assistant.
Allowed values:userassistant
One OfThe content of the message in array of text and/or images.
References an image File in the content of a message.
Show Child Parameters
If applicable, the ID of the assistant that authored this message.
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.
A list of files attached to the message, and the tools they were added to.
Show Child Parameters
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.
Authentication
Path Parameters
Body
Retrieve a message.
Path Parameters
The ID of the thread to which this message belongs.
The ID of the message to retrieve.
Response
200 application/json
Response
OK
The message object
Represents a message within a thread.
The identifier, which can be referenced in API endpoints.
The object type, which is always thread.message.
Allowed values:thread.message
The Unix timestamp (in seconds) for when the message was created.
The thread ID that this message belongs to.
The status of the message, which can be either in_progress, incomplete, or completed.
Allowed values:in_progressincompletecompleted
On an incomplete message, details about why the message is incomplete.
Show Child Parameters
The Unix timestamp (in seconds) for when the message was completed.
The Unix timestamp (in seconds) for when the message was marked as incomplete.
The entity that produced the message. One of user or assistant.
Allowed values:userassistant
One OfThe content of the message in array of text and/or images.
References an image File in the content of a message.
Show Child Parameters
If applicable, the ID of the assistant that authored this message.
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.
A list of files attached to the message, and the tools they were added to.
Show Child Parameters
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.
Authentication
Path Parameters
Modifies a message.
Path Parameters
The ID of the thread to which this message belongs.
The ID of the message to modify.
Body
application/json
Body
ModifyMessageRequest
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.
Response
200 application/json
Response
OK
The message object
Represents a message within a thread.
The identifier, which can be referenced in API endpoints.
The object type, which is always thread.message.
Allowed values:thread.message
The Unix timestamp (in seconds) for when the message was created.
The thread ID that this message belongs to.
The status of the message, which can be either in_progress, incomplete, or completed.
Allowed values:in_progressincompletecompleted
On an incomplete message, details about why the message is incomplete.
Show Child Parameters
The Unix timestamp (in seconds) for when the message was completed.
The Unix timestamp (in seconds) for when the message was marked as incomplete.
The entity that produced the message. One of user or assistant.
Allowed values:userassistant
One OfThe content of the message in array of text and/or images.
References an image File in the content of a message.
Show Child Parameters
If applicable, the ID of the assistant that authored this message.
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.
A list of files attached to the message, and the tools they were added to.
Show Child Parameters
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.