🗨️ Responses Official Documentation

⋙ Create Model Response

Creates a model response.

msg.payload Properties

input string | array
Text, image, or file inputs to the model, used to generate a response. For assistant message items in an array input, you may also set phase to commentary or final_answer. For file inputs, use input_file items and set detail to low or high when you need to control file rendering quality. To make extra tools available at a specific point in an array input, send an additional_tools item with role: "developer" and a tools array. The item may also include an id.
model string
Model ID used to generate the response, including newer Responses-compatible model strings such as gpt-5.4-mini, gpt-5.4-nano, and dated variants like gpt-5.4-mini-2026-03-17.
background boolean
Whether to run the model response in the background.
context_management array
Context management settings, including compaction behavior.
conversation string | object
Conversation context to prepend for this response.
include array
Specify additional output data to include in the model response, for example web_search_call.results, web_search_call.action.sources, or message.output_text.logprobs. Web-search search actions use queries for current multi-query payloads. The older query field is deprecated and optional when present in returned action data.
instructions string
Inserts a system (or developer) message as the first item in the model's context.
max_output_tokens integer
An upper bound for the number of tokens that can be generated for a response.
metadata object
Set of 16 key-value pairs that can be attached to an object.
parallel_tool_calls boolean
Whether to allow the model to run tool calls in parallel.
previous_response_id string
The unique ID of the previous response to the model.
prompt object
Reference to a reusable prompt template and variables.
prompt_cache_key string
Stable key used to improve prompt cache hit rates.
prompt_cache_retention string
Prompt cache retention policy. Set 24h for extended prompt caching. For gpt-5.5, gpt-5.5-pro, and future models, only 24h is supported. For older models that support both in_memory and 24h, the default depends on the organization's data retention policy: organizations without ZDR enabled default to 24h, and organizations with ZDR enabled default to in_memory when prompt_cache_retention is not specified.
reasoning object
o-series models only. See official docs for option properties.
safety_identifier string
Stable end-user identifier used for abuse detection and safety controls.
service_tier string
Service tier selection, for example default, flex, or priority.
store boolean
Whether to store the generated model response for later retrieval via API.
stream boolean
If set to true, the model response data will be streamed to the client as it is generated using server-sent events.
stream_options object
Streaming options such as obfuscation behavior for event payloads.
temperature number
What sampling temperature to use, between 0 and 2.
text object
Configuration options for a text response from the model.
tool_choice string or object
How the model should select which tool (or tools) to use when generating a response.
tools array
An array of tools the model may call while generating a response. This includes Model Context Protocol tools, Tool Search via { "type": "tool_search" }, and GA computer use via { "type": "computer" }. Deferred tool loading is supported by setting defer_loading: true on tool definitions. Computer-tool workflows typically require follow-up requests that send computer_call_output items back through input. For Model Context Protocol (MCP) tools, each object in the array should follow this structure.
top_logprobs integer
Integer between 0 and 20 specifying how many likely alternative tokens to return per position. Pair this with include: ["message.output_text.logprobs"] when you want the returned response to include those logprobs.
top_p number
An alternative to sampling with temperature, called nucleus sampling.
truncation string
The truncation strategy to use for the model response.
user string
Deprecated. Prefer safety_identifier and prompt_cache_key.

⋙ Parse Model Response

Creates a model response and returns the SDK-parsed result for structured-output payloads.

Use the same request body shape as Create Model Response when your payload includes parseable text formats or tools that the official SDK can parse for you.

msg.payload Properties

input string | array
Text, image, or file inputs to the model, used to generate a parsed response.
model string
Model ID used to generate and parse the response.
text object
Structured-output or text configuration used by the SDK parse helper.
tools array
Tool definitions that the SDK can parse alongside the response.

⋙ Get Model Response

Retrieves a model response with the given ID.

msg.payload Properties

response_id string
The ID of the response to retrieve.
include array
Additional output fields to include in the response.
include_obfuscation boolean
Enable obfuscation payloads in streaming events.
starting_after integer
Event sequence number after which to begin a streamed retrieval.
stream boolean
When true, retrieve the response as a stream of events.

