Create message
Deprecated
POST/threads/{thread_id}/messages
Create a message.
Path Parameters
thread_id: string
Body ParametersJSON
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, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Returns
Create message
curl https://api.openai.com/v1/threads/$THREAD_ID/messages \
-H 'Content-Type: application/json' \
-H 'OpenAI-Beta: assistants=v2' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"content": "string",
"role": "user"
}'{
"id": "id",
"assistant_id": "assistant_id",
"attachments": [
{
"file_id": "file_id",
"tools": [
{
"type": "code_interpreter"
}
]
}
],
"completed_at": 0,
"content": [
{
"image_file": {
"file_id": "file_id",
"detail": "auto"
},
"type": "image_file"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"metadata": {
"foo": "string"
},
"object": "thread.message",
"role": "user",
"run_id": "run_id",
"status": "in_progress",
"thread_id": "thread_id"
}Returns Examples
{
"id": "id",
"assistant_id": "assistant_id",
"attachments": [
{
"file_id": "file_id",
"tools": [
{
"type": "code_interpreter"
}
]
}
],
"completed_at": 0,
"content": [
{
"image_file": {
"file_id": "file_id",
"detail": "auto"
},
"type": "image_file"
}
],
"created_at": 0,
"incomplete_at": 0,
"incomplete_details": {
"reason": "content_filter"
},
"metadata": {
"foo": "string"
},
"object": "thread.message",
"role": "user",
"run_id": "run_id",
"status": "in_progress",
"thread_id": "thread_id"
}