Azure.AI.Agents (stable:v1)

2025/07/21 • 1 updated methods

Runs_CreateRun (updated)
Description Creates a new run for an agent thread.
Reference Link ¶

⚶ Changes

{
  "#id": "Runs_CreateRun",
  "$parameters": {
    "body": {
      "$properties": {
        "@added_08b90df5dfae4106ac3b235b4d9d65d1": {
          "#name": "tool_resources",
          "Description": "The overridden enabled tool resources that the agent should use to run the thread.",
          "Required": false,
          "Type": "object",
          "$properties": [
            {
              "#name": "code_interpreter",
              "Description": "Resources to be used by the `code_interpreter` tool consisting of file IDs.",
              "Required": false,
              "Type": "object",
              "$properties": [
                {
                  "#name": "file_ids",
                  "Description": "A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files\nassociated with the tool.",
                  "Required": false,
                  "Type": "array",
                  "$items": {
                    "Type": "string"
                  }
                },
                {
                  "#name": "data_sources",
                  "Description": "The data sources to be used. This option is mutually exclusive with the `fileIds` property.",
                  "Required": false,
                  "Type": "array",
                  "$items": {
                    "Description": "The structure, containing Azure asset URI path and the asset type of the file used as a data source\nfor the enterprise file search.",
                    "Type": "object",
                    "$properties": [
                      {
                        "#name": "uri",
                        "Description": "Asset URI.",
                        "Required": true,
                        "Type": "string"
                      },
                      {
                        "#name": "type",
                        "Description": "The asset type",
                        "Enum": [
                          [
                            "uri_asset",
                            "Azure URI"
                          ],
                          [
                            "id_asset",
                            "The data ID"
                          ]
                        ],
                        "Required": true,
                        "Type": "string"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "#name": "file_search",
              "Description": "Resources to be used by the `file_search` tool consisting of vector store IDs.",
              "Required": false,
              "Type": "object",
              "$properties": [
                {
                  "#name": "vector_store_ids",
                  "Description": "The ID of the vector store attached to this agent. There can be a maximum of 1 vector\nstore attached to the agent.",
                  "Required": false,
                  "Type": "array",
                  "$items": {
                    "Type": "string"
                  }
                },
                {
                  "#name": "vector_stores",
                  "Description": "The list of vector store configuration objects from Azure.\nThis list is limited to one element.\nThe only element of this list contains the list of azure asset IDs used by the search tool.",
                  "Required": false,
                  "Type": "array",
                  "$items": {
                    "Description": "The structure, containing the list of vector storage configurations i.e. the list of azure asset IDs.",
                    "Type": "object",
                    "$properties": [
                      {
                        "#name": "name",
                        "Description": "Name",
                        "Required": true,
                        "Type": "string"
                      },
                      {
                        "#name": "configuration",
                        "Description": "Configurations",
                        "Required": true,
                        "Type": "object",
                        "$properties": [
                          {
                            "#name": "data_sources",
                            "Description": "Data sources",
                            "Required": true,
                            "Type": "array",
                            "$items": {
                              "Description": "The structure, containing Azure asset URI path and the asset type of the file used as a data source\nfor the enterprise file search.",
                              "Type": "object",
                              "$properties": [
                                {
                                  "#name": "uri",
                                  "Description": "Asset URI.",
                                  "Required": true,
                                  "Type": "string"
                                },
                                {
                                  "#name": "type",
                                  "Description": "The asset type",
                                  "Enum": [
                                    [
                                      "uri_asset",
                                      "Azure URI"
                                    ],
                                    [
                                      "id_asset",
                                      "The data ID"
                                    ]
                                  ],
                                  "Required": true,
                                  "Type": "string"
                                }
                              ]
                            }
                          }
                        ]
                      }
                    ]
                  }
                }
              ]
            },
            {
              "#name": "azure_ai_search",
              "Description": "Resources to be used by the `azure_ai_search` tool consisting of index IDs and names.",
              "Required": false,
              "Type": "object",
              "$properties": [
                {
                  "#name": "indexes",
                  "Description": "The indices attached to this agent. There can be a maximum of 1 index\nresource attached to the agent.",
                  "Required": false,
                  "Type": "array",
                  "$items": {
                    "Description": "A AI Search Index resource.",
                    "Type": "object",
                    "$properties": [
                      {
                        "#name": "index_connection_id",
                        "Description": "An index connection id in an IndexResource attached to this agent.",
                        "Required": false,
                        "Type": "string"
                      },
                      {
                        "#name": "index_name",
                        "Description": "The name of an index in an IndexResource attached to this agent.",
                        "Required": false,
                        "Type": "string"
                      },
                      {
                        "#name": "query_type",
                        "Description": "Type of query in an AIIndexResource attached to this agent.",
                        "Enum": [
                          [
                            "simple",
                            "Query type `simple`"
                          ],
                          [
                            "semantic",
                            "Query type `semantic`"
                          ],
                          [
                            "vector",
                            "Query type `vector`"
                          ],
                          [
                            "vector_simple_hybrid",
                            "Query type `vector_simple_hybrid`"
                          ],
                          [
                            "vector_semantic_hybrid",
                            "Query type `vector_semantic_hybrid`"
                          ]
                        ],
                        "Required": false,
                        "Type": "string"
                      },
                      {
                        "#name": "top_k",
                        "Description": "Number of documents to retrieve from search and present to the model.",
                        "Format": "int32",
                        "Required": false,
                        "Type": "integer"
                      },
                      {
                        "#name": "filter",
                        "Description": "filter string for search resource.",
                        "Required": false,
                        "Type": "string"
                      },
                      {
                        "#name": "index_asset_id",
                        "Description": "Index asset id for search resource.",
                        "Required": false,
                        "Type": "string"
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      }
    }
  }
}

⚼ 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 ,
}
,
]
,
}
,
}
,
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 ,
}
,
]
,
}
,
}
,
parallel_tool_calls: boolean ,
}

⚐ Response (default)

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