检索消息

Retrieve a message.

get
/threads/{thread_id}/messages/{message_id}
Authorizations
x-portkey-api-keystringRequired
x-portkey-virtual-keystringRequired
Path parameters
thread_idstringRequired

The ID of the thread to which this message belongs.

message_idstringRequired

The ID of the message to retrieve.

Responses
chevron-right
200

OK

application/json

Represents a message within a thread.

idstringRequired

The identifier, which can be referenced in API endpoints.

objectstring · enumRequired

The object type, which is always thread.message.

Possible values:
created_atintegerRequired

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

thread_idstringRequired

The thread ID that this message belongs to.

statusstring · enumRequired

The status of the message, which can be either in_progress, incomplete, or completed.

Possible values:
completed_atinteger · nullableRequired

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

incomplete_atinteger · nullableRequired

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

rolestring · enumRequired

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

Possible values:
assistant_idstring · nullableRequired

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

run_idstring · nullableRequired

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.

metadataobject · nullableRequired

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.

get
/threads/{thread_id}/messages/{message_id}
200

OK

Last updated