List Messages
The ID of the thread the messages belong to.
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
20
Sort order by the created_at
timestamp of the objects. asc
for ascending order and desc
for descending order.
desc
Possible values: 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, ending 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.
curl https://api.portkey.ai/v1/threads/thread_abc123/messages \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "OpenAI-Beta: assistants=v2"
OK
{
"object": "list",
"data": [
{
"id": "text",
"object": "thread.message",
"created_at": 1,
"thread_id": "text",
"status": "in_progress",
"incomplete_details": {
"reason": "content_filter"
},
"completed_at": 1,
"incomplete_at": 1,
"role": "user",
"content": [
{
"type": "image_file",
"image_file": {
"file_id": "text",
"detail": "auto"
}
}
],
"assistant_id": "text",
"run_id": "text",
"attachments": [
{
"file_id": "text",
"tools": [
{
"type": "code_interpreter"
}
]
}
],
"metadata": {}
}
],
"first_id": "msg_abc123",
"last_id": "msg_abc123",
"has_more": false
}
Last updated
Was this helpful?