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": {}
}

Authorizations

x-portkey-api-key
string
header
required
x-portkey-virtual-key
string
header
required

Body

application/json

Response

200 - application/json
OK

Represents a thread that contains messages.