⋙ Stream Model Response

Uses the SDK streaming helper to emit Responses stream events as they arrive and then returns the helper's final parsed response object when the stream completes.

Use this helper for streamed create requests or streamed continuation by response id.

When response_id is not provided, this helper uses the same request body shape as Create Model Response, including fields such as include, prompt_cache_retention, and top_logprobs.

msg.payload Properties

response_id string
If provided, continue streaming an existing response by id.
starting_after integer
When continuing by response_id, start after the given event sequence number.
input string | array
Input used for a new streamed response when response_id is not provided. Array inputs may include additional_tools items with role: "developer", tools, and optional id.
model string
Model ID used for a new streamed response.
text object
Text or structured-output configuration for the streamed response.
tools array
Tool definitions to use while streaming the response.

⋙ Delete Model Response

Deletes a model response with the given ID.

msg.payload Properties

response_id string
The ID of the response to delete.

⋙ Cancel Model Response

Cancels an in-progress model response.

msg.payload Properties

response_id string
The ID of the response to cancel.

⋙ Compact Model Response

Compacts prior conversation content to reduce context size while preserving continuity.

msg.payload Properties

model string
Model ID used for compaction.
input string | array
Optional input items used for compaction. Array inputs are passed to the SDK unchanged, including additional_tools items.
instructions string
Optional system or developer instructions for compaction.
previous_response_id string
Optional previous response id to continue compaction context.
prompt_cache_retention string
Prompt cache retention policy for compaction requests. Set 24h for extended prompt caching. For gpt-5.5, gpt-5.5-pro, and future models, only 24h is supported. For older models that support both in_memory and 24h, the default depends on the organization's data retention policy: organizations without ZDR enabled default to 24h, and organizations with ZDR enabled default to in_memory when prompt_cache_retention is not specified.
service_tier string | null
Service tier selection for compaction requests. Use auto, default, flex, priority, or null.

⋙ List Input Items

Returns a list of input items for a given response.

msg.payload Properties

response_id string
The ID of the response to retrieve input items for.
after string
An item ID to list items after, used in pagination.
before string
An item ID to list items before, used in pagination.
limit integer
A limit on the number of objects to be returned.
order string
The order to return the input items in. Default is desc.
include array
Additional fields to include on the returned input items.

⋙ Count Input Tokens

Counts input tokens before creating a model response.

msg.payload Properties

model string
Model ID to use for token counting.
input string | array
Input items to count.
conversation string | object
Conversation context to include in counting.
instructions string
System or developer instructions to include in counting.
previous_response_id string
Previous response ID used to continue conversation context.
parallel_tool_calls boolean
Whether tool calls may run in parallel for the modeled request.
personality string
Model-owned style preset used for token counting. Supported named values include friendly and pragmatic; future SDK string values up to 64 characters are also valid.
reasoning object
Reasoning model configuration used for token accounting.
text object
Text output configuration used when estimating token usage.
tool_choice string | object
Tool selection mode used for token counting.
tools array
Tool definitions used for token counting.
truncation string
Truncation strategy for token counting context.

⋙ Manage Model Response WebSocket

Opens, uses, and closes a persistent Responses websocket connection from a single OpenAI API node instance.

Use the same node instance for all websocket actions. Set msg.payload.action to connect, send, or close.

Incoming server events are emitted asynchronously from this node as new messages with the raw event object in msg.payload. Connection metadata is added under msg.openai.

msg.payload Properties

action string
Required lifecycle action. Must be connect, send, or close.
connection_id string
Stable identifier for the websocket connection owned by this node instance.
event object
Required when action is send. Provide a Responses client event, currently { "type": "response.create", ... }. For response-create events, use the same prompt_cache_retention guidance as Create Model Response.
code integer
Optional websocket close code used when action is close. Defaults to 1000.
reason string
Optional websocket close reason used when action is close. Defaults to OK.

The websocket URL is derived from the configured Service Host API Base using the same auth contract as the rest of this node, including custom auth headers and query-string auth.