List messages (v1)
GET
https://api.openai.com/v1/threads/thread_abc123/messagesReturns a list of messages for a given thread.
Request
Header Params
Content-Type
string
required
Example:
application/json
Authorization
string
required
Example:
Bearer $OPENAI_API_KEY
OpenAI-Beta
string
required
Example:
assistants=v1
Body Params text/plain
Request samples
Responses
Success(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
object
string
required
data
array [object {10}]
required
id
string
required
object
string
required
created_at
integer
required
thread_id
string
required
role
string
required
content
array [object {2}]
required
file_ids
array[string]
required
assistant_id
null
required
run_id
null
required
metadata
object
required
first_id
string
required
last_id
string
required
has_more
boolean
required
Example
{
"object": "list",
"data": [
{
"id": "msg_abc123",
"object": "thread.message",
"created_at": 1699016383,
"thread_id": "thread_abc123",
"role": "user",
"content": [
{
"type": "text",
"text": {
"value": "How does AI work? Explain it in simple terms.",
"annotations": []
}
}
],
"file_ids": [],
"assistant_id": null,
"run_id": null,
"metadata": {}
},
{
"id": "msg_abc456",
"object": "thread.message",
"created_at": 1699016383,
"thread_id": "thread_abc123",
"role": "user",
"content": [
{
"type": "text",
"text": {
"value": "Hello, what is AI?",
"annotations": []
}
}
],
"file_ids": [
"file-abc123"
],
"assistant_id": null,
"run_id": null,
"metadata": {}
}
],
"first_id": "msg_abc123",
"last_id": "msg_abc456",
"has_more": false
}
Last modified: 2 months ago