from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.subconscious.dev/v1",
)
response = client.responses.create(
model="subconscious/glm-5.3-marathon",
input="What is the capital of France?",
)
print(response.output_text)curl https://api.subconscious.dev/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "subconscious/glm-5.3-marathon",
"input": "What is the capital of France?"
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'subconscious/glm-5.3-marathon',
input: 'Write a haiku about GPUs.',
instructions: '<string>',
tools: [{}],
tool_choice: '<unknown>',
parallel_tool_calls: true,
reasoning: {},
store: false,
stream: false,
stream_options: {},
max_output_tokens: 123,
text: {},
metadata: {},
previous_response_id: '<string>',
include: ['<string>'],
service_tier: '<string>',
prompt_cache_key: '<string>',
session_id: '<string>',
providerOptions: {},
return_subconscious_cache_stats: true,
chat_template_kwargs: {}
})
};
fetch('https://api.subconscious.dev/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.subconscious.dev/v1/responses",
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',
'input' => 'Write a haiku about GPUs.',
'instructions' => '<string>',
'tools' => [
[
]
],
'tool_choice' => '<unknown>',
'parallel_tool_calls' => true,
'reasoning' => [
],
'store' => false,
'stream' => false,
'stream_options' => [
],
'max_output_tokens' => 123,
'text' => [
],
'metadata' => [
],
'previous_response_id' => '<string>',
'include' => [
'<string>'
],
'service_tier' => '<string>',
'prompt_cache_key' => '<string>',
'session_id' => '<string>',
'providerOptions' => [
],
'return_subconscious_cache_stats' => true,
'chat_template_kwargs' => [
]
]),
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/responses"
payload := strings.NewReader("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\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/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.subconscious.dev/v1/responses")
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/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_abc123",
"object": "response",
"created_at": 1716000000,
"model": "subconscious/glm-5.3-marathon",
"output": [
{}
],
"prompt_cache_key": "<string>"
}Create Response
Generates a model response from an input sequence. This endpoint is compatible with the OpenAI Responses API, which Codex and the Vercel AI SDK use. Session affinity works the same as on chat completions: a body session id, a session header, or prompt_cache_key groups requests into one conversation.
from openai import OpenAI
client = OpenAI(
api_key="your-api-key",
base_url="https://api.subconscious.dev/v1",
)
response = client.responses.create(
model="subconscious/glm-5.3-marathon",
input="What is the capital of France?",
)
print(response.output_text)curl https://api.subconscious.dev/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "subconscious/glm-5.3-marathon",
"input": "What is the capital of France?"
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'subconscious/glm-5.3-marathon',
input: 'Write a haiku about GPUs.',
instructions: '<string>',
tools: [{}],
tool_choice: '<unknown>',
parallel_tool_calls: true,
reasoning: {},
store: false,
stream: false,
stream_options: {},
max_output_tokens: 123,
text: {},
metadata: {},
previous_response_id: '<string>',
include: ['<string>'],
service_tier: '<string>',
prompt_cache_key: '<string>',
session_id: '<string>',
providerOptions: {},
return_subconscious_cache_stats: true,
chat_template_kwargs: {}
})
};
fetch('https://api.subconscious.dev/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.subconscious.dev/v1/responses",
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',
'input' => 'Write a haiku about GPUs.',
'instructions' => '<string>',
'tools' => [
[
]
],
'tool_choice' => '<unknown>',
'parallel_tool_calls' => true,
'reasoning' => [
],
'store' => false,
'stream' => false,
'stream_options' => [
],
'max_output_tokens' => 123,
'text' => [
],
'metadata' => [
],
'previous_response_id' => '<string>',
'include' => [
'<string>'
],
'service_tier' => '<string>',
'prompt_cache_key' => '<string>',
'session_id' => '<string>',
'providerOptions' => [
],
'return_subconscious_cache_stats' => true,
'chat_template_kwargs' => [
]
]),
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/responses"
payload := strings.NewReader("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\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/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"subconscious/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.subconscious.dev/v1/responses")
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/glm-5.3-marathon\",\n \"input\": \"Write a haiku about GPUs.\",\n \"instructions\": \"<string>\",\n \"tools\": [\n {}\n ],\n \"tool_choice\": \"<unknown>\",\n \"parallel_tool_calls\": true,\n \"reasoning\": {},\n \"store\": false,\n \"stream\": false,\n \"stream_options\": {},\n \"max_output_tokens\": 123,\n \"text\": {},\n \"metadata\": {},\n \"previous_response_id\": \"<string>\",\n \"include\": [\n \"<string>\"\n ],\n \"service_tier\": \"<string>\",\n \"prompt_cache_key\": \"<string>\",\n \"session_id\": \"<string>\",\n \"providerOptions\": {},\n \"return_subconscious_cache_stats\": true,\n \"chat_template_kwargs\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_abc123",
"object": "response",
"created_at": 1716000000,
"model": "subconscious/glm-5.3-marathon",
"output": [
{}
],
"prompt_cache_key": "<string>"
}Authorizations
API key from your Subconscious dashboard
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
The model to use.
subconscious/glm-5.3-marathon "subconscious/glm-5.3-marathon"
The input to the model. A string, or an array of input items in the OpenAI Responses format, such as messages, function calls, and function call outputs.
"Write a haiku about GPUs."
System instructions for the model.
Tools the model may call. OpenAI function tool shapes are accepted.
Controls which tool the model calls. Pass none, auto, required, or a function shape.
Whether the model may call several tools in one turn.
Reasoning controls, such as the effort level.
Requests are not stored server-side; the field is accepted for compatibility.
If true, the response is streamed as server-sent events, matching the OpenAI Responses API: response.created, response.output_text.delta, and response.completed.
Streaming options, such as include_usage.
Maximum number of tokens to generate in the response.
Text output settings, such as a response format.
Metadata to attach to the response, in the OpenAI shape.
The id of a previous response, for clients that chain responses client-side.
Extra fields to include in the response, such as reasoning encodings.
Accepted for compatibility. The gateway serves one tier.
Routing hint that groups requests into one conversation only when no session header or body session id is present. See Session affinity.
256Body session id, also spelled sessionId and providerOptions.gateway.sessionId. Between 8 and 256 characters. See Session affinity.
8 - 256Vercel AI SDK provider options. Only gateway.sessionId is read, as a body session id. See Session affinity.
Subconscious extension. Returns the worker's subconscious cache stats on the response.
Subconscious extension. Chat-template kwargs, such as the context budget.
Response
Successful completion
A unique identifier for the response.
"resp_abc123"
The object type.
response Unix timestamp of when the response was created.
1716000000
The model used for the response.
"subconscious/glm-5.3-marathon"
The response output items, such as messages and function calls.
Present only when the request sent one. Echoes the caller's value.
Was this page helpful?