Beta
BetaAssistants
Build Assistants that can call models and use tools.
ModelsExpand Collapse
assistant_stream_event: object { data, event, enabled } or object { data, event } or object { data, event } or 21 moreRepresents an event emitted when streaming a Run.
Each event in a server-sent events stream has an event and data property:
event: thread.created
data: {"id": "thread_123", "object": "thread", ...}
We emit events whenever a new object is created, transitions to a new state, or is being
streamed in parts (deltas). For example, we emit thread.run.created when a new run
is created, thread.run.completed when a run completes, and so on. When an Assistant chooses
to create a message during a run, we emit a thread.message.created event, a
thread.message.in_progress event, many thread.message.delta events, and finally a
thread.message.completed event.
We may add additional events over time, so we recommend handling unknown events gracefully
in your code. See the Assistants API quickstart to learn how to
integrate the Assistants API with streaming.
Represents an event emitted when streaming a Run.
Each event in a server-sent events stream has an event and data property:
event: thread.created
data: {"id": "thread_123", "object": "thread", ...}
We emit events whenever a new object is created, transitions to a new state, or is being
streamed in parts (deltas). For example, we emit thread.run.created when a new run
is created, thread.run.completed when a run completes, and so on. When an Assistant chooses
to create a message during a run, we emit a thread.message.created event, a
thread.message.in_progress event, many thread.message.delta events, and finally a
thread.message.completed event.
We may add additional events over time, so we recommend handling unknown events gracefully in your code. See the Assistants API quickstart to learn how to integrate the Assistants API with streaming.
assistant_tool: CodeInterpreterTool { type } or FileSearchTool { type, file_search } or FunctionTool { function, type }
message_stream_event: object { data, event } or object { data, event } or object { data, event } or 2 moreOccurs when a message is created.
Occurs when a message is created.
run_step_stream_event: object { data, event } or object { data, event } or object { data, event } or 4 moreOccurs when a run step is created.
Occurs when a run step is created.
run_stream_event: object { data, event } or object { data, event } or object { data, event } or 7 moreOccurs when a new run is created.
Occurs when a new run is created.
thread_stream_event: object { data, event, enabled } Occurs when a new thread is created.
Occurs when a new thread is created.
BetaChatKitSessions
BetaChatKitThreads
List ChatKit thread items
ModelsExpand Collapse
BetaResponses
ModelsExpand Collapse
beta_computer_tool: object { type } 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.
beta_computer_use_preview_tool: object { display_height, display_width, environment, type } 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.
beta_custom_tool: object { name, type, allowed_callers, 3 more } 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
beta_easy_input_message: object { content, role, phase, type } 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.
beta_file_search_tool: object { type, vector_store_ids, filters, 2 more } A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
A tool that searches for relevant content from uploaded files. Learn more about the file search tool.
beta_function_tool: object { name, parameters, strict, 5 more } 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.
beta_response_compaction_item: object { id, encrypted_content, type, 2 more } A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
beta_response_compaction_item_param: object { encrypted_content, type, id, agent } A compaction item generated by the v1/responses/compact API.
A compaction item generated by the v1/responses/compact API.
beta_response_computer_tool_call: object { id, call_id, pending_safety_checks, 5 more } 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.
beta_response_content: BetaResponseInputText { text, type, prompt_cache_breakpoint } or BetaResponseInputImage { detail, type, file_id, 2 more } or BetaResponseInputFile { type, detail, file_data, 4 more } or 3 moreMulti-modal input and output contents.
Multi-modal input and output contents.
beta_response_custom_tool_call_output_item: BetaResponseCustomToolCallOutput { call_id, output, type, 3 more } 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.
beta_response_file_search_tool_call: object { id, queries, status, 3 more } 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.
beta_response_format_text_config: object { type } or BetaResponseFormatTextJSONSchemaConfig { name, schema, type, 2 more } or object { type } An object specifying the format that the model must output.
Configuring { "type": "json_schema" } enables Structured Outputs,
which ensures the model will match your supplied JSON schema. Learn more in the
Structured Outputs guide.
The default format is { "type": "text" } with no additional options.
Not recommended for gpt-4o and newer models:
Setting to { "type": "json_object" } enables the older JSON mode, which
ensures the message the model generates is valid JSON. Using json_schema
is preferred for models that support it.
An object specifying the format that the model must output.
Configuring { "type": "json_schema" } enables Structured Outputs,
which ensures the model will match your supplied JSON schema. Learn more in the
Structured Outputs guide.
The default format is { "type": "text" } with no additional options.
Not recommended for gpt-4o and newer models:
Setting to { "type": "json_object" } enables the older JSON mode, which
ensures the message the model generates is valid JSON. Using json_schema
is preferred for models that support it.
beta_response_format_text_json_schema_config: object { name, schema, type, 2 more } 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.
beta_response_function_call_output_item: BetaResponseInputTextContent { text, type, prompt_cache_breakpoint } or BetaResponseInputImageContent { type, detail, file_id, 2 more } or BetaResponseInputFileContent { type, detail, file_data, 4 more } A piece of message content, such as text, an image, or a file.
A piece of message content, such as text, an image, or a file.
beta_response_function_tool_call: object { arguments, call_id, name, 6 more } 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.
beta_response_function_tool_call_item: BetaResponseFunctionToolCall { arguments, call_id, name, 6 more } 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.
beta_response_function_web_search: object { id, action, status, 2 more } 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.
beta_response_includable: "file_search_call.results" or "web_search_call.results" or "web_search_call.action.sources" or 5 moreSpecify additional output data to include in the model response. Currently supported values are:
web_search_call.results: Include the search results of the web search tool call.
web_search_call.action.sources: Include the sources of the web search tool call.
code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.
computer_call_output.output.image_url: Include image urls from the computer call output.
file_search_call.results: Include the search results of the file search tool call.
message.input_image.image_url: Include image urls from the input message.
message.output_text.logprobs: Include logprobs with assistant messages.
reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).
Specify additional output data to include in the model response. Currently supported values are:
web_search_call.results: Include the search results of the web search tool call.web_search_call.action.sources: Include the sources of the web search tool call.code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.computer_call_output.output.image_url: Include image urls from the computer call output.file_search_call.results: Include the search results of the file search tool call.message.input_image.image_url: Include image urls from the input message.message.output_text.logprobs: Include logprobs with assistant messages.reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when thestoreparameter is set tofalse, or when an organization is enrolled in the zero data retention program).
beta_response_input_content: BetaResponseInputText { text, type, prompt_cache_breakpoint } or BetaResponseInputImage { detail, type, file_id, 2 more } or BetaResponseInputFile { type, detail, file_data, 4 more } A text input to the model.
A text input to the model.
beta_response_input_image: object { detail, type, file_id, 2 more } An image input to the model. Learn about image inputs.
An image input to the model. Learn about image inputs.
beta_response_input_image_content: object { type, detail, file_id, 2 more } An image input to the model. Learn about image inputs
An image input to the model. Learn about image inputs
beta_response_input_item: BetaEasyInputMessage { content, role, phase, type } or object { content, role, agent, 2 more } or BetaResponseOutputMessage { id, content, role, 4 more } or 32 moreA 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.
beta_response_item: BetaResponseInputMessageItem { id, content, role, 3 more } or BetaResponseOutputMessage { id, content, role, 4 more } or BetaResponseFileSearchToolCall { id, queries, status, 3 more } or 29 moreContent item used to generate a response.
Content item used to generate a response.
beta_response_output_item: BetaResponseOutputMessage { id, content, role, 4 more } or BetaResponseFileSearchToolCall { id, queries, status, 3 more } or BetaResponseFunctionToolCall { arguments, call_id, name, 6 more } or 28 moreAn output message from the model.
An output message from the model.
beta_response_prompt: object { id, variables, version } Reference to a prompt template and its variables.
Learn more.
Reference to a prompt template and its variables. Learn more.
beta_response_reasoning_item: object { id, summary, type, 4 more } 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.
beta_response_stream_event: BetaResponseAudioDeltaEvent { delta, sequence_number, type, agent } or BetaResponseAudioDoneEvent { sequence_number, type, agent } or BetaResponseAudioTranscriptDeltaEvent { delta, sequence_number, type, agent } or 55 moreEvent emitted while a response is streamed.
Event emitted while a response is streamed.
beta_responses_client_event: object { type, background, context_management, 31 more } or BetaResponseInjectEvent { input, response_id, type } Client events accepted by the Responses WebSocket server.
Client events accepted by the Responses WebSocket server.
beta_responses_server_event: BetaResponseAudioDeltaEvent { delta, sequence_number, type, agent } or BetaResponseAudioDoneEvent { sequence_number, type, agent } or BetaResponseAudioTranscriptDeltaEvent { delta, sequence_number, type, agent } or 57 moreServer events emitted by the Responses WebSocket server.
Server events emitted by the Responses WebSocket server.
beta_tool: BetaFunctionTool { name, parameters, strict, 5 more } or BetaFileSearchTool { type, vector_store_ids, filters, 2 more } or BetaComputerTool { type } or 13 moreA tool that can be used to generate a response.
A tool that can be used to generate a response.
beta_tool_choice_options: "none" or "auto" or "required"Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or
more tools.
required means the model must call one or more tools.
Controls which (if any) tool is called by the model.
none means the model will not call any tool and instead generates a message.
auto means the model can pick between generating a message or calling one or
more tools.
required means the model must call one or more tools.
beta_tool_choice_types: object { type } 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.
beta_web_search_preview_tool: object { type, search_content_types, search_context_size, user_location } This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
This tool searches the web for relevant results to use in a response. Learn more about the web search tool.
beta_web_search_tool: object { type, external_web_access, filters, 2 more } Search the Internet for sources related to the prompt. Learn more about the
web search tool.
Search the Internet for sources related to the prompt. Learn more about the web search tool.
BetaResponsesInput Items
BetaResponsesInput Tokens
BetaThreads
Build Assistants that can call models and use tools.
ModelsExpand Collapse
assistant_response_format_option: "auto" or ResponseFormatText { type } or ResponseFormatJSONObject { type } or ResponseFormatJSONSchema { json_schema, type } Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106.
Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.
Setting to { "type": "json_object" } enables JSON mode, which ensures the message the model generates is valid JSON.
Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106.
Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.
Setting to { "type": "json_object" } enables JSON mode, which ensures the message the model generates is valid JSON.
Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
assistant_tool_choice_option: "none" or "auto" or "required" or AssistantToolChoice { type, function } Controls which (if any) tool is called by the model.
none means the model will not call any tools and instead generates a message.
auto is the default value and means the model can pick between generating a message or calling one or more tools.
required means the model must call one or more tools before responding to the user.
Specifying a particular tool like {"type": "file_search"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
Controls which (if any) tool is called by the model.
none means the model will not call any tools and instead generates a message.
auto is the default value and means the model can pick between generating a message or calling one or more tools.
required means the model must call one or more tools before responding to the user.
Specifying a particular tool like {"type": "file_search"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
thread: object { id, created_at, metadata, 2 more } Represents a thread that contains messages.
Represents a thread that contains messages.
BetaThreadsMessages
Build Assistants that can call models and use tools.
Delete message
Retrieve message
Modify message
ModelsExpand Collapse
annotation: FileCitationAnnotation { end_index, file_citation, start_index, 2 more } or FilePathAnnotation { end_index, file_path, start_index, 2 more } A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
annotation_delta: FileCitationDeltaAnnotation { index, type, end_index, 3 more } or FilePathDeltaAnnotation { index, type, end_index, 3 more } A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.
image_file_content_block: object { image_file, type } References an image File in the content of a message.
References an image File in the content of a message.
image_file_delta_block: object { index, type, image_file } References an image File in the content of a message.
References an image File in the content of a message.
message: object { id, assistant_id, attachments, 11 more } Represents a message within a thread.
Represents a message within a thread.
message_content: ImageFileContentBlock { image_file, type } or ImageURLContentBlock { image_url, type } or TextContentBlock { text, type } or RefusalContentBlock { refusal, type } References an image File in the content of a message.
References an image File in the content of a message.
message_content_delta: ImageFileDeltaBlock { index, type, image_file } or TextDeltaBlock { index, type, text } or RefusalDeltaBlock { index, type, refusal } or ImageURLDeltaBlock { index, type, image_url } References an image File in the content of a message.
References an image File in the content of a message.
message_content_part_param: ImageFileContentBlock { image_file, type } or ImageURLContentBlock { image_url, type } or TextContentBlockParam { text, type } References an image File in the content of a message.
References an image File in the content of a message.
BetaThreadsRuns
Build Assistants that can call models and use tools.
Cancel a run
Submit tool outputs to run
ModelsExpand Collapse
run: object { id, assistant_id, cancelled_at, 24 more } Represents an execution run on a thread.
Represents an execution run on a thread.
BetaThreadsRunsSteps
Build Assistants that can call models and use tools.
List run steps
Retrieve run step
ModelsExpand Collapse
tool_call: CodeInterpreterToolCall { id, code_interpreter, type } or FileSearchToolCall { id, file_search, type } or FunctionToolCall { id, function, type } Details of the Code Interpreter tool call the run step was involved in.
Details of the Code Interpreter tool call the run step was involved in.
tool_call_delta: CodeInterpreterToolCallDelta { index, type, id, code_interpreter } or FileSearchToolCallDelta { file_search, index, type, id } or FunctionToolCallDelta { index, type, id, function } Details of the Code Interpreter tool call the run step was involved in.
Details of the Code Interpreter tool call the run step was involved in.