Skip to main content
POST
/
v1
/
chat
/
sessions
Create chat session
curl --request POST \
  --url http://co-mind-platform-host/v1/chat/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-4o-mini",
  "name": "Q&A about Product Docs",
  "knowledgebase_ids": [
    "kb_abc123",
    "kb_def456"
  ],
  "temperature": 1,
  "system_message": "You are a helpful assistant."
}
'
{
  "id": "session_xyz789",
  "object": "chat.session",
  "name": "Q&A about Product Docs",
  "knowledgebase_ids": [
    "<string>"
  ],
  "model": "gpt-4o-mini",
  "temperature": 123,
  "system_message": "<string>",
  "created_at": 1699564800,
  "updated_at": 1699564900,
  "message_count": 10
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Supports two token types:

  • JWT Access Token — obtained via POST /v1/auth/login
  • Personal Access Token (PAT) — created via POST /v1/api-tokens, format: cmnd_<tokenId>.<secret>

Body

application/json
model
string
required

Model ID to use for this session

Example:

"gpt-4o-mini"

name
string

Optional name for the session

Example:

"Q&A about Product Docs"

knowledgebase_ids
string[]

Optional knowledge base IDs to attach to the session

Example:
["kb_abc123", "kb_def456"]
temperature
number
default:1

Sampling temperature

Required range: 0 <= x <= 2
system_message
string

Optional system message for the session

Example:

"You are a helpful assistant."

Response

Session created successfully

id
string
Example:

"session_xyz789"

object
string
Example:

"chat.session"

name
string
Example:

"Q&A about Product Docs"

knowledgebase_ids
string[]
model
string
Example:

"gpt-4o-mini"

temperature
number
system_message
string
created_at
integer

Unix timestamp

Example:

1699564800

updated_at
integer

Unix timestamp

Example:

1699564900

message_count
integer
Example:

10