API Reference
- Introduction
- Authentication
- Headers
- Errors
- Supported Providers
- SDKs
- API Details
Chat Completions
Portkey Endpoints
Embeddings
Other APIs
Completions
Moderations
Fine-tuning
Assistants
- Assistants
- Threads
- Messages
- Runs
- Run Steps
Create Thread
POST
/
threads
curl https://api.portkey.ai/v1/threads \
-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 '{
"messages": [{
"role": "user",
"content": "Hello, what is AI?"
}, {
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}]
}'
{
"id": "<string>",
"object": "thread",
"created_at": 123,
"tool_resources": {
"code_interpreter": {
"file_ids": []
},
"file_search": {
"vector_store_ids": [
"<string>"
]
}
},
"metadata": {}
}
Body
application/json
Response
200 - application/json
OK
Represents a thread that contains messages.
Was this page helpful?
curl https://api.portkey.ai/v1/threads \
-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 '{
"messages": [{
"role": "user",
"content": "Hello, what is AI?"
}, {
"role": "user",
"content": "How does AI work? Explain it in simple terms."
}]
}'
{
"id": "<string>",
"object": "thread",
"created_at": 123,
"tool_resources": {
"code_interpreter": {
"file_ids": []
},
"file_search": {
"vector_store_ids": [
"<string>"
]
}
},
"metadata": {}
}