---
title: "POST /assistants"
method: POST
path: "/assistants"
---

# POST /assistants

`POST /assistants`

Creates a new agent.

## Query parameters

- `api-version` string, required

## Request body

- CreateAgentOptions — The request details to use when creating a new agent.
  - `model` string, required — The ID of the model to use.
  - `name` string, nullable — The name of the new agent.
  - `description` string, nullable — The description of the new agent.
  - `instructions` string, nullable — The system instructions for the new agent to use.
  - `tools` ToolDefinition[] — The collection of tools to enable for the new agent.
    - `type` string, required — The object type.
  - `tool_resources` ToolResources — A set of resources that are used by the agent'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.
    - `code_interpreter` CodeInterpreterToolResource — A set of resources that are used by the `code_interpreter` tool.
      - `file_ids` string[] — A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
      - `data_sources` VectorStoreDataSource[] — The data sources to be used. This option is mutually exclusive with the `fileIds` property.
        - `uri` string, required — Asset URI.
        - `type` 'uri_asset' | 'id_asset', required — Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, in the case of id_asset it should contain the data ID.
    - `file_search` FileSearchToolResource — A set of resources that are used by the `file_search` tool.
      - `vector_store_ids` string[] — The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.
      - `vector_stores` VectorStoreConfigurations[] — The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.
        - `name` string, required — Name
        - `configuration` VectorStoreConfiguration, required — Vector storage configuration is the list of data sources, used when multiple files can be used for the enterprise file search.
          - `data_sources` VectorStoreDataSource[], required — Data sources
            - `uri` string, required — Asset URI.
            - `type` 'uri_asset' | 'id_asset', required — Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, in the case of id_asset it should contain the data ID.
    - `azure_ai_search` AzureAISearchToolResource — A set of index resources used by the `azure_ai_search` tool.
      - `indexes` AISearchIndexResource[] — The indices attached to this agent. There can be a maximum of 1 index resource attached to the agent.
        - `index_connection_id` string — An index connection id in an IndexResource attached to this agent.
        - `index_name` string — The name of an index in an IndexResource attached to this agent.
        - `query_type` 'simple' | 'semantic' | 'vector' | 'vector_simple_hybrid' | 'vector_semantic_hybrid' — Available query types for Azure AI Search tool.
        - `top_k` integer — Number of documents to retrieve from search and present to the model.
        - `filter` string — filter string for search resource.
        - `index_asset_id` string — Index asset id for search resource.
  - `temperature` number, float, nullable — 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.
  - `top_p` number, float, nullable — 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.
  - `response_format` unknown
  - `metadata` object, nullable — A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

## Response `200`

The new agent instance.

- Agent — Represents an agent that can call the model and use tools.
  - `id` string, required — The identifier, which can be referenced in API endpoints.
  - `object` 'assistant', required — The object type, which is always assistant.
  - `created_at` integer, required — The Unix timestamp, in seconds, representing when this object was created.
  - `name` string, nullable, required — The name of the agent.
  - `description` string, nullable, required — The description of the agent.
  - `model` string, required — The ID of the model to use.
  - `instructions` string, nullable, required — The system instructions for the agent to use.
  - `tools` ToolDefinition[], required — The collection of tools enabled for the agent.
    - `type` string, required — The object type.
  - `tool_resources` ToolResources, required — A set of resources that are used by the agent'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.
    - `code_interpreter` CodeInterpreterToolResource — A set of resources that are used by the `code_interpreter` tool.
      - `file_ids` string[] — A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool.
      - `data_sources` VectorStoreDataSource[] — The data sources to be used. This option is mutually exclusive with the `fileIds` property.
        - `uri` string, required — Asset URI.
        - `type` 'uri_asset' | 'id_asset', required — Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, in the case of id_asset it should contain the data ID.
    - `file_search` FileSearchToolResource — A set of resources that are used by the `file_search` tool.
      - `vector_store_ids` string[] — The ID of the vector store attached to this agent. There can be a maximum of 1 vector store attached to the agent.
      - `vector_stores` VectorStoreConfigurations[] — The list of vector store configuration objects from Azure. This list is limited to one element. The only element of this list contains the list of azure asset IDs used by the search tool.
        - `name` string, required — Name
        - `configuration` VectorStoreConfiguration, required — Vector storage configuration is the list of data sources, used when multiple files can be used for the enterprise file search.
          - `data_sources` VectorStoreDataSource[], required — Data sources
            - `uri` string, required — Asset URI.
            - `type` 'uri_asset' | 'id_asset', required — Type of vector storage asset. Asset type may be a uri_asset, in this case it should contain asset URI ID, in the case of id_asset it should contain the data ID.
    - `azure_ai_search` AzureAISearchToolResource — A set of index resources used by the `azure_ai_search` tool.
      - `indexes` AISearchIndexResource[] — The indices attached to this agent. There can be a maximum of 1 index resource attached to the agent.
        - `index_connection_id` string — An index connection id in an IndexResource attached to this agent.
        - `index_name` string — The name of an index in an IndexResource attached to this agent.
        - `query_type` 'simple' | 'semantic' | 'vector' | 'vector_simple_hybrid' | 'vector_semantic_hybrid' — Available query types for Azure AI Search tool.
        - `top_k` integer — Number of documents to retrieve from search and present to the model.
        - `filter` string — filter string for search resource.
        - `index_asset_id` string — Index asset id for search resource.
  - `temperature` number, float, nullable, required — 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.
  - `top_p` number, float, nullable, required — 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.
  - `response_format` unknown
  - `metadata` object, nullable, required — A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/ai-azure-ai-agents.md) · [All operations](https://skmtc.net/azure/apis/ai-azure-ai-agents/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/ai-azure-ai-agents/revisions/de4a99f09829/schema)
