Skip to content

Responses Types

The Responses API types come from two sources depending on the provider:

  • OpenResponses-compliant providers return ResponseResource from the openresponses-types package.
  • OpenAI-native providers return Response from the openai SDK.
  • Streaming always yields ResponseStreamEvent objects.

The response object from providers implementing the OpenResponses specification.

Import: from openresponses_types import ResponseResource

Package: openresponses-types

This is the primary return type for OpenResponses-compliant providers. It provides a standardized interface for accessing response content, tool calls, and metadata.

The response object from OpenAI’s native Responses API. Re-exported from openai.types.responses.Response.

Import: from any_llm.types.responses import Response

This is returned by providers that use OpenAI’s API directly (e.g., the openai provider).

A single event in a streaming response. Re-exported from openai.types.responses.ResponseStreamEvent.

Import: from any_llm.types.responses import ResponseStreamEvent

Stream events represent incremental updates during response generation, including content deltas, tool call events, and completion signals.

The input type accepted by the input_data parameter of responses() and aresponses(). Re-exported from openai.types.responses.ResponseInputParam.

Import: from any_llm.types.responses import ResponseInputParam

This is typically a list of message items that can include text, images, and tool-related content.

An output message within a response. Re-exported from openai.types.responses.ResponseOutputMessage.

Import: from any_llm.types.responses import ResponseOutputMessage

Normalized parameters for the Responses API, used internally to pass structured parameters from the public API to provider implementations.

Import: from any_llm.types.responses import ResponsesParams

FieldTypeDescription
modelstrModel identifier (e.g., ‘mistral-small-latest’)
inputstr | list[EasyInputMessageParam | Message | ResponseOutputMessageParam | ResponseFileSearchToolCallParam | ResponseComputerToolCallParam | ComputerCallOutput | ResponseFunctionWebSearchParam | ResponseFunctionToolCallParam | FunctionCallOutput | ToolSearchCall | ResponseToolSearchOutputItemParamParam | ResponseReasoningItemParam | ResponseCompactionItemParamParam | ImageGenerationCall | ResponseCodeInterpreterToolCallParam | LocalShellCall | LocalShellCallOutput | ShellCall | ShellCallOutput | ApplyPatchCall | ApplyPatchCallOutput | McpListTools | McpApprovalRequest | McpApprovalResponse | McpCall | ResponseCustomToolCallOutputParam | ResponseCustomToolCallParam | ItemReference]The input payload accepted by provider’s Responses API. For OpenAI-compatible providers, this is typically a list mixing text, images, and tool instructions, or a dict per OpenAI spec.
instructionsstr | None
max_tool_callsint | None
textAny | None
toolslist[dict[str, Any]] | NoneList of tools for tool calling. Should be converted to OpenAI tool format dicts
tool_choicestr | dict[str, Any] | NoneControls which tools the model can call
temperaturefloat | NoneControls randomness in the response (0.0 to 2.0)
top_pfloat | NoneControls diversity via nucleus sampling (0.0 to 1.0)
max_output_tokensint | NoneMaximum number of tokens to generate
response_formatdict[str, Any] | type[pydantic.main.BaseModel] | NoneFormat specification for the response
streambool | NoneWhether to stream the response
parallel_tool_callsbool | NoneWhether to allow parallel tool calls
top_logprobsint | NoneNumber of top alternatives to return when logprobs are requested
stream_optionsdict[str, Any] | NoneAdditional options controlling streaming behavior
reasoningdict[str, Any] | NoneConfiguration options for reasoning models.
presence_penaltyfloat | NonePenalizes new tokens based on whether they appear in the text so far.
frequency_penaltyfloat | NonePenalizes new tokens based on their frequency in the text so far.
truncationstr | NoneControls how the service truncates the input when it exceeds the model context window.
storebool | NoneWhether to store the response so it can be retrieved later.
service_tierstr | NoneThe service tier to use for this request.
userstr | NoneA unique identifier representing your end user.
metadatadict[str, str] | NoneKey-value pairs for custom metadata (up to 16 pairs).
previous_response_idstr | NoneThe ID of the response to use as the prior turn for this request.
includelist[str] | NoneItems to include in the response (e.g., ‘reasoning.encrypted_content’).
backgroundbool | NoneWhether to run the request in the background and return immediately.
safety_identifierstr | NoneA stable identifier used for safety monitoring and abuse detection.
prompt_cache_keystr | NoneA key to use when reading from or writing to the prompt cache.
prompt_cache_retentionstr | NoneHow long to retain a prompt cache entry created by this request.
conversationstr | dict[str, Any] | NoneThe conversation to associate this response with (ID string or ConversationParam object).
TypeSourceUsed When
ResponseResourceopenresponses-typesOpenResponses-compliant providers, non-streaming
Responseopenai.types.responsesOpenAI-native providers, non-streaming
ResponseStreamEventopenai.types.responsesAll providers, streaming (stream=True)
ResponseInputParamopenai.types.responsesInput parameter type

For full details on the OpenResponses specification, see the OpenResponses GitHub repository. For OpenAI response types, see the OpenAI Python SDK.