Azure.AI.Agents (preview:2025-05-15)

2025/12/01 • 7 updated methods

Runs_ListRuns (updated)
Description Gets a list of runs for a specified thread.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_ListRuns",
  "$responses": {
    "200": {
      "$properties": {
        "data": {
          "$properties": [
            {
              "#name": "status",
              "Enum": {
                "new": [
                  [
                    "queued",
                    "Represents a run that is queued to start."
                  ],
                  [
                    "in_progress",
                    "Represents a run that is in progress."
                  ],
                  [
                    "requires_action",
                    "Represents a run that needs another operation, such as tool output submission, to continue."
                  ],
                  [
                    "cancelling",
                    "Represents a run that is in the process of cancellation."
                  ],
                  [
                    "cancelled",
                    "Represents a run that has been cancelled."
                  ],
                  [
                    "failed",
                    "Represents a run that failed."
                  ],
                  [
                    "completed",
                    "Represents a run that successfully completed."
                  ],
                  [
                    "expired",
                    "Represents a run that expired before it could otherwise finish."
                  ],
                  [
                    "incomplete",
                    "Represents a run that cannot be completed due to safety guardrails."
                  ]
                ],
                "old": [
                  [
                    "queued",
                    "Represents a run that is queued to start."
                  ],
                  [
                    "in_progress",
                    "Represents a run that is in progress."
                  ],
                  [
                    "requires_action",
                    "Represents a run that needs another operation, such as tool output submission, to continue."
                  ],
                  [
                    "cancelling",
                    "Represents a run that is in the process of cancellation."
                  ],
                  [
                    "cancelled",
                    "Represents a run that has been cancelled."
                  ],
                  [
                    "failed",
                    "Represents a run that failed."
                  ],
                  [
                    "completed",
                    "Represents a run that successfully completed."
                  ],
                  [
                    "expired",
                    "Represents a run that expired before it could otherwise finish."
                  ]
                ]
              }
            }
          ]
        }
      }
    }
  }
}

⚼ Request

GET:  /threads/{threadId}/runs
{
threadId: string ,
api-version: string ,
limit: integer ,
order: string ,
after: string ,
before: string ,
}

⚐ Response (200)

{
data:
[
{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}
,
]
,
last_id: string ,
has_more: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
Runs_CreateRun (updated)
Description Creates a new run for an agent thread.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_CreateRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /threads/{threadId}/runs
{
api-version: string ,
threadId: string ,
include[]: array ,
body:
{
assistant_id: string ,
model: string ,
instructions: string ,
additional_instructions: string ,
additional_messages:
[
{
role: enum ,
content: string ,
attachments:
[
{
file_id: string ,
data_source:
{
uri: string ,
type: enum ,
}
,
tools:
[
string ,
]
,
}
,
]
,
metadata: object ,
}
,
]
,
tools:
[
{
type: string ,
}
,
]
,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
stream: boolean ,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
parallel_tool_calls: boolean ,
metadata: object ,
}
,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
Runs_GetRun (updated)
Description Gets an existing run from an existing thread.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_GetRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

GET:  /threads/{threadId}/runs/{runId}
{
api-version: string ,
threadId: string ,
runId: string ,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
Runs_UpdateRun (updated)
Description Modifies an existing thread run.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_UpdateRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /threads/{threadId}/runs/{runId}
{
api-version: string ,
threadId: string ,
runId: string ,
body:
{
metadata: object ,
}
,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
Runs_CancelRun (updated)
Description Cancels a run of an in‐progress thread.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_CancelRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /threads/{threadId}/runs/{runId}/cancel
{
api-version: string ,
threadId: string ,
runId: string ,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
Runs_SubmitToolOutputsToRun (updated)
Description Submits outputs from tools as requested by tool calls in a run.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_SubmitToolOutputsToRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /threads/{threadId}/runs/{runId}/submit_tool_outputs
{
api-version: string ,
threadId: string ,
runId: string ,
body:
{
tool_outputs:
[
{
type: string ,
tool_call_id: string ,
}
,
]
,
tool_approvals:
[
{
tool_call_id: string ,
approve: boolean ,
headers: object ,
}
,
]
,
stream: boolean ,
}
,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}
CreateThreadAndRun (updated)
Description Creates a new agent thread and immediately starts a run using that new thread.
Reference Link ¶

⚶ Changes

{
  "#id": "CreateThreadAndRun",
  "$responses": {
    "200": {
      "$properties": [
        {
          "#name": "status",
          "Enum": {
            "new": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ],
              [
                "incomplete",
                "Represents a run that cannot be completed due to safety guardrails."
              ]
            ],
            "old": [
              [
                "queued",
                "Represents a run that is queued to start."
              ],
              [
                "in_progress",
                "Represents a run that is in progress."
              ],
              [
                "requires_action",
                "Represents a run that needs another operation, such as tool output submission, to continue."
              ],
              [
                "cancelling",
                "Represents a run that is in the process of cancellation."
              ],
              [
                "cancelled",
                "Represents a run that has been cancelled."
              ],
              [
                "failed",
                "Represents a run that failed."
              ],
              [
                "completed",
                "Represents a run that successfully completed."
              ],
              [
                "expired",
                "Represents a run that expired before it could otherwise finish."
              ]
            ]
          }
        }
      ]
    }
  }
}

⚼ Request

POST:  /threads/runs
{
api-version: string ,
body:
{
assistant_id: string ,
thread:
{
messages:
[
{
role: enum ,
content: string ,
attachments:
[
{
file_id: string ,
data_source:
{
uri: string ,
type: enum ,
}
,
tools:
[
string ,
]
,
}
,
]
,
metadata: object ,
}
,
]
,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
metadata: object ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
stream: boolean ,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
parallel_tool_calls: boolean ,
metadata: object ,
}
,
}

⚐ Response (200)

{
id: string ,
object: enum ,
thread_id: string ,
assistant_id: string ,
status: enum ,
required_action:
{
type: string ,
}
,
last_error:
{
code: string ,
message: string ,
}
,
model: string ,
instructions: string ,
tools:
[
{
type: string ,
}
,
]
,
created_at: integer ,
expires_at: integer ,
started_at: integer ,
completed_at: integer ,
cancelled_at: integer ,
failed_at: integer ,
incomplete_details:
{
reason: enum ,
}
,
usage:
{
completion_tokens: integer ,
prompt_tokens: integer ,
total_tokens: integer ,
}
,
temperature: number ,
top_p: number ,
max_prompt_tokens: integer ,
max_completion_tokens: integer ,
truncation_strategy:
{
type: enum ,
last_messages: integer ,
}
,
tool_choice: string ,
response_format: string ,
metadata: object ,
tool_resources:
{
code_interpreter:
{
file_ids:
[
string ,
]
,
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
file_search:
{
vector_store_ids:
[
string ,
]
,
vector_stores:
[
{
name: string ,
configuration:
{
data_sources:
[
{
uri: string ,
type: enum ,
}
,
]
,
}
,
}
,
]
,
}
,
azure_ai_search:
{
indexes:
[
{
index_connection_id: string ,
index_name: string ,
query_type: enum ,
top_k: integer ,
filter: string ,
index_asset_id: string ,
}
,
]
,
}
,
mcp:
[
{
server_label: string ,
headers: object ,
require_approval: string ,
}
,
]
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

{
error:
{
message: string ,
type: string ,
param: string ,
code: string ,
}
,
}