Skip to main content
POST
/
chat
/
completions
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(
    api_key="your-api-key",
    base_url="https://api.subconscious.dev/v1",
)

response = client.chat.completions.create(
    model="subconscious/tim-qwen3.6-27b",
    messages=[{"role": "user", "content": "What is the capital of France?"}],
)

print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
apiKey: "your-api-key",
baseURL: "https://api.subconscious.dev/v1",
});

const response = await client.chat.completions.create({
model: "subconscious/tim-qwen3.6-27b",
messages: [{ role: "user", content: "What is the capital of France?" }],
});

console.log(response.choices[0].message.content);
curl https://api.subconscious.dev/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "subconscious/tim-qwen3.6-27b",
"messages": [{"role": "user", "content": "What is the capital of France?"}]
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.subconscious.dev/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'subconscious/tim-qwen3.6-27b',
'messages' => [
[
'role' => 'user',
'content' => 'What is the capital of France?'
]
],
'stream' => false,
'max_tokens' => 123,
'max_completion_tokens' => 123,
'temperature' => 1,
'top_p' => 0.5,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'stop' => '<string>',
'response_format' => [
'json_schema' => [
'name' => '<string>',
'schema' => [

]
]
],
'stream_options' => [
'include_usage' => true
],
'chat_template_kwargs' => [
'enable_thinking' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.subconscious.dev/v1/chat/completions"

payload := strings.NewReader("{\n \"model\": \"subconscious/tim-qwen3.6-27b\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop\": \"<string>\",\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": {}\n }\n },\n \"stream_options\": {\n \"include_usage\": true\n },\n \"chat_template_kwargs\": {\n \"enable_thinking\": true\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.subconscious.dev/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"subconscious/tim-qwen3.6-27b\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop\": \"<string>\",\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": {}\n }\n },\n \"stream_options\": {\n \"include_usage\": true\n },\n \"chat_template_kwargs\": {\n \"enable_thinking\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.subconscious.dev/v1/chat/completions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"subconscious/tim-qwen3.6-27b\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"stream\": false,\n \"max_tokens\": 123,\n \"max_completion_tokens\": 123,\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"frequency_penalty\": 0,\n \"presence_penalty\": 0,\n \"stop\": \"<string>\",\n \"response_format\": {\n \"json_schema\": {\n \"name\": \"<string>\",\n \"schema\": {}\n }\n },\n \"stream_options\": {\n \"include_usage\": true\n },\n \"chat_template_kwargs\": {\n \"enable_thinking\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1716000000,
  "model": "subconscious/tim-qwen3.6-27b",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "<string>"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

API key from your Subconscious dashboard

Body

application/json
model
enum<string>
required

The model to use for completion.

Available options:
subconscious/tim-qwen3.6-27b
Example:

"subconscious/tim-qwen3.6-27b"

messages
object[]
required

The conversation history. Each message has a role and content.

Example:
[
{
"role": "user",
"content": "What is the capital of France?"
}
]
stream
boolean
default:false

If true, responses are streamed as Server-Sent Events. Each event is a ChatCompletionChunk object. The stream ends with data: [DONE].

max_tokens
integer

Maximum number of tokens to generate in the response.

max_completion_tokens
integer

An alternative to max_tokens. Maximum number of tokens to generate.

temperature
number

Sampling temperature between 0 and 2. Lower values make output more focused and deterministic, while higher values make it more creative.

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

Nucleus sampling parameter. Only considers tokens whose cumulative probability exceeds this threshold.

Required range: 0 <= x <= 1
frequency_penalty
number

Penalizes tokens based on their frequency in the text so far.

Required range: -2 <= x <= 2
presence_penalty
number

Penalizes tokens based on whether they appear in the text so far.

Required range: -2 <= x <= 2
stop

Up to 4 sequences where the model will stop generating.

response_format
object

Constrains the response format. Use {"type": "json_object"} for valid JSON or {"type": "json_schema", "json_schema": {...}} for schema-constrained output.

stream_options
object

Options for streaming responses.

chat_template_kwargs
object

Subconscious extension. Controls model-specific features like thinking mode.

Response

Successful completion

id
string

A unique identifier for the completion.

Example:

"chatcmpl-abc123"

object
enum<string>

The object type.

Available options:
chat.completion
created
integer

Unix timestamp of when the completion was created.

Example:

1716000000

model
string

The model used for the completion.

Example:

"subconscious/tim-qwen3.6-27b"

choices
object[]
usage
object