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>"
}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
Text output settings, such as a response format.
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.
Response
Successful completion
Was this page helpful?