Beta
BetaChatKitSessions
resource openai_beta_chatkit_session
required
computed
openai_beta_chatkit_session
resource "openai_beta_chatkit_session" "example_beta_chatkit_session" {
user = "x"
workflow = {
id = "id"
state_variables = {
foo = "string"
}
tracing = {
enabled = true
}
version = "version"
}
chatkit_configuration = {
automatic_thread_titling = {
enabled = true
}
file_upload = {
enabled = true
max_file_size = 1
max_files = 1
}
history = {
enabled = true
recent_threads = 1
}
}
expires_after = {
anchor = "created_at"
seconds = 1
}
rate_limits = {
max_requests_per_1_minute = 1
}
}
BetaChatKitThreads
data openai_beta_chatkit_threads
openai_beta_chatkit_threads
data "openai_beta_chatkit_threads" "example_beta_chatkit_threads" {
before = "before"
order = "asc"
user = "x"
}
BetaAssistants
Build Assistants that can call models and use tools.
resource openai_beta_assistant
required
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
optional
The system instructions that the assistant uses. The maximum length is 256,000 characters.
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.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1.- All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. - The
gpt-5-promodel defaults to (and only supports)highreasoning effort. xhighis supported for all models aftergpt-5.1-codex-max.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
openai_beta_assistant
resource "openai_beta_assistant" "example_beta_assistant" {
model = "gpt-4o"
description = "description"
instructions = "instructions"
metadata = {
foo = "string"
}
name = "name"
reasoning_effort = "none"
response_format = "auto"
temperature = 1
tool_resources = {
code_interpreter = {
file_ids = ["string"]
}
file_search = {
vector_store_ids = ["string"]
vector_stores = [{
chunking_strategy = {
type = "auto"
}
file_ids = ["string"]
metadata = {
foo = "string"
}
}]
}
}
tools = [{
type = "code_interpreter"
}]
top_p = 1
}
data openai_beta_assistant
computed
The system instructions that the assistant uses. The maximum length is 256,000 characters.
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
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.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_assistant
data "openai_beta_assistant" "example_beta_assistant" {
assistant_id = "assistant_id"
}
data openai_beta_assistants
optional
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
openai_beta_assistants
data "openai_beta_assistants" "example_beta_assistants" {
before = "before"
}
BetaThreads
Build Assistants that can call models and use tools.
resource openai_beta_thread
optional
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread
resource "openai_beta_thread" "example_beta_thread" {
messages = [{
content = "string"
role = "user"
attachments = [{
file_id = "file_id"
tools = [{
type = "code_interpreter"
}]
}]
metadata = {
foo = "string"
}
}]
metadata = {
foo = "string"
}
tool_resources = {
code_interpreter = {
file_ids = ["string"]
}
file_search = {
vector_store_ids = ["string"]
vector_stores = [{
chunking_strategy = {
type = "auto"
}
file_ids = ["string"]
metadata = {
foo = "string"
}
}]
}
}
}
data openai_beta_thread
computed
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread
data "openai_beta_thread" "example_beta_thread" {
thread_id = "thread_id"
}
BetaThreadsRuns
Build Assistants that can call models and use tools.
resource openai_beta_thread_run
required
The ID of the assistant to use to execute this run.
optional
Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis.
The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status incomplete. See incomplete_details for more info.
The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status incomplete. See incomplete_details for more info.
The ID of the Model to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
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.
If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.
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.
Whether to enable parallel function calling during tool use.
Constrains effort on reasoning for
reasoning models.
Currently supported values are none, minimal, low, medium, high, and xhigh. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.
gpt-5.1defaults tonone, which does not perform reasoning. The supported reasoning values forgpt-5.1arenone,low,medium, andhigh. Tool calls are supported for all reasoning values in gpt-5.1.- All models before
gpt-5.1default tomediumreasoning effort, and do not supportnone. - The
gpt-5-promodel defaults to (and only supports)highreasoning effort. xhighis supported for all models aftergpt-5.1-codex-max.
What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
We generally recommend altering this or temperature but not both.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread_run
resource "openai_beta_thread_run" "example_beta_thread_run" {
thread_id = "thread_id"
assistant_id = "assistant_id"
additional_instructions = "additional_instructions"
additional_messages = [{
content = "string"
role = "user"
attachments = [{
file_id = "file_id"
tools = [{
type = "code_interpreter"
}]
}]
metadata = {
foo = "string"
}
}]
instructions = "instructions"
max_completion_tokens = 256
max_prompt_tokens = 256
metadata = {
foo = "string"
}
model = "string"
parallel_tool_calls = true
reasoning_effort = "none"
response_format = "auto"
stream = false
temperature = 1
tool_choice = "none"
tools = [{
type = "code_interpreter"
}]
top_p = 1
truncation_strategy = {
type = "auto"
last_messages = 1
}
}
data openai_beta_thread_run
computed
The ID of the assistant used for execution of this run.
The instructions that the assistant used for this run.
The maximum number of completion tokens specified to have been used over the course of the run.
The maximum number of prompt tokens specified to have been used over the course of the run.
The model that the assistant used for this run.
Whether to enable parallel function calling during tool use.
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.
The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired.
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.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread_run
data "openai_beta_thread_run" "example_beta_thread_run" {
thread_id = "thread_id"
run_id = "run_id"
}
data openai_beta_thread_runs
optional
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
openai_beta_thread_runs
data "openai_beta_thread_runs" "example_beta_thread_runs" {
thread_id = "thread_id"
before = "before"
}
BetaThreadsRunsSteps
Build Assistants that can call models and use tools.
data openai_beta_thread_run_step
optional
A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.
See the file search tool documentation for more information.
computed
The ID of the assistant associated with the run step.
The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired.
The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread_run_step
data "openai_beta_thread_run_step" "example_beta_thread_run_step" {
thread_id = "thread_id"
run_id = "run_id"
step_id = "step_id"
include = ["step_details.tool_calls[*].file_search.results[*].content"]
}
data openai_beta_thread_run_steps
optional
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[*].file_search.results[*].content to fetch the file search result content.
See the file search tool documentation for more information.
openai_beta_thread_run_steps
data "openai_beta_thread_run_steps" "example_beta_thread_run_steps" {
thread_id = "thread_id"
run_id = "run_id"
before = "before"
include = ["step_details.tool_calls[*].file_search.results[*].content"]
}
BetaThreadsMessages
Build Assistants that can call models and use tools.
resource openai_beta_thread_message
required
The role of the entity that is creating the message. Allowed values include:
user: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.assistant: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
optional
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread_message
resource "openai_beta_thread_message" "example_beta_thread_message" {
thread_id = "thread_id"
content = "string"
role = "user"
attachments = [{
file_id = "file_id"
tools = [{
type = "code_interpreter"
}]
}]
metadata = {
foo = "string"
}
}
data openai_beta_thread_message
computed
If applicable, the ID of the assistant that authored this message.
The ID of the run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
openai_beta_thread_message
data "openai_beta_thread_message" "example_beta_thread_message" {
thread_id = "thread_id"
message_id = "message_id"
}
data openai_beta_thread_messages
optional
A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
openai_beta_thread_messages
data "openai_beta_thread_messages" "example_beta_thread_messages" {
thread_id = "thread_id"
before = "before"
run_id = "run_id"
}