Create Responses
Create Responses
ParametersExpand Collapse
input: Union[str, Iterable[InputUnionMember1]]
Iterable[InputUnionMember1]
class InputUnionMember1EasyInputMessageParam: …A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
content: Union[str, Iterable[InputUnionMember1EasyInputMessageParamContentUnionMember1]]
Iterable[InputUnionMember1EasyInputMessageParamContentUnionMember1]
class ResponseInputTextParam: …A text input to the model.
A text input to the model.
class ResponseInputImageParam: …An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
detail: Literal["low", "high", "auto"]
class ResponseInputFileParam: …A file input to the model.
A file input to the model.
role: Literal["user", "assistant", "system", "developer"]
class InputUnionMember1Message: …A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role.
content: Iterable[InputUnionMember1MessageContent]
class ResponseInputTextParam: …A text input to the model.
A text input to the model.
class ResponseInputImageParam: …An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
detail: Literal["low", "high", "auto"]
class ResponseInputFileParam: …A file input to the model.
A file input to the model.
role: Literal["user", "system", "developer"]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseOutputMessageParam: …An output message from the model.
An output message from the model.
content: Iterable[InputUnionMember1ResponseOutputMessageParamContent]
class InputUnionMember1ResponseOutputMessageParamContentResponseOutputTextParam: …A text output from the model.
A text output from the model.
annotations: Iterable[InputUnionMember1ResponseOutputMessageParamContentResponseOutputTextParamAnnotation]
class AnnotationFileCitation: …A citation to a file.
A citation to a file.
class AnnotationURLCitation: …A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
class AnnotationContainerFileCitation: …A citation for a container file used to generate a model response.
A citation for a container file used to generate a model response.
class AnnotationFilePath: …A path to a file.
A path to a file.
top_logprobs: List[TopLogprob]
class InputUnionMember1ResponseOutputMessageParamContentResponseOutputRefusalParam: …A refusal from the model.
A refusal from the model.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseFileSearchToolCallParam: …The results of a file search tool call.
See the
file search guide for more information.
The results of a file search tool call.
See the file search guide for more information.
status: Literal["in_progress", "searching", "completed", 2 more]
results: Optional[Iterable[InputUnionMember1ResponseFileSearchToolCallParamResult]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
class InputUnionMember1ResponseComputerToolCallParam: …A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
action: InputUnionMember1ResponseComputerToolCallParamActionA click action.
A click action.
class ActionClick: …A click action.
A click action.
button: Literal["left", "right", "wheel", 2 more]
class ActionDoubleClick: …A double click action.
A double click action.
class ActionDrag: …A drag action.
A drag action.
path: List[Path]
class ActionKeypress: …A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
class ActionMove: …A mouse move action.
A mouse move action.
class ActionScreenshot: …A screenshot action.
A screenshot action.
class ActionScroll: …A scroll action.
A scroll action.
class ActionType: …An action to type in text.
An action to type in text.
class ActionWait: …A wait action.
A wait action.
class InputUnionMember1ResponseComputerToolCallParamActionActionPointAndType: …Click at a position then type text.
Click at a position then type text.
class InputUnionMember1ResponseComputerToolCallParamActionActionMouseDown: …Press and hold the left mouse button at a position.
Press and hold the left mouse button at a position.
class InputUnionMember1ResponseComputerToolCallParamActionActionMouseUp: …Release the left mouse button at a position.
Release the left mouse button at a position.
class InputUnionMember1ResponseComputerToolCallParamActionActionKeyDown: …Press and hold a key.
Press and hold a key.
class InputUnionMember1ResponseComputerToolCallParamActionActionKeyUp: …Release a held key.
Release a held key.
pending_safety_checks: Iterable[InputUnionMember1ResponseComputerToolCallParamPendingSafetyCheck]
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ComputerCallOutput: …The output of a computer tool call.
The output of a computer tool call.
output: InputUnionMember1ComputerCallOutputOutputA computer screenshot image used with the computer use tool.
A computer screenshot image used with the computer use tool.
acknowledged_safety_checks: Optional[Iterable[InputUnionMember1ComputerCallOutputAcknowledgedSafetyCheck]]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseFunctionWebSearchParam: …The results of a web search tool call.
See the
web search guide for more information.
The results of a web search tool call.
See the web search guide for more information.
action: InputUnionMember1ResponseFunctionWebSearchParamActionAction type "search" - Performs a web search query.
Action type "search" - Performs a web search query.
class InputUnionMember1ResponseFunctionWebSearchParamActionActionSearch: …Action type "search" - Performs a web search query.
Action type "search" - Performs a web search query.
class ActionOpenPage: …Action type "open_page" - Opens a specific URL from search results.
Action type "open_page" - Opens a specific URL from search results.
class ActionFind: …Action type "find": Searches for a pattern within a loaded page.
Action type "find": Searches for a pattern within a loaded page.
status: Literal["in_progress", "searching", "completed", "failed"]
class InputUnionMember1ResponseFunctionToolCallParam: …A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1FunctionCallOutput: …The output of a function tool call.
The output of a function tool call.
output: Union[str, Iterable[InputUnionMember1FunctionCallOutputOutputUnionMember1]]
Iterable[InputUnionMember1FunctionCallOutputOutputUnionMember1]
class InputUnionMember1FunctionCallOutputOutputUnionMember1ResponseInputTextContentParam: …A text input to the model.
A text input to the model.
class InputUnionMember1FunctionCallOutputOutputUnionMember1ResponseInputImageContentParam: …An image input to the model.
Learn about image inputs
An image input to the model.
Learn about image inputs
detail: Optional[Literal["low", "high", "auto"]]
class InputUnionMember1FunctionCallOutputOutputUnionMember1ResponseInputFileContentParam: …A file input to the model.
A file input to the model.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseReasoningItemParam: …A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
content: Optional[Iterable[InputUnionMember1ResponseReasoningItemParamContent]]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseCompactionItemParamParam: …A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class InputUnionMember1ImageGenerationCall: …An image generation request made by the model.
An image generation request made by the model.
status: Literal["in_progress", "completed", "generating", "failed"]
class InputUnionMember1ResponseCodeInterpreterToolCallParam: …A tool call to run code.
A tool call to run code.
outputs: Optional[Iterable[InputUnionMember1ResponseCodeInterpreterToolCallParamOutput]]
class OutputLogs: …The logs output from the code interpreter.
The logs output from the code interpreter.
class OutputImage: …The image output from the code interpreter.
The image output from the code interpreter.
status: Literal["in_progress", "completed", "incomplete", 2 more]
class InputUnionMember1LocalShellCall: …A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
action: InputUnionMember1LocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1LocalShellCallOutput: …The output of a local shell tool call.
The output of a local shell tool call.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ShellCall: …A tool representing a request to execute one or more shell commands.
A tool representing a request to execute one or more shell commands.
action: InputUnionMember1ShellCallActionThe shell commands and limits that describe how to run the tool call.
The shell commands and limits that describe how to run the tool call.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ShellCallOutput: …The streamed output items emitted by a shell tool call.
The streamed output items emitted by a shell tool call.
output: Iterable[InputUnionMember1ShellCallOutputOutput]
outcome: InputUnionMember1ShellCallOutputOutputOutcomeIndicates that the shell call exceeded its configured time limit.
Indicates that the shell call exceeded its configured time limit.
class InputUnionMember1ShellCallOutputOutputOutcomeOutcomeTimeout: …Indicates that the shell call exceeded its configured time limit.
Indicates that the shell call exceeded its configured time limit.
class InputUnionMember1ShellCallOutputOutputOutcomeOutcomeExit: …Indicates that the shell commands finished and returned an exit code.
Indicates that the shell commands finished and returned an exit code.
class InputUnionMember1ApplyPatchCall: …A tool call representing a request to create, delete, or update files using diff patches.
A tool call representing a request to create, delete, or update files using diff patches.
operation: InputUnionMember1ApplyPatchCallOperationInstruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
class InputUnionMember1ApplyPatchCallOperationApplyPatchCallOperationCreateFile: …Instruction for creating a new file via the apply_patch tool.
Instruction for creating a new file via the apply_patch tool.
class InputUnionMember1ApplyPatchCallOperationApplyPatchCallOperationDeleteFile: …Instruction for deleting an existing file via the apply_patch tool.
Instruction for deleting an existing file via the apply_patch tool.
class InputUnionMember1ApplyPatchCallOperationApplyPatchCallOperationUpdateFile: …Instruction for updating an existing file via the apply_patch tool.
Instruction for updating an existing file via the apply_patch tool.
status: Literal["in_progress", "completed"]
class InputUnionMember1ApplyPatchCallOutput: …The streamed output emitted by an apply patch tool call.
The streamed output emitted by an apply patch tool call.
status: Literal["completed", "failed"]
class InputUnionMember1McpListTools: …A list of tools available on an MCP server.
A list of tools available on an MCP server.
tools: Iterable[InputUnionMember1McpListToolsTool]
class McpApprovalRequest: …A request for human approval of a tool invocation.
A request for human approval of a tool invocation.
class InputUnionMember1McpApprovalResponse: …A response to an MCP approval request.
A response to an MCP approval request.
class InputUnionMember1McpCall: …An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
class InputUnionMember1ResponseCustomToolCallOutputParam: …The output of a custom tool call from your code, being sent back to the model.
The output of a custom tool call from your code, being sent back to the model.
output: Union[str, Iterable[InputUnionMember1ResponseCustomToolCallOutputParamOutputUnionMember1]]
Iterable[InputUnionMember1ResponseCustomToolCallOutputParamOutputUnionMember1]
class ResponseInputTextParam: …A text input to the model.
A text input to the model.
class ResponseInputImageParam: …An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
detail: Literal["low", "high", "auto"]
class ResponseInputFileParam: …A file input to the model.
A file input to the model.
class InputUnionMember1ResponseCustomToolCallParam: …A call to a custom tool created by the model.
A call to a custom tool created by the model.
class InputUnionMember1ItemReference: …An internal identifier for an item to reference.
An internal identifier for an item to reference.
class InputUnionMember1ResponseOutputMessage: …An output message from the model.
An output message from the model.
content: Iterable[InputUnionMember1ResponseOutputMessageContent]
class InputUnionMember1ResponseOutputMessageContentResponseOutputText: …A text output from the model.
A text output from the model.
annotations: Iterable[InputUnionMember1ResponseOutputMessageContentResponseOutputTextAnnotation]
class AnnotationFileCitation: …A citation to a file.
A citation to a file.
class AnnotationURLCitation: …A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
class AnnotationContainerFileCitation: …A citation for a container file used to generate a model response.
A citation for a container file used to generate a model response.
class AnnotationFilePath: …A path to a file.
A path to a file.
top_logprobs: List[TopLogprob]
class InputUnionMember1ResponseOutputMessageContentResponseOutputRefusal: …A refusal from the model.
A refusal from the model.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseFileSearchToolCall: …The results of a file search tool call.
See the
file search guide for more information.
The results of a file search tool call.
See the file search guide for more information.
status: Literal["in_progress", "searching", "completed", 2 more]
results: Optional[Iterable[InputUnionMember1ResponseFileSearchToolCallResult]]
attributes: Optional[Dict[str, Union[str, float, bool]]]
class InputUnionMember1ResponseFunctionToolCall: …A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseFunctionWebSearch: …The results of a web search tool call.
See the
web search guide for more information.
The results of a web search tool call.
See the web search guide for more information.
action: InputUnionMember1ResponseFunctionWebSearchActionAction type "search" - Performs a web search query.
Action type "search" - Performs a web search query.
class InputUnionMember1ResponseFunctionWebSearchActionActionSearch: …Action type "search" - Performs a web search query.
Action type "search" - Performs a web search query.
class ActionOpenPage: …Action type "open_page" - Opens a specific URL from search results.
Action type "open_page" - Opens a specific URL from search results.
class ActionFind: …Action type "find": Searches for a pattern within a loaded page.
Action type "find": Searches for a pattern within a loaded page.
status: Literal["in_progress", "searching", "completed", "failed"]
class InputUnionMember1ResponseComputerToolCall: …A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
action: InputUnionMember1ResponseComputerToolCallActionA click action.
A click action.
class ActionClick: …A click action.
A click action.
button: Literal["left", "right", "wheel", 2 more]
class ActionDoubleClick: …A double click action.
A double click action.
class ActionDrag: …A drag action.
A drag action.
path: List[Path]
class ActionKeypress: …A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
class ActionMove: …A mouse move action.
A mouse move action.
class ActionScreenshot: …A screenshot action.
A screenshot action.
class ActionScroll: …A scroll action.
A scroll action.
class ActionType: …An action to type in text.
An action to type in text.
class ActionWait: …A wait action.
A wait action.
class InputUnionMember1ResponseComputerToolCallActionActionPointAndType: …Click at a position then type text.
Click at a position then type text.
class InputUnionMember1ResponseComputerToolCallActionActionMouseDown: …Press and hold the left mouse button at a position.
Press and hold the left mouse button at a position.
class InputUnionMember1ResponseComputerToolCallActionActionMouseUp: …Release the left mouse button at a position.
Release the left mouse button at a position.
class InputUnionMember1ResponseComputerToolCallActionActionKeyDown: …Press and hold a key.
Press and hold a key.
class InputUnionMember1ResponseComputerToolCallActionActionKeyUp: …Release a held key.
Release a held key.
pending_safety_checks: Iterable[InputUnionMember1ResponseComputerToolCallPendingSafetyCheck]
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseReasoningItem: …A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
A description of the chain of thought used by a reasoning model while generating
a response. Be sure to include these items in your input to the Responses API
for subsequent turns of a conversation if you are manually
managing context.
content: Optional[Iterable[InputUnionMember1ResponseReasoningItemContent]]
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class InputUnionMember1ResponseCompactionItem: …A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
class InputUnionMember1ImageGenerationCall: …An image generation request made by the model.
An image generation request made by the model.
status: Literal["in_progress", "completed", "generating", "failed"]
class InputUnionMember1ResponseCodeInterpreterToolCall: …A tool call to run code.
A tool call to run code.
status: Literal["in_progress", "completed", "incomplete", 2 more]
outputs: Optional[Iterable[InputUnionMember1ResponseCodeInterpreterToolCallOutput]]
class OutputLogs: …The logs output from the code interpreter.
The logs output from the code interpreter.
class OutputImage: …The image output from the code interpreter.
The image output from the code interpreter.
class InputUnionMember1LocalShellCall: …A tool call to run a command on the local shell.
A tool call to run a command on the local shell.
action: InputUnionMember1LocalShellCallActionExecute a shell command on the server.
Execute a shell command on the server.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseFunctionShellToolCall: …A tool call that executes one or more shell commands in a managed environment.
A tool call that executes one or more shell commands in a managed environment.
action: InputUnionMember1ResponseFunctionShellToolCallActionThe shell commands and limits that describe how to run the tool call.
The shell commands and limits that describe how to run the tool call.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseFunctionShellToolCallOutput: …The output of a shell tool call that was emitted.
The output of a shell tool call that was emitted.
output: Iterable[InputUnionMember1ResponseFunctionShellToolCallOutputOutput]
outcome: InputUnionMember1ResponseFunctionShellToolCallOutputOutputOutcomeIndicates that the shell call exceeded its configured time limit.
Indicates that the shell call exceeded its configured time limit.
class InputUnionMember1ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeTimeout: …Indicates that the shell call exceeded its configured time limit.
Indicates that the shell call exceeded its configured time limit.
class InputUnionMember1ResponseFunctionShellToolCallOutputOutputOutcomeOutputOutcomeExit: …Indicates that the shell commands finished and returned an exit code.
Indicates that the shell commands finished and returned an exit code.
status: Literal["in_progress", "completed", "incomplete"]
class InputUnionMember1ResponseApplyPatchToolCall: …A tool call that applies file diffs by creating, deleting, or updating files.
A tool call that applies file diffs by creating, deleting, or updating files.
operation: InputUnionMember1ResponseApplyPatchToolCallOperationInstruction describing how to create a file via the apply_patch tool.
Instruction describing how to create a file via the apply_patch tool.
class InputUnionMember1ResponseApplyPatchToolCallOperationOperationCreateFile: …Instruction describing how to create a file via the apply_patch tool.
Instruction describing how to create a file via the apply_patch tool.
class InputUnionMember1ResponseApplyPatchToolCallOperationOperationDeleteFile: …Instruction describing how to delete a file via the apply_patch tool.
Instruction describing how to delete a file via the apply_patch tool.
class InputUnionMember1ResponseApplyPatchToolCallOperationOperationUpdateFile: …Instruction describing how to update a file via the apply_patch tool.
Instruction describing how to update a file via the apply_patch tool.
status: Literal["in_progress", "completed"]
class InputUnionMember1ResponseApplyPatchToolCallOutput: …The output emitted by an apply patch tool call.
The output emitted by an apply patch tool call.
status: Literal["completed", "failed"]
class InputUnionMember1McpCall: …An invocation of a tool on an MCP server.
An invocation of a tool on an MCP server.
status: Optional[Literal["in_progress", "completed", "incomplete", 2 more]]
class InputUnionMember1McpListTools: …A list of tools available on an MCP server.
A list of tools available on an MCP server.
tools: Iterable[InputUnionMember1McpListToolsTool]
class McpApprovalRequest: …A request for human approval of a tool invocation.
A request for human approval of a tool invocation.
class InputUnionMember1ResponseCustomToolCall: …A call to a custom tool created by the model.
A call to a custom tool created by the model.
If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit).
Dictates whether or not to return messages as part of the response object. Currently only supported fornon-background and gpt-oss only.
include: Optional[List[Literal["code_interpreter_call.outputs", "computer_call_output.output.image_url", "file_search_call.results", 3 more]]]
Additional kwargs to pass to the HF processor.
previous_input_messages: Optional[Iterable[PreviousInputMessage]]
class Message: …
author: Author
role: Literal["user", "assistant", "system", 2 more]The role of a message author (mirrors chat::Role).
The role of a message author (mirrors chat::Role).
The priority of the request (lower means earlier handling; default: 0). Any priority other than 0 will raise an error if the served model does not use priority scheduling.
Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
variables: Optional[Dict[str, PromptVariables]]
class PromptVariablesResponseInputText: …A text input to the model.
A text input to the model.
class PromptVariablesResponseInputImage: …An image input to the model.
Learn about image inputs.
An image input to the model.
Learn about image inputs.
detail: Literal["low", "high", "auto"]
class PromptVariablesResponseInputFile: …A file input to the model.
A file input to the model.
A key that was used to read from or write to the prompt cache.Note: This field has not been implemented yet and vLLM will ignore it.
gpt-5 and o-series models only
Configuration options for
reasoning models.
gpt-5 and o-series models only
Configuration options for reasoning models.
effort: Optional[Literal["none", "minimal", "low", 3 more]]
generate_summary: Optional[Literal["auto", "concise", "detailed"]]
summary: Optional[Literal["auto", "concise", "detailed"]]
The request_id related to this request. If the caller does not set it, a random_uuid will be generated. This id is used through out the inference process and return in response.
service_tier: Optional[Literal["auto", "default", "flex", 2 more]]
Configuration options for a text response from the model.
Can be plain
text or structured JSON data. Learn more:
Configuration options for a text response from the model.
Can be plain text or structured JSON data. Learn more:
format: Optional[TextFormat]Default response format. Used to generate text responses.
Default response format. Used to generate text responses.
class TextFormatResponseFormatText: …Default response format. Used to generate text responses.
Default response format. Used to generate text responses.
class TextFormatResponseFormatTextJsonSchemaConfig: …JSON Schema response format.
Used to generate structured JSON responses.
Learn more about Structured Outputs.
JSON Schema response format.
Used to generate structured JSON responses. Learn more about Structured Outputs.
class TextFormatResponseFormatJsonObject: …JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
JSON object response format.
An older method of generating JSON responses.
Using json_schema is recommended for models that support it. Note that the
model will not generate JSON without a system or user message instructing it
to do so.
verbosity: Optional[Literal["low", "medium", "high"]]
Constrains the tools available to the model to a pre-defined set.
Constrains the tools available to the model to a pre-defined set.
Literal["none", "auto", "required"]
class ToolChoiceToolChoiceAllowed: …Constrains the tools available to the model to a pre-defined set.
Constrains the tools available to the model to a pre-defined set.
mode: Literal["auto", "required"]
class ToolChoiceToolChoiceTypes: …Indicates that the model should use a built-in tool to generate a response.
Learn more about built-in tools.
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
class ToolChoiceToolChoiceFunction: …Use this option to force the model to call a specific function.
Use this option to force the model to call a specific function.
class ToolChoiceToolChoiceCustom: …Use this option to force the model to call a specific custom tool.
Use this option to force the model to call a specific custom tool.
class ToolFunctionTool: …Defines a function in your own code the model can choose to call.
Learn more about function calling.
Defines a function in your own code the model can choose to call.
Learn more about function calling.
class ToolCustomTool: …A custom tool that processes input using a specified format.
Learn more about custom tools
A custom tool that processes input using a specified format.
Learn more about custom tools
format: Optional[ToolCustomToolFormat]Unconstrained free-form text.
Unconstrained free-form text.
class ToolCustomToolFormatText: …Unconstrained free-form text.
Unconstrained free-form text.
class ToolCustomToolFormatGrammar: …A grammar defined by the user.
A grammar defined by the user.
syntax: Literal["lark", "regex"]
class ToolComputerTool: …A tool that controls a virtual computer.
Learn more about the computer tool.
A tool that controls a virtual computer.
Learn more about the computer tool.
environment: Literal["windows", "mac", "linux", 2 more]
truncation: Optional[Literal["auto", "disabled"]]
ReturnsExpand Collapse
class ResponseCreateResponse: …The response object returned by the Responses API.
The response object returned by the Responses API.
output: List[Output]
class OutputResponseOutputMessage: …An output message from the model.
An output message from the model.
content: List[OutputResponseOutputMessageContent]
class OutputResponseOutputMessageContentResponseOutputText: …A text output from the model.
A text output from the model.
annotations: List[OutputResponseOutputMessageContentResponseOutputTextAnnotation]
class AnnotationFileCitation: …A citation to a file.
A citation to a file.
class AnnotationURLCitation: …A citation for a web resource used to generate a model response.
A citation for a web resource used to generate a model response.
class AnnotationContainerFileCitation: …A citation for a container file used to generate a model response.
A citation for a container file used to generate a model response.
class AnnotationFilePath: …A path to a file.
A path to a file.
top_logprobs: List[TopLogprob]
class OutputResponseOutputMessageContentResponseOutputRefusal: …A refusal from the model.
A refusal from the model.
status: Literal["in_progress", "completed", "incomplete"]
class OutputResponseFunctionToolCall: …A tool call to run a function.
See the
function calling guide for more information.
A tool call to run a function.
See the function calling guide for more information.
status: Optional[Literal["in_progress", "completed", "incomplete"]]
class OutputResponseComputerToolCall: …A tool call to a computer use tool.
See the
computer use guide for more information.
A tool call to a computer use tool.
See the computer use guide for more information.
action: OutputResponseComputerToolCallActionA click action.
A click action.
class ActionClick: …A click action.
A click action.
button: Literal["left", "right", "wheel", 2 more]
class ActionDoubleClick: …A double click action.
A double click action.
class ActionDrag: …A drag action.
A drag action.
path: List[Path]
class ActionKeypress: …A collection of keypresses the model would like to perform.
A collection of keypresses the model would like to perform.
class ActionMove: …A mouse move action.
A mouse move action.
class ActionScreenshot: …A screenshot action.
A screenshot action.
class ActionScroll: …A scroll action.
A scroll action.
class ActionType: …An action to type in text.
An action to type in text.
class ActionWait: …A wait action.
A wait action.
class OutputResponseComputerToolCallActionActionPointAndType: …Click at a position then type text.
Click at a position then type text.
class OutputResponseComputerToolCallActionActionMouseDown: …Press and hold the left mouse button at a position.
Press and hold the left mouse button at a position.
class OutputResponseComputerToolCallActionActionMouseUp: …Release the left mouse button at a position.
Release the left mouse button at a position.
class OutputResponseComputerToolCallActionActionKeyDown: …Press and hold a key.
Press and hold a key.
class OutputResponseComputerToolCallActionActionKeyUp: …Release a held key.
Release a held key.
pending_safety_checks: List[OutputResponseComputerToolCallPendingSafetyCheck]
status: Literal["in_progress", "completed", "incomplete"]
status: Literal["completed", "failed", "in_progress", 2 more]
usage: Optional[Usage]
Create Responses
import os
from tzafon import Lightcone
client = Lightcone(
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
)
response = client.responses.create(
input="string",
)
print(response.id){
"id": "id",
"created_at": 0,
"model": "model",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message"
}
],
"status": "completed",
"error": {
"foo": "bar"
},
"tools": [
{
"foo": "bar"
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
}
}Returns Examples
{
"id": "id",
"created_at": 0,
"model": "model",
"object": "response",
"output": [
{
"id": "id",
"content": [
{
"annotations": [
{
"file_id": "file_id",
"filename": "filename",
"index": 0,
"type": "file_citation"
}
],
"text": "text",
"type": "output_text",
"logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": [
{
"token": "token",
"bytes": [
0
],
"logprob": 0
}
]
}
]
}
],
"role": "assistant",
"status": "in_progress",
"type": "message"
}
],
"status": "completed",
"error": {
"foo": "bar"
},
"tools": [
{
"foo": "bar"
}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
}
}