Skip to main content
POST
/
v1
/
completions
Create text completion
curl --request POST \
  --url http://co-mind-platform-host/v1/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "temperature": 1,
  "max_tokens": 16,
  "top_p": 1,
  "stream": false
}
'
{
  "id": "<string>",
  "object": "text_completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "text": "<string>",
      "index": 123,
      "finish_reason": "<string>"
    }
  ],
  "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
prompt
string
required
temperature
number
default:1
Required range: 0 <= x <= 2
max_tokens
integer
default:16
top_p
number
default:1
Required range: 0 <= x <= 1
stream
boolean
default:false

Response

Successful response

id
string
object
string
Example:

"text_completion"

created
integer
model
string
choices
object[]
usage
object