Skip to main content
POST
/
messages
Python (Anthropic SDK)
from anthropic import Anthropic

client = Anthropic(
    auth_token="your-api-key",
    base_url="https://api.subconscious.dev",
)

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

print(message.content[0].text)
{
  "id": "msg_abc123",
  "content": [
    {
      "text": "<string>",
      "thinking": "<string>",
      "signature": "<string>",
      "id": "<string>",
      "name": "<string>",
      "input": {}
    }
  ],
  "model": "subconscious/tim-qwen3.6-27b",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_read_input_tokens": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.subconscious.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

API key from your Subconscious dashboard. Accepted by the Anthropic Messages endpoints in place of the Authorization header, for use with the Anthropic SDK.

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. Content is either a string or an array of content blocks (text, image, tool_use, tool_result, thinking).

Example:
[
  {
    "role": "user",
    "content": "What is the capital of France?"
  }
]
max_tokens
integer
required

The maximum number of tokens to generate before stopping. Required.

Example:

1024

system

A system prompt: a string or an array of text content blocks.

stream
boolean
default:false

If true, responses are streamed as Server-Sent Events using the Anthropic event protocol (message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop).

temperature
number

Amount of randomness injected into the response.

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

Nucleus sampling parameter.

Required range: 0 <= x <= 1
top_k
integer

Only sample from the top K options for each subsequent token.

stop_sequences
string[]

Custom text sequences that will cause the model to stop generating.

tools
object[]

Definitions of tools the model may use.

tool_choice
object

How the model should use the provided tools.

thinking
object

Enable extended thinking. When enabled, the response includes thinking content blocks before the final text block.

metadata
object

An object describing metadata about the request.

chat_template_kwargs
object

Subconscious extension. Controls model-specific features such as auto-compaction (Subconscious Cache).

Response

Successful message

id
string

A unique identifier for the message.

Example:

"msg_abc123"

type
enum<string>

The object type.

Available options:
message
role
enum<string>
Available options:
assistant
content
object[]

An array of content blocks. Text blocks ({type:"text", text}), thinking blocks ({type:"thinking", thinking, signature}), and tool_use blocks ({type:"tool_use", id, name, input}).

model
string
Example:

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

stop_reason
enum<string>

The reason the model stopped generating.

Available options:
end_turn,
max_tokens,
tool_use
stop_sequence
string | null

The custom stop sequence that was generated, if any.

usage
object