Creates a new message on a specified thread.

post/threads/{threadId}/messages

Path parameters

threadIdstring required

Identifier of the thread.

Query parameters

api-versionstring required

The API version to use for this operation.

Request body

role'user' | 'assistant' required

The possible values for roles attributed to messages in a thread.

{"stackTrail":"components:schemas:MessageInputContent","oasType":"schema","type":"unknown"}
metadataobject nullable

A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

Response

A representation of the new message.

idstring required

The identifier, which can be referenced in API endpoints.

object'thread.message' required

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

created_atinteger required

The Unix timestamp, in seconds, representing when this object was created.

thread_idstring required

The ID of the thread that this message belongs to.

status'in_progress' | 'incomplete' | 'completed' required

The possible execution status values for a thread message.

completed_atinteger nullable required

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

incomplete_atinteger nullable required

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

role'user' | 'assistant' required

The possible values for roles attributed to messages in a thread.

assistant_idstring nullable required

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

run_idstring nullable required

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

metadataobject nullable required

A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

Changes

No recorded changes to this endpoint across all 12 revisions of this API.