Messages
Create Message
Chat Completions
Portkey Endpoints
Embeddings
Other APIs
Completions
Moderations
Fine-tuning
Assistants
- Assistants
- Threads
- Messages
- Runs
- Run Steps
Create Message
POST
/
threads
/
{thread_id}
/
messages
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" \
-d '{
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}'
{
"id": "<string>",
"object": "thread.message",
"created_at": 123,
"thread_id": "<string>",
"status": "in_progress",
"incomplete_details": {
"reason": "content_filter"
},
"completed_at": 123,
"incomplete_at": 123,
"role": "user",
"content": [
{
"type": "image_file",
"image_file": {
"file_id": "<string>",
"detail": "auto"
}
}
],
"assistant_id": "<string>",
"run_id": "<string>",
"attachments": [
{
"file_id": "<string>",
"tools": [
{
"type": "code_interpreter"
}
]
}
],
"metadata": {}
}
Body
application/json
Response
200 - application/json
OK
Represents a message within a thread.
Was this page helpful?
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" \
-d '{
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}'
{
"id": "<string>",
"object": "thread.message",
"created_at": 123,
"thread_id": "<string>",
"status": "in_progress",
"incomplete_details": {
"reason": "content_filter"
},
"completed_at": 123,
"incomplete_at": 123,
"role": "user",
"content": [
{
"type": "image_file",
"image_file": {
"file_id": "<string>",
"detail": "auto"
}
}
],
"assistant_id": "<string>",
"run_id": "<string>",
"attachments": [
{
"file_id": "<string>",
"tools": [
{
"type": "code_interpreter"
}
]
}
],
"metadata": {}
}