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/glm-5.3-marathon",
max_tokens=1024,
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
authToken: "your-api-key",
baseURL: "https://api.subconscious.dev",
});
const message = await client.messages.create({
model: "subconscious/glm-5.3-marathon",
max_tokens: 1024,
messages: [{ role: "user", content: "What is the capital of France?" }],
});
console.log(message.content[0].text);curl https://api.subconscious.dev/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "subconscious/glm-5.3-marathon",
"max_tokens": 1024,
"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/messages",
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/glm-5.3-marathon',
'messages' => [
[
'role' => 'user',
'content' => 'What is the capital of France?'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'stream' => false,
'temperature' => 0.5,
'top_p' => 0.5,
'top_k' => 123,
'stop_sequences' => [
'<string>'
],
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'thinking' => [
'type' => 'enabled',
'budget_tokens' => 123
],
'metadata' => [
'user_id' => '<string>'
],
'chat_template_kwargs' => [
'enable_auto_compaction' => true
],
'session_id' => '<string>',
'providerOptions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/messages"
payload := strings.NewReader("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.subconscious.dev/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "<string>",
"thinking": "<string>",
"signature": "<string>",
"id": "<string>",
"name": "<string>",
"input": {}
}
],
"model": "subconscious/glm-5.3-marathon",
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_read_input_tokens": 123
}
}Endpoints
Create Message
Generates a model response for the given conversation. This endpoint is fully compatible with the Anthropic Messages API, so you can use the Anthropic SDK by pointing its base URL at Subconscious.
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/glm-5.3-marathon",
max_tokens=1024,
messages=[{"role": "user", "content": "What is the capital of France?"}],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
authToken: "your-api-key",
baseURL: "https://api.subconscious.dev",
});
const message = await client.messages.create({
model: "subconscious/glm-5.3-marathon",
max_tokens: 1024,
messages: [{ role: "user", content: "What is the capital of France?" }],
});
console.log(message.content[0].text);curl https://api.subconscious.dev/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "subconscious/glm-5.3-marathon",
"max_tokens": 1024,
"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/messages",
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/glm-5.3-marathon',
'messages' => [
[
'role' => 'user',
'content' => 'What is the capital of France?'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'stream' => false,
'temperature' => 0.5,
'top_p' => 0.5,
'top_k' => 123,
'stop_sequences' => [
'<string>'
],
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'thinking' => [
'type' => 'enabled',
'budget_tokens' => 123
],
'metadata' => [
'user_id' => '<string>'
],
'chat_template_kwargs' => [
'enable_auto_compaction' => true
],
'session_id' => '<string>',
'providerOptions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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/messages"
payload := strings.NewReader("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.subconscious.dev/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"What is the capital of France?\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"stream\": false,\n \"temperature\": 0.5,\n \"top_p\": 0.5,\n \"top_k\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budget_tokens\": 123\n },\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"chat_template_kwargs\": {\n \"enable_auto_compaction\": true\n },\n \"session_id\": \"<string>\",\n \"providerOptions\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_abc123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "<string>",
"thinking": "<string>",
"signature": "<string>",
"id": "<string>",
"name": "<string>",
"input": {}
}
],
"model": "subconscious/glm-5.3-marathon",
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_read_input_tokens": 123
}
}Authorizations
apiKeyAuthbearerAuth
Headers
Labels your traffic in usage views. See Request correlation.
Groups requests into one conversation (replace yourapp with your app name). See Session affinity.
Nests a subagent under the conversation that spawned it. See Subagent correlation.
Body
application/json
Body session id, also spelled sessionId and providerOptions.gateway.sessionId. Between 8 and 256 characters. See Session affinity.
Required string length:
8 - 256Vercel AI SDK provider options. Only gateway.sessionId is read, as a body session id. See Session affinity.
Response
Successful message
Was this page helpful?