Azure OpenAI threads

API Version: v1

Server: {endpoint}/openai/v1 — Azure AI Foundry Models APIs

Server Variables:

Variable Default Description
endpoint A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).

Authentication

ApiKeyAuth (API Key)

Pass your API key in the api-key header.

ApiKeyAuth_ (API Key)

Pass your API key in the authorization header.

OAuth2Auth (OAuth 2.0)

Flow: implicit

Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Scopes:

  • https://cognitiveservices.azure.com/.default

Security Requirements

Endpoints accept any one of the following authentication methods:

  1. ApiKeyAuth
  2. ApiKeyAuth_
  3. OAuth2Auth (scopes: https://cognitiveservices.azure.com/.default)

Create thread

POST {endpoint}/openai/v1/threads

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.

Request Body

Content-Type: application/json

Name Type Description Required Default
messages array of OpenAI.CreateMessageRequest A list of messages to start the thread with. No
metadata OpenAI.Metadata or null No
tool_resources OpenAI.CreateThreadRequestToolResources or null No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ThreadObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Create thread and run

POST {endpoint}/openai/v1/threads/runs

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.

Request Body

Content-Type: application/json

Name Type Description Required Default
assistant_id string The ID of the assistant to use to execute this run. Yes
instructions string or null Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. No
max_completion_tokens integer or null 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.
Constraints: min: 256
No
max_prompt_tokens integer or null 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.
Constraints: min: 256
No
metadata OpenAI.Metadata or null No
model string 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. No
parallel_tool_calls boolean Whether to enable parallel function calling during tool use. No True
response_format OpenAI.AssistantsApiResponseFormatOption 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
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.
No
stream boolean or null 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. No
temperature number or null 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.
Constraints: min: 0, max: 2
No
thread OpenAI.CreateThreadRequest Options to create a new thread. If no thread is provided when running a
request, an empty thread will be created.
No
tool_choice OpenAI.AssistantsApiToolChoiceOption 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.
No
tool_resources OpenAI.CreateThreadAndRunRequestToolResources or null A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs. No
tools array of OpenAI.AssistantTool or null Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
Constraints: maxItems: 20
No
top_p number or null 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.
Constraints: min: 0, max: 1
No
truncation_strategy OpenAI.TruncationObject Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Delete thread

DELETE {endpoint}/openai/v1/threads/{thread_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.DeleteThreadResponse

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Retrieve thread

GET {endpoint}/openai/v1/threads/{thread_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ThreadObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Modify thread

POST {endpoint}/openai/v1/threads/{thread_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
metadata OpenAI.Metadata or null No
tool_resources OpenAI.ModifyThreadRequestToolResources or null No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ThreadObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

List messages

GET {endpoint}/openai/v1/threads/{thread_id}/messages

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
limit query No integer
Serialization: explode: false
order query No string
Possible values: asc, desc

Serialization: explode: false
after query No string
Serialization: explode: false
before query No string
Serialization: explode: false
run_id query No string
Serialization: explode: false

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ListMessagesResponse

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Create message

POST {endpoint}/openai/v1/threads/{thread_id}/messages

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
attachments array of OpenAI.CreateMessageRequestAttachments or null No
content string or array of OpenAI.MessageContentImageFileObject or OpenAI.MessageContentImageUrlObject or OpenAI.MessageRequestContentTextObject Yes
metadata OpenAI.Metadata or null No
role enum 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.
Possible values: user, assistant
Yes

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.MessageObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Delete message

DELETE {endpoint}/openai/v1/threads/{thread_id}/messages/{message_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
message_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.DeleteMessageResponse

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Retrieve message

GET {endpoint}/openai/v1/threads/{thread_id}/messages/{message_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
message_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.MessageObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Modify message

POST {endpoint}/openai/v1/threads/{thread_id}/messages/{message_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
message_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
metadata OpenAI.Metadata or null No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.MessageObject

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Create run

POST {endpoint}/openai/v1/threads/{thread_id}/runs

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
additional_instructions string or null 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. No
additional_messages array of OpenAI.CreateMessageRequest or null Adds additional messages to the thread before creating the run. No
assistant_id string The ID of the assistant to use to execute this run. Yes
instructions string or null Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis. No
max_completion_tokens integer or null 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.
Constraints: min: 256
No
max_prompt_tokens integer or null 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.
Constraints: min: 256
No
metadata OpenAI.Metadata or null No
model string 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. No
parallel_tool_calls boolean Whether to enable parallel function calling during tool use. No True
reasoning_effort OpenAI.ReasoningEffort 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.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
- All models before gpt-5.1 default to medium reasoning effort, and do not support none.
- The gpt-5-pro model defaults to (and only supports) high reasoning effort.
- xhigh is supported for all models after gpt-5.1-codex-max.
No
response_format OpenAI.AssistantsApiResponseFormatOption 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
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.
No
stream boolean or null 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. No
temperature number or null 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.
Constraints: min: 0, max: 2
No
tool_choice OpenAI.AssistantsApiToolChoiceOption 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.
No
tools array of OpenAI.AssistantTool or null Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
Constraints: maxItems: 20
No
top_p number or null 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.
Constraints: min: 0, max: 1
No
truncation_strategy OpenAI.TruncationObject Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

List runs

GET {endpoint}/openai/v1/threads/{thread_id}/runs

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
limit query No integer
Serialization: explode: false
order query No string
Possible values: asc, desc

Serialization: explode: false
after query No string
Serialization: explode: false
before query No string
Serialization: explode: false

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ListRunsResponse

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Retrieve run

GET {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Modify run

POST {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
metadata OpenAI.Metadata or null No

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Cancel run

POST {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}/cancel

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

List run steps

GET {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}/steps

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string
limit query No integer
Serialization: explode: false
order query No string
Possible values: asc, desc

Serialization: explode: false
after query No string
Serialization: explode: false
before query No string
Serialization: explode: false

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.ListRunStepsResponse

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Get run step

GET {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string
step_id path Yes string

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunStepObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Submit tool outputs to run

POST {endpoint}/openai/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs

URI Parameters

Name In Required Type Description
endpoint server Yes string A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.
For example:
https://YOUR-RESOURCE-NAME.openai.azure.com/openai/v1/).
api-version query No string
Possible values: v1, preview
The explicit Azure AI Foundry Models API version to use for this request.
v1 if not otherwise specified.
thread_id path Yes string
run_id path Yes string

Request Body

Content-Type: application/json

Name Type Description Required Default
stream boolean or null No
tool_outputs array of OpenAI.SubmitToolOutputsRunRequestToolOutputs A list of tools for which the outputs are being submitted. Yes

Responses

Status Code: 200

Description: The request has succeeded.

Content-Type Type Description
application/json OpenAI.RunObject

Status Code: default

Description: An unexpected error response.

Content-Type Type Description
application/json object
Name Type Description Required Default
code string or null Yes
inner_error No
message string Yes
param string or null No
type string No

Response Headers:

Header Type Description
apim-request-id string A request ID used for troubleshooting purposes.

Components

AzureAIFoundryModelsApiVersion

Property Value
Type string
Values v1
preview

OpenAI.AssistantTool

Discriminator for OpenAI.AssistantTool

This component uses the property type to discriminate between different types:

Type Value Schema
code_interpreter OpenAI.AssistantToolsCode
file_search OpenAI.AssistantToolsFileSearch
function OpenAI.AssistantToolsFunction
Name Type Description Required Default
type OpenAI.AssistantToolType Yes

OpenAI.AssistantToolType

Property Value
Type string
Values code_interpreter
file_search
function

OpenAI.AssistantToolsCode

Code interpreter tool

Name Type Description Required Default
type enum The type of tool being defined: code_interpreter
Possible values: code_interpreter
Yes

OpenAI.AssistantToolsFileSearch

FileSearch tool

Name Type Description Required Default
file_search OpenAI.AssistantToolsFileSearchFileSearch No
└─ max_num_results integer Constraints: min: 1, max: 50 No
└─ ranking_options OpenAI.FileSearchRankingOptions The ranking options for the file search. If not specified, the file search tool will use the auto ranker and a score_threshold of 0. No
type enum The type of tool being defined: file_search
Possible values: file_search
Yes

OpenAI.AssistantToolsFileSearchFileSearch

Name Type Description Required Default
max_num_results integer Constraints: min: 1, max: 50 No
ranking_options OpenAI.FileSearchRankingOptions The ranking options for the file search. If not specified, the file search tool will use the auto ranker and a score_threshold of 0. No

OpenAI.AssistantToolsFileSearchTypeOnly

FileSearch tool

Name Type Description Required Default
type enum The type of tool being defined: file_search
Possible values: file_search
Yes

OpenAI.AssistantToolsFunction

Function tool

Name Type Description Required Default
function OpenAI.FunctionObject Yes
type enum The type of tool being defined: function
Possible values: function
Yes

OpenAI.AssistantsApiResponseFormatOption

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 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.

This component can be one of the following:

OpenAI.AssistantsApiToolChoiceOption

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.

This component can be one of the following:

OpenAI.AssistantsNamedToolChoice

Specifies a tool the model should use. Use to force the model to call a specific tool.

Name Type Description Required Default
function OpenAI.AssistantsNamedToolChoiceFunction No
type enum The type of the tool. If type is function, the function name must be set
Possible values: function, code_interpreter, file_search
Yes

OpenAI.AssistantsNamedToolChoiceFunction

Name Type Description Required Default
name string Yes

OpenAI.CreateChatCompletionRequestResponseFormat

An object specifying the format that the model must output. 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 the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.

Discriminator for OpenAI.CreateChatCompletionRequestResponseFormat

This component uses the property type to discriminate between different types:

Type Value Schema
json_schema OpenAI.ResponseFormatJsonSchema
text OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText
json_object OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject
Name Type Description Required Default
type OpenAI.CreateChatCompletionRequestResponseFormatType Yes

OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject

JSON object

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.

Name Type Description Required Default
type enum The type of response format being defined. Always json_object.
Possible values: json_object
Yes

OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText

Text

Default response format. Used to generate text responses.

Name Type Description Required Default
type enum The type of response format being defined. Always text.
Possible values: text
Yes

OpenAI.CreateChatCompletionRequestResponseFormatType

Property Value
Type string
Values text
json_schema
json_object

OpenAI.CreateMessageRequest

Name Type Description Required Default
attachments array of OpenAI.CreateMessageRequestAttachments or null No
content string or array of OpenAI.MessageContentImageFileObject or OpenAI.MessageContentImageUrlObject or OpenAI.MessageRequestContentTextObject Yes
metadata OpenAI.Metadata or null No
role enum 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.
Possible values: user, assistant
Yes

OpenAI.CreateMessageRequestAttachments

Name Type Description Required Default
file_id string No
tools array of OpenAI.AssistantToolsCode or OpenAI.AssistantToolsFileSearchTypeOnly No

OpenAI.CreateRunRequest

Name Type Description Required Default
additional_instructions string or null 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. No
additional_messages array of OpenAI.CreateMessageRequest or null Adds additional messages to the thread before creating the run. No
assistant_id string The ID of the assistant to use to execute this run. Yes
instructions string or null Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis. No
max_completion_tokens integer or null 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.
Constraints: min: 256
No
max_prompt_tokens integer or null 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.
Constraints: min: 256
No
metadata OpenAI.Metadata or null No
model string 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. No
parallel_tool_calls boolean Whether to enable parallel function calling during tool use. No True
reasoning_effort OpenAI.ReasoningEffort 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.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
- All models before gpt-5.1 default to medium reasoning effort, and do not support none.
- The gpt-5-pro model defaults to (and only supports) high reasoning effort.
- xhigh is supported for all models after gpt-5.1-codex-max.
No
response_format OpenAI.AssistantsApiResponseFormatOption 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
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.
No
stream boolean or null 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. No
temperature number or null 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.
Constraints: min: 0, max: 2
No
tool_choice OpenAI.AssistantsApiToolChoiceOption 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.
No
tools array of OpenAI.AssistantTool or null Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
Constraints: maxItems: 20
No
top_p number or null 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.
Constraints: min: 0, max: 1
No
truncation_strategy OpenAI.TruncationObject Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. No

OpenAI.CreateThreadAndRunRequest

Name Type Description Required Default
assistant_id string The ID of the assistant to use to execute this run. Yes
instructions string or null Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. No
max_completion_tokens integer or null 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.
Constraints: min: 256
No
max_prompt_tokens integer or null 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.
Constraints: min: 256
No
metadata OpenAI.Metadata or null No
model string 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. No
parallel_tool_calls boolean Whether to enable parallel function calling during tool use. No True
response_format OpenAI.AssistantsApiResponseFormatOption 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
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.
No
stream boolean or null 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. No
temperature number or null 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.
Constraints: min: 0, max: 2
No
thread OpenAI.CreateThreadRequest Options to create a new thread. If no thread is provided when running a
request, an empty thread will be created.
No
tool_choice OpenAI.AssistantsApiToolChoiceOption 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.
No
tool_resources OpenAI.CreateThreadAndRunRequestToolResources or null A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs. No
tools array of OpenAI.AssistantTool or null Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
Constraints: maxItems: 20
No
top_p number or null 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.
Constraints: min: 0, max: 1
No
truncation_strategy OpenAI.TruncationObject Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. No

OpenAI.CreateThreadAndRunRequestToolResources

Name Type Description Required Default
code_interpreter OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter No
file_search OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch No

OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter

Name Type Description Required Default
file_ids array of string Constraints: maxItems: 20 No []

OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch

Name Type Description Required Default
vector_store_ids array of string Constraints: maxItems: 1 No

OpenAI.CreateThreadRequest

Options to create a new thread. If no thread is provided when running a request, an empty thread will be created.

Name Type Description Required Default
messages array of OpenAI.CreateMessageRequest A list of messages to start the thread with. No
metadata OpenAI.Metadata or null No
tool_resources OpenAI.CreateThreadRequestToolResources or null No

OpenAI.CreateThreadRequestToolResources

Name Type Description Required Default
code_interpreter OpenAI.CreateThreadRequestToolResourcesCodeInterpreter No
file_search OpenAI.CreateThreadRequestToolResourcesFileSearch No

OpenAI.CreateThreadRequestToolResourcesCodeInterpreter

Name Type Description Required Default
file_ids array of string Constraints: maxItems: 20 No

OpenAI.CreateThreadRequestToolResourcesFileSearch

Name Type Description Required Default
vector_store_ids array of string Constraints: maxItems: 1 No
vector_stores array of OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores Constraints: maxItems: 1 No

OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStores

Name Type Description Required Default
chunking_strategy OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto or OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic No
file_ids array of string Constraints: maxItems: 100000000 No
metadata OpenAI.Metadata or null No

OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyAuto

Name Type Description Required Default
type enum
Possible values: auto
Yes

OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStatic

Name Type Description Required Default
static OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic Yes
type enum
Possible values: static
Yes

OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoresChunkingStrategyStaticStatic

Name Type Description Required Default
chunk_overlap_tokens integer Yes
max_chunk_size_tokens integer Constraints: min: 100, max: 4096 Yes

OpenAI.DeleteMessageResponse

Name Type Description Required Default
deleted boolean Yes
id string Yes
object enum
Possible values: thread.message.deleted
Yes

OpenAI.DeleteThreadResponse

Name Type Description Required Default
deleted boolean Yes
id string Yes
object enum
Possible values: thread.deleted
Yes

OpenAI.FileSearchRanker

The ranker to use for the file search. If not specified will use the auto ranker.

Property Value
Type string
Values auto
default_2024_08_21

OpenAI.FileSearchRankingOptions

File search tool call ranking options

The ranking options for the file search. If not specified, the file search tool will use the auto ranker and a score_threshold of 0.

Name Type Description Required Default
ranker OpenAI.FileSearchRanker The ranker to use for the file search. If not specified will use the auto ranker. No
score_threshold number The score threshold for the file search. All values must be a floating point number between 0 and 1.
Constraints: min: 0, max: 1
Yes

OpenAI.FunctionObject

Name Type Description Required Default
description string A description of what the function does, used by the model to choose when and how to call the function. No
name string The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. Yes
parameters OpenAI.FunctionParameters The parameters the functions accepts, described as a JSON Schema object. See the JSON Schema reference for documentation about the format.
Omitting parameters defines a function with an empty parameter list.
No
strict boolean or null No

OpenAI.FunctionParameters

The parameters the functions accepts, described as a JSON Schema object. See the JSON Schema reference for documentation about the format. Omitting parameters defines a function with an empty parameter list.

Type: object

OpenAI.ListMessagesResponse

Name Type Description Required Default
data array of OpenAI.MessageObject Yes
first_id string Yes
has_more boolean Yes
last_id string Yes
object string Yes

OpenAI.ListRunStepsResponse

Name Type Description Required Default
data array of OpenAI.RunStepObject Yes
first_id string Yes
has_more boolean Yes
last_id string Yes
object string Yes

OpenAI.ListRunsResponse

Name Type Description Required Default
data array of OpenAI.RunObject Yes
first_id string Yes
has_more boolean Yes
last_id string Yes
object string Yes

OpenAI.MessageContentImageFileObject

Image file

References an image File in the content of a message.

Name Type Description Required Default
image_file OpenAI.MessageContentImageFileObjectImageFile Yes
type enum Always image_file.
Possible values: image_file
Yes

OpenAI.MessageContentImageFileObjectImageFile

Name Type Description Required Default
detail enum
Possible values: auto, low, high
No auto
file_id string Yes

OpenAI.MessageContentImageUrlObject

Image URL

References an image URL in the content of a message.

Name Type Description Required Default
image_url OpenAI.MessageContentImageUrlObjectImageUrl Yes
type enum The type of the content part.
Possible values: image_url
Yes

OpenAI.MessageContentImageUrlObjectImageUrl

Name Type Description Required Default
detail enum
Possible values: auto, low, high
No auto
url string (uri) Yes

OpenAI.MessageContentRefusalObject

Refusal

The refusal content generated by the assistant.

Name Type Description Required Default
refusal string Yes
type enum Always refusal.
Possible values: refusal
Yes

OpenAI.MessageContentTextAnnotationsFileCitationObject

File citation

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.

Name Type Description Required Default
end_index integer Constraints: min: 0 Yes
file_citation OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation Yes
start_index integer Constraints: min: 0 Yes
text string The text in the message content that needs to be replaced. Yes
type enum Always file_citation.
Possible values: file_citation
Yes

OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation

Name Type Description Required Default
file_id string Yes

OpenAI.MessageContentTextAnnotationsFilePathObject

File path

A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.

Name Type Description Required Default
end_index integer Constraints: min: 0 Yes
file_path OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath Yes
start_index integer Constraints: min: 0 Yes
text string The text in the message content that needs to be replaced. Yes
type enum Always file_path.
Possible values: file_path
Yes

OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath

Name Type Description Required Default
file_id string Yes

OpenAI.MessageContentTextObject

Text

The text content that is part of a message.

Name Type Description Required Default
text OpenAI.MessageContentTextObjectText Yes
type enum Always text.
Possible values: text
Yes

OpenAI.MessageContentTextObjectText

Name Type Description Required Default
annotations array of OpenAI.TextAnnotation Yes
value string Yes

OpenAI.MessageObject

The message object

Represents a message within a thread.

Name Type Description Required Default
assistant_id string or null Yes
attachments array of OpenAI.MessageObjectAttachments or null Yes
completed_at string or null Yes
content array of OpenAI.MessageObjectContent The content of the message in array of text and/or images. Yes
created_at integer (unixtime) The Unix timestamp (in seconds) for when the message was created. Yes
id string The identifier, which can be referenced in API endpoints. Yes
incomplete_at string or null Yes
incomplete_details OpenAI.MessageObjectIncompleteDetails or null Yes
metadata OpenAI.Metadata or null Yes
object enum The object type, which is always thread.message.
Possible values: thread.message
Yes
role enum The entity that produced the message. One of user or assistant.
Possible values: user, assistant
Yes
run_id string or null Yes
status enum The status of the message, which can be either in_progress, incomplete, or completed.
Possible values: in_progress, incomplete, completed
Yes
thread_id string The thread ID that this message belongs to. Yes

OpenAI.MessageObjectAttachments

Name Type Description Required Default
file_id string No
tools array of OpenAI.AssistantToolsCode or OpenAI.AssistantToolsFileSearchTypeOnly No

OpenAI.MessageObjectContent

Discriminator for OpenAI.MessageObjectContent

This component uses the property type to discriminate between different types:

Type Value Schema
image_url OpenAI.MessageContentImageUrlObject
text OpenAI.MessageContentTextObject
refusal OpenAI.MessageContentRefusalObject
image_file OpenAI.MessageContentImageFileObject
Name Type Description Required Default
type OpenAI.MessageObjectContentType Yes

OpenAI.MessageObjectContentType

Property Value
Type string
Values image_file
image_url
text
refusal

OpenAI.MessageObjectIncompleteDetails

Name Type Description Required Default
reason enum
Possible values: content_filter, max_tokens, run_cancelled, run_expired, run_failed
Yes

OpenAI.MessageRequestContentTextObject

Text

The text content that is part of a message.

Name Type Description Required Default
text string Text content to be sent to the model Yes
type enum Always text.
Possible values: text
Yes

OpenAI.Metadata

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.

Type: object

OpenAI.ModifyMessageRequest

Name Type Description Required Default
metadata OpenAI.Metadata or null No

OpenAI.ModifyRunRequest

Name Type Description Required Default
metadata OpenAI.Metadata or null No

OpenAI.ModifyThreadRequest

Name Type Description Required Default
metadata OpenAI.Metadata or null No
tool_resources OpenAI.ModifyThreadRequestToolResources or null No

OpenAI.ModifyThreadRequestToolResources

Name Type Description Required Default
code_interpreter OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter No
file_search OpenAI.ModifyThreadRequestToolResourcesFileSearch No

OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter

Name Type Description Required Default
file_ids array of string Constraints: maxItems: 20 No

OpenAI.ModifyThreadRequestToolResourcesFileSearch

Name Type Description Required Default
vector_store_ids array of string Constraints: maxItems: 1 No

OpenAI.ReasoningEffort

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.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
  • All models before gpt-5.1 default to medium reasoning effort, and do not support none.
  • The gpt-5-pro model defaults to (and only supports) high reasoning effort.
  • xhigh is supported for all models after gpt-5.1-codex-max.
Property Value
Description 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.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, medium, and high. Tool calls are supported for all reasoning values in gpt-5.1.
- All models before gpt-5.1 default to medium reasoning effort, and do not support none.
- The gpt-5-pro model defaults to (and only supports) high reasoning effort.
- xhigh is supported for all models after gpt-5.1-codex-max.
Type string
Values none
minimal
low
medium
high
xhigh

OpenAI.ResponseFormatJsonObject

JSON object

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.

Name Type Description Required Default
type enum The type of response format being defined. Always json_object.
Possible values: json_object
Yes

OpenAI.ResponseFormatJsonSchema

JSON schema

JSON Schema response format. Used to generate structured JSON responses.

Name Type Description Required Default
json_schema OpenAI.ResponseFormatJsonSchemaJsonSchema Yes
└─ description string No
└─ name string Yes
└─ schema OpenAI.ResponseFormatJsonSchemaSchema The schema for the response format, described as a JSON Schema object.
Learn how to build JSON schemas here.
No
└─ strict boolean or null No
type enum The type of response format being defined. Always json_schema.
Possible values: json_schema
Yes

OpenAI.ResponseFormatJsonSchemaJsonSchema

Name Type Description Required Default
description string No
name string Yes
schema OpenAI.ResponseFormatJsonSchemaSchema The schema for the response format, described as a JSON Schema object.
Learn how to build JSON schemas here.
No
strict boolean or null No

OpenAI.ResponseFormatJsonSchemaSchema

JSON schema

The schema for the response format, described as a JSON Schema object. Learn how to build JSON schemas here.

Type: object

OpenAI.ResponseFormatText

Text

Default response format. Used to generate text responses.

Name Type Description Required Default
type enum The type of response format being defined. Always text.
Possible values: text
Yes

OpenAI.RunCompletionUsage

Usage statistics related to the run. This value will be null if the run is not in a terminal state (i.e. in_progress, queued, etc.).

Name Type Description Required Default
completion_tokens integer Number of completion tokens used over the course of the run. Yes
prompt_tokens integer Number of prompt tokens used over the course of the run. Yes
total_tokens integer Total number of tokens used (prompt + completion). Yes

OpenAI.RunObject

A run on a thread

Represents an execution run on a thread.

Name Type Description Required Default
assistant_id string The ID of the assistant used for execution of this run. Yes
cancelled_at string or null The Unix timestamp (in seconds) for when the run was cancelled. Yes
completed_at string or null The Unix timestamp (in seconds) for when the run was completed. Yes
created_at integer (unixtime) The Unix timestamp (in seconds) for when the run was created. Yes
expires_at string or null The Unix timestamp (in seconds) for when the run will expire. Yes
failed_at string or null The Unix timestamp (in seconds) for when the run failed. Yes
id string The identifier, which can be referenced in API endpoints. Yes
incomplete_details OpenAI.RunObjectIncompleteDetails or null Details on why the run is incomplete. Will be null if the run is not incomplete. Yes
instructions string The instructions that the assistant used for this run. Yes
last_error OpenAI.RunObjectLastError or null The last error associated with this run. Will be null if there are no errors. Yes
max_completion_tokens integer or null The maximum number of completion tokens specified to have been used over the course of the run.
Constraints: min: 256
Yes
max_prompt_tokens integer or null The maximum number of prompt tokens specified to have been used over the course of the run.
Constraints: min: 256
Yes
metadata OpenAI.Metadata or null Yes
model string The model that the assistant used for this run. Yes
object enum The object type, which is always thread.run.
Possible values: thread.run
Yes
parallel_tool_calls boolean Whether to enable parallel function calling during tool use. Yes True
required_action OpenAI.RunObjectRequiredAction or null Details on the action required to continue the run. Will be null if no action is required. Yes
response_format OpenAI.AssistantsApiResponseFormatOption 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
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.
Yes
started_at string or null The Unix timestamp (in seconds) for when the run was started. Yes
status OpenAI.RunStatus The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired. Yes
temperature number or null The sampling temperature used for this run. If not set, defaults to 1. No
thread_id string The ID of the thread that was executed on as a part of this run. Yes
tool_choice OpenAI.AssistantsApiToolChoiceOption 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.
Yes
tools array of OpenAI.AssistantTool The list of tools that the assistant used for this run.
Constraints: maxItems: 20
Yes []
top_p number or null The nucleus sampling value used for this run. If not set, defaults to 1. No
truncation_strategy OpenAI.TruncationObject Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. Yes
usage OpenAI.RunCompletionUsage or null Yes

OpenAI.RunObjectIncompleteDetails

Name Type Description Required Default
reason enum
Possible values: max_completion_tokens, max_prompt_tokens
No

OpenAI.RunObjectLastError

Name Type Description Required Default
code enum
Possible values: server_error, rate_limit_exceeded, invalid_prompt
Yes
message string Yes

OpenAI.RunObjectRequiredAction

Name Type Description Required Default
submit_tool_outputs OpenAI.RunObjectRequiredActionSubmitToolOutputs Yes
type enum
Possible values: submit_tool_outputs
Yes

OpenAI.RunObjectRequiredActionSubmitToolOutputs

Name Type Description Required Default
tool_calls array of OpenAI.RunToolCallObject Yes

OpenAI.RunStatus

The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired.

Property Value
Type string
Values queued
in_progress
requires_action
cancelling
cancelled
failed
completed
incomplete
expired

OpenAI.RunStepCompletionUsage

Usage statistics related to the run step. This value will be null while the run step's status is in_progress.

Name Type Description Required Default
completion_tokens integer Number of completion tokens used over the course of the run step. Yes
prompt_tokens integer Number of prompt tokens used over the course of the run step. Yes
total_tokens integer Total number of tokens used (prompt + completion). Yes

OpenAI.RunStepDetailsMessageCreationObject

Message creation

Details of the message creation by the run step.

Name Type Description Required Default
message_creation OpenAI.RunStepDetailsMessageCreationObjectMessageCreation Yes
type enum Always message_creation.
Possible values: message_creation
Yes

OpenAI.RunStepDetailsMessageCreationObjectMessageCreation

Name Type Description Required Default
message_id string Yes

OpenAI.RunStepDetailsToolCall

Discriminator for OpenAI.RunStepDetailsToolCall

This component uses the property type to discriminate between different types:

Type Value Schema
code_interpreter OpenAI.RunStepDetailsToolCallsCodeObject
file_search OpenAI.RunStepDetailsToolCallsFileSearchObject
function OpenAI.RunStepDetailsToolCallsFunctionObject
Name Type Description Required Default
type OpenAI.RunStepDetailsToolCallType Yes

OpenAI.RunStepDetailsToolCallType

Property Value
Type string
Values code_interpreter
file_search
function

OpenAI.RunStepDetailsToolCallsCodeObject

Code Interpreter tool call

Details of the Code Interpreter tool call the run step was involved in.

Name Type Description Required Default
code_interpreter OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter Yes
└─ input string Yes
└─ outputs array of OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject or OpenAI.RunStepDetailsToolCallsCodeOutputImageObject Yes
id string The ID of the tool call. Yes
type enum The type of tool call. This is always going to be code_interpreter for this type of tool call.
Possible values: code_interpreter
Yes

OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter

Name Type Description Required Default
input string Yes
outputs array of OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject or OpenAI.RunStepDetailsToolCallsCodeOutputImageObject Yes

OpenAI.RunStepDetailsToolCallsCodeOutputImageObject

Code Interpreter image output

Name Type Description Required Default
image OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage Yes
type enum Always image.
Possible values: image
Yes

OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage

Name Type Description Required Default
file_id string Yes

OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject

Code Interpreter log output

Text output from the Code Interpreter tool call as part of a run step.

Name Type Description Required Default
logs string The text output from the Code Interpreter tool call. Yes
type enum Always logs.
Possible values: logs
Yes

OpenAI.RunStepDetailsToolCallsFileSearchObject

File search tool call

Name Type Description Required Default
file_search OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch Yes
└─ ranking_options OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject The ranking options for the file search. No
└─ results array of OpenAI.RunStepDetailsToolCallsFileSearchResultObject No
id string The ID of the tool call object. Yes
type enum The type of tool call. This is always going to be file_search for this type of tool call.
Possible values: file_search
Yes

OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch

Name Type Description Required Default
ranking_options OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject The ranking options for the file search. No
results array of OpenAI.RunStepDetailsToolCallsFileSearchResultObject No

OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject

File search tool call ranking options

The ranking options for the file search.

Name Type Description Required Default
ranker OpenAI.FileSearchRanker The ranker to use for the file search. If not specified will use the auto ranker. Yes
score_threshold number The score threshold for the file search. All values must be a floating point number between 0 and 1.
Constraints: min: 0, max: 1
Yes

OpenAI.RunStepDetailsToolCallsFileSearchResultObject

File search tool call result

A result instance of the file search.

Name Type Description Required Default
content array of OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent The content of the result that was found. The content is only included if requested via the include query parameter. No
file_id string The ID of the file that result was found in. Yes
file_name string The name of the file that result was found in. Yes
score number The score of the result. All values must be a floating point number between 0 and 1.
Constraints: min: 0, max: 1
Yes

OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent

Name Type Description Required Default
text string No
type enum
Possible values: text
No

OpenAI.RunStepDetailsToolCallsFunctionObject

Function tool call

Name Type Description Required Default
function OpenAI.RunStepDetailsToolCallsFunctionObjectFunction Yes
└─ arguments string Yes
└─ name string Yes
└─ output string or null Yes
id string The ID of the tool call object. Yes
type enum The type of tool call. This is always going to be function for this type of tool call.
Possible values: function
Yes

OpenAI.RunStepDetailsToolCallsFunctionObjectFunction

Name Type Description Required Default
arguments string Yes
name string Yes
output string or null Yes

OpenAI.RunStepDetailsToolCallsObject

Tool calls

Details of the tool call.

Name Type Description Required Default
tool_calls array of OpenAI.RunStepDetailsToolCall An array of tool calls the run step was involved in. These can be associated with one of three types of tools: code_interpreter, file_search, or function. Yes
type enum Always tool_calls.
Possible values: tool_calls
Yes

OpenAI.RunStepObject

Run steps

Represents a step in execution of a run.

Name Type Description Required Default
assistant_id string The ID of the assistant associated with the run step. Yes
cancelled_at string or null Yes
completed_at string or null Yes
created_at integer (unixtime) The Unix timestamp (in seconds) for when the run step was created. Yes
expired_at string or null Yes
failed_at string or null Yes
id string The identifier of the run step, which can be referenced in API endpoints. Yes
last_error OpenAI.RunStepObjectLastError or null Yes
metadata OpenAI.Metadata or null Yes
object enum The object type, which is always thread.run.step.
Possible values: thread.run.step
Yes
run_id string The ID of the run that this run step is a part of. Yes
status enum The status of the run step, which can be either in_progress, cancelled, failed, completed, or expired.
Possible values: in_progress, cancelled, failed, completed, expired
Yes
step_details OpenAI.RunStepDetailsMessageCreationObject or OpenAI.RunStepDetailsToolCallsObject The details of the run step. Yes
thread_id string The ID of the thread that was run. Yes
type enum The type of run step, which can be either message_creation or tool_calls.
Possible values: message_creation, tool_calls
Yes
usage OpenAI.RunStepCompletionUsage Usage statistics related to the run step. This value will be null while the run step's status is in_progress. Yes

OpenAI.RunStepObjectLastError

Name Type Description Required Default
code enum
Possible values: server_error, rate_limit_exceeded
Yes
message string Yes

OpenAI.RunToolCallObject

Tool call objects

Name Type Description Required Default
function OpenAI.RunToolCallObjectFunction Yes
└─ arguments string Yes
└─ name string Yes
id string The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the Submit tool outputs to run endpoint. Yes
type enum The type of tool call the output is required for. For now, this is always function.
Possible values: function
Yes

OpenAI.RunToolCallObjectFunction

Name Type Description Required Default
arguments string Yes
name string Yes

OpenAI.SubmitToolOutputsRunRequest

Name Type Description Required Default
stream boolean or null No
tool_outputs array of OpenAI.SubmitToolOutputsRunRequestToolOutputs A list of tools for which the outputs are being submitted. Yes

OpenAI.SubmitToolOutputsRunRequestToolOutputs

Name Type Description Required Default
output string No
tool_call_id string No

OpenAI.TextAnnotation

Discriminator for OpenAI.TextAnnotation

This component uses the property type to discriminate between different types:

Type Value Schema
file_citation OpenAI.MessageContentTextAnnotationsFileCitationObject
file_path OpenAI.MessageContentTextAnnotationsFilePathObject
Name Type Description Required Default
type OpenAI.TextAnnotationType Yes

OpenAI.TextAnnotationType

Property Value
Type string
Values file_citation
file_path

OpenAI.ThreadObject

Thread

Represents a thread that contains messages.

Name Type Description Required Default
created_at integer (unixtime) The Unix timestamp (in seconds) for when the thread was created. Yes
id string The identifier, which can be referenced in API endpoints. Yes
metadata OpenAI.Metadata or null Yes
object enum The object type, which is always thread.
Possible values: thread
Yes
tool_resources OpenAI.ThreadObjectToolResources or null Yes

OpenAI.ThreadObjectToolResources

Name Type Description Required Default
code_interpreter OpenAI.ThreadObjectToolResourcesCodeInterpreter No
file_search OpenAI.ThreadObjectToolResourcesFileSearch No

OpenAI.ThreadObjectToolResourcesCodeInterpreter

Name Type Description Required Default
file_ids array of string Constraints: maxItems: 20 No

OpenAI.ThreadObjectToolResourcesFileSearch

Name Type Description Required Default
vector_store_ids array of string Constraints: maxItems: 1 No

OpenAI.TruncationObject

Thread Truncation Controls

Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.

Name Type Description Required Default
last_messages integer or null No
type enum The truncation strategy to use for the thread. The default is auto. If set to last_messages, the thread will be truncated to the n most recent messages in the thread. When set to auto, messages in the middle of the thread will be dropped to fit the context length of the model, max_prompt_tokens.
Possible values: auto, last_messages
Yes