Skip to main content
POST
Python (OpenAI SDK)

Authorizations

Authorization
string
header
required

API key from your Subconscious dashboard

Headers

x-subconscious-client
string

Labels your traffic in usage views. See Request correlation.

x-yourapp-session-id
string

Groups requests into one conversation (replace yourapp with your app name). See Session affinity.

x-yourapp-parent-session-id
string

Nests a subagent under the conversation that spawned it. See Subagent correlation.

Body

application/json
model
enum<string>
required

The model to use.

Available options:
subconscious/glm-5.3-marathon
Example:

"subconscious/glm-5.3-marathon"

input
any
required

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.

Example:

"Write a haiku about GPUs."

instructions
string

System instructions for the model.

tools
object[]

Tools the model may call. OpenAI function tool shapes are accepted.

tool_choice
any

Controls which tool the model calls. Pass none, auto, required, or a function shape.

parallel_tool_calls
boolean

Whether the model may call several tools in one turn.

reasoning
object

Reasoning controls, such as the effort level.

store
boolean
default:false

Requests are not stored server-side; the field is accepted for compatibility.

stream
boolean
default:false

If true, the response is streamed as server-sent events, matching the OpenAI Responses API: response.created, response.output_text.delta, and response.completed.

stream_options
object

Streaming options, such as include_usage.

max_output_tokens
integer

Maximum number of tokens to generate in the response.

text
object

Text output settings, such as a response format.

metadata
object

Metadata to attach to the response, in the OpenAI shape.

previous_response_id
string

The id of a previous response, for clients that chain responses client-side.

include
string[]

Extra fields to include in the response, such as reasoning encodings.

service_tier
string

Accepted for compatibility. The gateway serves one tier.

prompt_cache_key
string

Routing hint that groups requests into one conversation only when no session header or body session id is present. See Session affinity.

Maximum string length: 256
session_id
string

Body session id, also spelled sessionId and providerOptions.gateway.sessionId. Between 8 and 256 characters. See Session affinity.

Required string length: 8 - 256
providerOptions
object

Vercel AI SDK provider options. Only gateway.sessionId is read, as a body session id. See Session affinity.

return_subconscious_cache_stats
boolean

Subconscious extension. Returns the worker's subconscious cache stats on the response.

chat_template_kwargs
object

Subconscious extension. Chat-template kwargs, such as the context budget.

Response

200 - application/json

Successful completion

id
string

A unique identifier for the response.

Example:

"resp_abc123"

object
enum<string>

The object type.

Available options:
response
created_at
integer

Unix timestamp of when the response was created.

Example:

1716000000

model
string

The model used for the response.

Example:

"subconscious/glm-5.3-marathon"

output
object[]

The response output items, such as messages and function calls.

prompt_cache_key
string

Present only when the request sent one. Echoes the caller's value.