Files
openrouter-python-sdk-retry…/docs/components/openresponsesrequest.md
T
2025-12-04 13:07:08 -05:00

43 KiB
Raw Blame History

OpenResponsesRequest

Request schema for Responses endpoint

Fields

Field Type Required Description Example
input Optional[components.OpenResponsesInput] Input for a response request - can be a string or array of items [
{
"role": "user",
"content": "What is the weather today?"
}
]
instructions OptionalNullable[str] N/A
metadata Dict[str, str] Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. {
"user_id": "123",
"session_id": "abc-def-ghi"
}
tools List[components.OpenResponsesRequestToolUnion] N/A
tool_choice Optional[components.OpenAIResponsesToolChoiceUnion] N/A
parallel_tool_calls OptionalNullable[bool] N/A
model Optional[str] N/A
models List[str] N/A
text Optional[components.OpenResponsesResponseText] Text output configuration including format and verbosity {
"format": {
"type": "text"
},
"verbosity": "medium"
}
reasoning OptionalNullable[components.OpenResponsesReasoningConfig] Configuration for reasoning mode in the response {
"summary": "auto",
"enabled": true
}
max_output_tokens OptionalNullable[float] N/A
temperature OptionalNullable[float] N/A
top_p OptionalNullable[float] N/A
top_k Optional[float] N/A
prompt_cache_key OptionalNullable[str] N/A
previous_response_id OptionalNullable[str] N/A
prompt OptionalNullable[components.OpenAIResponsesPrompt] N/A
include List[components.OpenAIResponsesIncludable] N/A
background OptionalNullable[bool] N/A
safety_identifier OptionalNullable[str] N/A
store Optional[Literal[False]] N/A
service_tier Optional[components.ServiceTier] N/A
truncation OptionalNullable[components.Truncation] N/A auto
stream Optional[bool] N/A
provider OptionalNullable[components.Provider] When multiple model providers are available, optionally indicate your routing preference.
plugins List[components.Plugin] Plugins you want to enable for this request, including their settings.
user Optional[str] A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
session_id Optional[str] A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.