Skip to main content
POST
/
chat
/
completions
Kick off a agent with our OpenAI-compatible API
curl --request POST \
  --url https://api.subconscious.dev/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "tim-small-preview",
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "max_tokens": 2,
  "temperature": 1,
  "top_p": 1,
  "stream": false,
  "stop": "<string>",
  "presence_penalty": 0,
  "frequency_penalty": 0
}'
{
  "id": "<string>",
  "object": "<string>",
  "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 using your API key generated on the Subconscious platform

Body

application/json

Chat completion request

model
enum<string>
required

API ID of the model to use

Available options:
tim-small-preview,
tim-large
messages
object[]
required

A list of messages comprising the conversation so far

max_tokens
integer

The maximum number of tokens to generate in the chat completion

Required range: x >= 1
temperature
number
default:1

What sampling temperature to use, between 0 and 2

Required range: 0 <= x <= 2
top_p
number
default:1

An alternative to sampling with temperature

Required range: 0 <= x <= 1
stream
boolean
default:false

If set, partial message deltas will be sent

stop

Up to 4 sequences where the API will stop generating further tokens

presence_penalty
number
default:0

Number between -2.0 and 2.0

Required range: -2 <= x <= 2
frequency_penalty
number
default:0

Number between -2.0 and 2.0

Required range: -2 <= x <= 2

Response

Chat completion response

id
string
required

A unique identifier for the chat completion

object
string
required

The object type, which is always 'chat.completion'

created
integer
required

The Unix timestamp (in seconds) of when the chat completion was created

model
string
required

The model used for the chat completion

choices
object[]
required

A list of chat completion choices

usage
object
I