Skip to main content

Create Thread

Create a thread.

Request Body
messages object[]

A list of messages to start the thread with.

role Role8 REQUIRED

Possible values: [user]

The role of the entity that is creating the message. Currently only user is supported.

content Content REQUIRED

Possible values: 1 ≤ length ≤ 32768

The content of the message.

file_ids string[]

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

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.

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.

Responses
200

Successful Response

Schema OPTIONAL
_id Id OPTIONAL

MongoDB document ObjectID

id Id

The identifier, which can be referenced in API endpoints.

object Object23

Possible values: [thread]

The object type, which is always thread.

created_at Created At

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

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

422

Validation Error

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