Skip to main content
POST
/
v1
/
chat
/
completions
Create chat completion
curl --request POST \
  --url http://co-mind-platform-host/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "llama3.2:3b",
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "temperature": 1,
  "max_tokens": 2,
  "top_p": 1,
  "stream": false,
  "tools": [
    "<unknown>"
  ]
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "system",
        "content": "<string>",
        "name": "<string>"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

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
Example:

"llama3.2:3b"

messages
object[]
required
temperature
number
default:1
Required range: 0 <= x <= 2
max_tokens
integer
Required range: x >= 1
top_p
number
default:1
Required range: 0 <= x <= 1
stream
boolean
default:false
tools
any[]

Response

Successful response

id
string
Example:

"chatcmpl-abc123"

object
string
Example:

"chat.completion"

created
integer
model
string
choices
object[]
usage
object