openapi: 3.0.0
info:
  title: DIAL Core API
  description: |-
    The API provides a unified interface to calling chat/completion and embedding models, as well as accessing and sharing files, conversations, and prompts.

    # Authorization
    All API requests must include the API key (or a [per-request key](https://docs.dialx.ai/platform/core/per-request-keys) when it is required) in the `Api-Key` HTTP header or the JWT token in the `Authorization` HTTP header.

    <hr style="margin:1em 0px;border-bottom:1px solid rgb(63, 63, 70);border-top-width:0px"\>

    #### Authorization with API Key (or with per-request key): ApiKeyAuth

    <br>

    ```bash
    Api-Key: DIAL_API_KEY
    ```
    <br>

    Header parameter name: `Api-Key`

    <hr style="margin:1em 0px;border-bottom:1px solid rgb(63, 63, 70);border-top-width:0px"\>

    #### HTTP Authorization: BearerAuth

    <br>

    ```bash
    Authorization: Bearer <JWT>
    ```

    <br>

    HTTP Authorization Scheme: `bearer`

    Bearer format: `JWT`

  version: "0.41"
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://chat.<company>.com
paths:
  /openai/deployments/{deployment_name}/chat/completions:
    post:
      operationId: sendChatCompletionRequest
      summary: /openai/deployments/{deployment_name}/chat/completions
      description: This API is based on the OpenAI Azure API and extended to support working with advanced DIAL agents and applications.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
        - in: query
          name: api-version
          schema:
            type: string
          required: true
          description: The API version to use for this request. Follows the `YYYY-MM-DD[-preview]` format.
          example: '2024-10-21'
        - name: X-CACHE-POLICY
          in: header
          schema:
            type: string
            enum: ["availability-priority", "cache-priority"]
            default: availability-priority
            description: >
              The header configures the policy of upstream selection for this particular chat completions request. This policy makes sense only for deployments supporting [prompt caching](https://docs.dialx.ai/tutorials/developers/prompt-caching), that is those with `features.cachedSupported` or `features.autoCachingSupported` features enabled in the [DIAL Core config](https://github.com/epam/ai-dial-core?tab=readme-ov-file#dynamic-settings).


              `availability-priority`: Policy prioritizes upstream availability over a potential cache hit. That is, if an upstream with a cache doesn't respond, then an alternative upstream will be tried.


              `cache-priority`: Policy prioritizes cache hits over availability. That is, if an upstream with a cache doesn't respond, then DIAL Core will persist with requests to this same upstream.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: The name of the model to use.
                messages:
                  type: array
                  minItems: 1
                  description: A list of messages comprising the conversation so far.
                  items:
                    $ref: "#/components/schemas/ChatCompletionRequestMessage"
                functions:
                  deprecated: true
                  description: |
                    Deprecated in favor of `tools`.

                    A list of functions the model may generate JSON inputs for.
                  type: array
                  minItems: 1
                  maxItems: 128
                  items:
                    $ref: "#/components/schemas/ChatCompletionFunction"
                function_call:
                  deprecated: true
                  description: |
                    Deprecated in favor of `tool_choice`.

                    Controls which (if any) `function` is called by the model.

                    `none` means the model will not call a `function` and instead generates a `message`.

                    `auto` means the model can pick between generating a `message` or calling a `function`.

                    Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.

                    `none` is the default when no functions are present. `auto` is the default if functions are present.
                  oneOf:
                    - type: string
                      description: >
                        `none` means the model will not call a function and instead generates a message.
                        `auto` means the model can pick between generating a message or calling a function.
                      enum: [none, auto]
                    - $ref: "#/components/schemas/ChatCompletionFunctionCallOption"
                tools:
                  type: array
                  description: >
                    A list of tools the model may call. Currently, only `functions` are supported as a tool.
                    Use this to provide a list of `functions` the model may generate JSON inputs for. A max of 128 functions are supported.
                  items:
                    $ref: "#/components/schemas/ChatCompletionTool"
                tool_choice:
                  $ref: "#/components/schemas/ChatCompletionToolChoiceOption"
                addons:
                  type: array
                  items:
                    $ref: "#/components/schemas/ChatCompletionAddon"
                  description: A list of Addons the Assistant can use.
                  deprecated: true
                stream:
                  description: >
                    If set, partial message deltas will be sent. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)
                    as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
                  type: boolean
                  nullable: true
                  default: false
                temperature:
                  type: number
                  description: What sampling temperature to use, between 0 and 2. Higher values such as 0.8 make the output more random, while lower values like 0.2 make it more focused and deterministic.
                  minimum: 0
                  maximum: 2
                  default: 1
                top_p:
                  type: number
                  description: An alternative to sampling with temperature, called nucleus sampling, where the Assistant considers the results of the tokens with `top_p` probability mass. A value of 0.1 implies that only the tokens representing the top 10% probability mass are taken into consideration.
                  minimum: 0
                  maximum: 1
                  default: 1
                n:
                  type: integer
                  minimum: 1
                  maximum: 128
                  default: 1
                  example: 1
                  nullable: true
                  description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
                parallel_tool_calls:
                  $ref: "#/components/schemas/ParallelToolCalls"
                stop:
                  oneOf:
                    - type: string
                      nullable: true
                    - type: array
                      minItems: 1
                      maxItems: 4
                      items:
                        type: string
                  description: Up to 4 sequences where the Assistant will stop generating further tokens.
                max_tokens:
                  type: integer
                  description: The maximum number of tokens to generate by the Assistant.
                  default: infinity
                max_prompt_tokens:
                  type: integer
                  description: |
                    The maximum number of prompt tokens to handle in a request. The feature is supported only by the model adapters and the Assistant. Given this parameter an adapter truncates the list of the messages to fit into this limit and passes the truncated list to the actual model.

                    The default strategy for truncation is to preserve all system messages and the last message. Whatever else could fit within the limit is added to the final list of messages, prioritizing the most recent messages in the chat over the earlier ones.

                    The list of indices of the messages that were discarded is returned in the `statistics.discarded_messages` field of the response.
                  default: infinity
                max_completion_tokens:
                  description: |
                    **Note** the parameter is only supported in OpenAI models.

                    An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

                  type: integer
                  nullable: true
                presence_penalty:
                  type: number
                  description: A number between `-2.0` and `2.0`. Positive values impose a penalty on new tokens based on their appearance in the current text, thereby increasing the model's tendency to introduce new topics in its responses.
                  minimum: -2
                  maximum: 2
                  default: 0
                frequency_penalty:
                  type: number
                  description: A number between `-2.0` and `2.0`. Positive values apply a penalty to new tokens according to their existing frequency in the preceding text, thereby reducing the model's propensity to repeat the exact same line.
                  minimum: -2
                  maximum: 2
                  default: 0
                logit_bias:
                  type: object
                  description: |-
                    Modifies the likelihood of specified tokens appearing in the completion.

                    Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from `-100` to `100`. Mathematically, the bias is added to the `logits` generated by the model prior to sampling. The exact effect will vary per model, but values between `-1` and `1` should decrease or increase the likelihood of a selection; values like `-100` or `100` should result in a ban or exclusive selection of the relevant token.
                  default: null
                seed:
                  type: integer
                  minimum: -9223372036854775808
                  maximum: 9223372036854775807
                  nullable: true
                  description: |
                    This feature is in **Beta**.

                    If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
                    Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
                user:
                  type: string
                  description: A unique identifier representing the end-user.
                response_format:
                  description: |
                    An object specifying the format that the model must output. Compatible with [GPT-4o](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models), [GPT-4o mini](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models), [GPT-4 Turbo](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-4-and-gpt-4-turbo-models) and all [GPT-3.5](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35) Turbo models newer than `gpt-3.5-turbo-1106`.

                    Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which guarantees the model will match your supplied JSON schema.

                    Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees 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.

                    **Note:** JSON mode is not supported by all models.
                  oneOf:
                    - $ref: "#/components/schemas/ResponseFormatText"
                    - $ref: "#/components/schemas/ResponseFormatJsonObject"
                    - $ref: "#/components/schemas/ResponseFormatJsonSchema"
                custom_fields:
                  $ref: '#/components/schemas/ChatCompletionsCustomFields'
              required:
                - messages
            examples:
              Chat Model:
                value:
                  messages:
                    - role: user
                      content: Hello!
              Chat Model Streaming:
                value:
                  stream: true
                  messages:
                    - role: user
                      content: Hello!
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateChatCompletionResponse"
              examples:
                Chat Model:
                  value:
                    id: chatcmpl-8mt8AF8xkczUdRv250bpmU6KqMfAb
                    choices:
                      - finish_reason: stop
                        index: 0
                        message:
                          role: assistant
                          content: ChatGPT is an advanced conversational AI model built on the GPT-3.5 architecture. It is a Large Language Model (LLM) that can engage in context-aware, human-like interactions. It is a suitable testbed for creativity and has demonstrated remarkable capabilities in understanding and generating human-like text. It heavily relies on in-context examples and has a strong bias toward using or not using certain tools.
                          refusal: null
                    created: 1706662358
                    model: gpt-4
                    object: chat.completion
                    usage:
                      completion_tokens: 9
                      prompt_tokens: 9
                      total_tokens: 18
            text/event-stream:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CreateChatCompletionStreamResponse"
              examples:
                Chat Model Streaming:
                  value:
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: ''
                          role: assistant
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: Hello
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: "!"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " How"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " can"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " I"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " assist"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " you"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: " today"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: "?"
                        finish_reason: null
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                    - id: chatcmpl-8nCUKwNc1iEHEUuOhsU48eODcNWCL
                      choices:
                      - delta:
                          content: ""
                        finish_reason: stop
                        index: 0
                      created: 1706736768
                      model: gpt-4
                      object: chat.completion.chunk
                      usage:
                        completion_tokens: 9
                        prompt_tokens: 9
                        total_tokens: 18
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '404':
          description: |
            Not found

            Returned either when:
            1. The deployment called `{deployment_name}` doesn't exist. Check the DIAL listing to verify that the deployment does actually exist.
            2. The `api-version` query parameter points to an API version that doesn't exist. This is relevant only for deployments based on Azure OpenAI models.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit reached.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '500':
          description: The server had an error while processing your request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '502':
          description: Failed to connect to upstream server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '503':
          description: The engine is currently overloaded, please try again later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/deployments/gpt-4/chat/completions?api-version=2023-12-01-preview \
              -H "Content-Type: application/json" \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "messages": [{"role": "user", "content": "Hello!"}]
              }'
        - lang: 'Python'
          label: 'Python (LangChain 0.1.4)'
          source: |
            from langchain_openai import AzureChatOpenAI
            from langchain.schema import HumanMessage

            model = AzureChatOpenAI(
                openai_api_version="2023-12-01-preview",
                azure_deployment="gpt-4",
                azure_endpoint="https://chat.<company>.com",
                api_key="DIAL_API_KEY"
            )

            response = model.invoke(
                [
                    HumanMessage(
                        content="Hello!"
                    )
                ]
            )
        - lang: 'Python'
          label: 'Python (OpenAI Library 1.10)'
          source: |
            from openai import AzureOpenAI

            client = AzureOpenAI(
                api_version="2023-12-01-preview",
                azure_endpoint="https://chat.<company>.com",
                api_key="DIAL_API_KEY"
            )

            response = client.chat.completions.create(
                model="gpt-4",
                messages=[
                    {
                        "role": "user",
                        "content": "Hello!",
                    }
                ]
            )

  /v1/deployments/{deployment_name}/configuration:
    get:
      operationId: configurationDeployment
      summary: /v1/deployments/{deployment_name}/configuration
      description: |
        The endpoint provides JSON schema of the configuration supported by the chat completion deployment.

        If the deployment supports configuration, it's expected to be passed via `custom_fields.configuration` field in the chat completion request.
        <br><br>
        A deployment supports configuration if its listing, retrieved by `GET /openai/deployments/{deployment_name}`, has a field `features.configuration` set to `true`.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                description: JSON schema of the configuration parameters the given deployment.
                type: object
              examples:
                Example:
                  value:
                    $ref: ./examples/configuration_schema.json
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/deployments/gpt-4/configuration \
              -H "Api-Key: DIAL_API_KEY"

  /openai/deployments/{deployment_name}/embeddings:
    post:
      operationId: sendEmbeddingsRequest
      summary: /openai/deployments/{deployment_name}/embeddings
      description: |
        Call this endpoint to get a vector representation of a given input.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
        - in: query
          name: api-version
          schema:
            type: string
          required: true
          description: The API version to use for this request. Follows the `YYYY-MM-DD[-preview]` format.
          example: '2023-12-01-preview'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              Single string input:
                value:
                  input: Your text string goes here
              Many string inputs:
                value:
                  input:
                    - Input 1
                    - Input 2
              Image input (DIAL URL):
                value:
                  input: []
                  custom_input:
                    - type: "image/png"
                      url: "files/USER_BUCKET/dir1/dir2/image.png"
              Image input (base64):
                value:
                  input: []
                  custom_input:
                    - type: "image/png"
                      data: "iVBORw0KGgoAAA..."
              Image input (annotated):
                value:
                  input: []
                  custom_input:
                    - - Image title
                      - type: "image/png"
                        url: "files/USER_BUCKET/dir1/dir2/image.png"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
              examples:
                Single text output:
                  $ref: ./examples/embeddings_single_text.yaml

        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '404':
          description: |
            Not found

            Returned either when:
            1. The deployment called `{deployment_name}` doesn't exist. Check the DIAL listing to verify that the deployment does actually exist.
            2. The `api-version` query parameter points to an API version that doesn't exist. This is relevant only for deployments based on Azure OpenAI models.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit reached
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '500':
          description: The server had an error while processing your request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '503':
          description: The engine is currently overloaded, please try again later.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/deployments/text-embedding-ada-002/embeddings?api-version=2023-12-01-preview \
              -H "Content-Type: application/json" \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "input": "Your text string goes here"
              }'
        - lang: 'Python'
          label: 'Python (LangChain 0.1.4)'
          source: |
            from langchain_openai import AzureOpenAIEmbeddings
            from langchain.schema import HumanMessage

            model = AzureOpenAIEmbeddings(
                openai_api_version="2023-12-01-preview",
                azure_deployment="text-embedding-ada-002",
                azure_endpoint="https://chat.<company>.com",
                api_key="DIAL_API_KEY",
                # Set the flag to False for models which do not support token ids in inputs
                check_embedding_ctx_length=False,
                model_kwargs={},
            )

            response = model.embed_query("Your text string goes here")
        - lang: 'Python'
          label: 'Python (OpenAI Library 1.10)'
          source: |
            from openai import AzureOpenAI

            client = AzureOpenAI(
                api_version="2023-12-01-preview",
                azure_endpoint="https://chat.<company>.com",
                api_key="DIAL_API_KEY"
            )

            response = client.embeddings.create(
                input="Your text string goes here",
                model="text-embedding-ada-002"
            )


  /v1/{deployment_name}/rate:
    post:
      operationId: rateDeployment
      summary: /v1/{deployment_name}/rate
      description: |
        Call this endpoint to rate the response received from the chat completions endpoint.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rate:
                  type: boolean
                  description: True if you like the message and false otherwise
                responseId:
                  type: string
                  description: Id received in the target chat completion response
            examples:
              Example:
                value:
                  rate: true
                  responseId: "chatcmpl-8mixpbdJ9S5Y3w8hRBVpPmFgNk0Li"
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/gpt-4/rate \
              -H "Content-Type: application/json" \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "rate": true,
                "responseId": "chatcmpl-8mixpbdJ9S5Y3w8hRBVpPmFgNk0Li"
              }'

  /v1/user/info:
    get:
      operationId: getUserInfo
      summary: /v1/user/info
      description: |
        Call this endpoint to retrieve information about a user. To access the endpoint, a user must be authenticated with API key or access token.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/userinfo'
              examples:
                API Key:
                  value:
                    project: "PROJECT-NAME"
                    roles:
                      - default
                Access Token:
                  value:
                    roles:
                      - BA
                    userClaims:
                        email:
                        - user_email
                        sub:
                        - user_sub
        '400':
          description: Invalid Authentication
        '401':
          description: Unauthorized
      x-codeSamples:
        - lang: 'cURL'
          label: 'API Key'
          source: |
            curl -X GET https://chat.<company>.com/v1/user/info \
              -H "Api-Key: DIAL_API_KEY"
        - lang: 'cURL'
          label: 'Access Token'
          source: |
            curl -X GET https://chat.<company>.com/v1/user/info \
              -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

  /v1/toolset/{toolset_name}/mcp:
    post:
      operationId: callToolSet
      tags:
        - Toolsets
      summary: /v1/toolset/{toolset_name}/mcp
      description: |
        This endpoint implements MCP-based communication using [HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http).
      parameters:
        - name: toolset_name
          in: path
          schema:
            type: string
          description: The name of the toolset.
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
              description: |
                A JSON object satisfying [mcp specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.json).
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                  type: object
                  description: A JSON object satisfying [mcp specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.json).
        '400':
          description: Invalid Authentication
        '401':
          description: Unauthorized

  /v1/deployments/{deployment_id}/mcp:
    post:
      operationId: callMcp
      tags:
        - Applications
      summary: /v1/deployments/{deployment_id}/mcp
      description: |
        This endpoint implements MCP-based communication with application deployment using [HTTP transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http).
      parameters:
        - name: deployment_id
          in: path
          schema:
            type: string
          description: The ID of the deployment.
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
              description: |
                A JSON object satisfying [mcp specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.json).
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                  type: object
                  description: A JSON object satisfying [mcp specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.json).
        '400':
          description: Invalid Authentication
        '401':
          description: Unauthorized

  /v1/ops/application/deploy:
    post:
      operationId: deployApplication
      tags:
        - Applications
      summary: /v1/ops/application/deploy
      description: Call this endpoint to deploy an application.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The application URL.
            examples:
              ExampleUser:
                value:
                  url: "applications/3CcedGxCx23EwiVbV/"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationOpenAi'
              examples:
                Application:
                  value:
                    name: application_name
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name
                    nodeType: ITEM
                    resourceType: APPLICATION
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    permissions:
                      - READ
                      - WRITE
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/application/undeploy:
    post:
      operationId: undeployApplication
      tags:
        - Applications
      summary: /v1/ops/application/undeploy
      description: Call this endpoint to undeploy an application. After undeploying, the application will no longer be accessible until it is [deployed](#tag/Applications/operation/deployApplication) again. Use [redeploy](#tag/Applications/operation/redeployApplication) to apply changes without downtime.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The application URL.
            examples:
              ExampleUser:
                value:
                  url: "applications/3CcedGxCx23EwiVbV/"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationOpenAi'
              examples:
                Application:
                  value:
                    name: application_name
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name
                    nodeType: ITEM
                    resourceType: APPLICATION
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    permissions:
                      - READ
                      - WRITE
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/application/redeploy:
    post:
      operationId: redeployApplication
      tags:
        - Applications
      summary: /v1/ops/application/redeploy
      description: Call this endpoint to redeploy an application. This is useful when you want to apply changes made to the application without downtime, contrary to the [undeploy](#tag/Applications/operation/undeployApplication) and deploy process.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The application URL.
            examples:
              ExampleUser:
                value:
                  url: "applications/3CcedGxCx23EwiVbV/"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationOpenAi'
              examples:
                Application:
                  value:
                    name: application_name
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name
                    nodeType: ITEM
                    resourceType: APPLICATION
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    permissions:
                      - READ
                      - WRITE
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/application/logs:
    post:
      operationId: getApplicationLogs
      tags:
        - Applications
      summary: /v1/ops/application/logs
      description: Call this endpoint to get application logs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The application URL.
            examples:
              ExampleUser:
                value:
                  url: "applications/3CcedGxCx23EwiVbV/"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationLogs'
              examples:
                ApplicationLogs:
                  value:
                    logs:
                      - instance: instance-name
                        content: |-
                          application instance logs will be printed here
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request

  /v1/application_type_schemas/schemas:
    get:
      operationId: listCustomApplicationSchemas
      tags:
        - Applications
      summary: /v1/application_type_schemas/schemas
      description: Call this endpoint to get a list of available application types schemas. Refer to [/v1/application_type_schemas/schema](/dial_api#tag/Applications/operation/getCustomApplicationSchema) to see a real example of Quick app schema.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    $id:
                      type: string
                      description: Unique identifier for the application schema.
                    dial:applicationTypeDisplayName:
                      type: string
                      description: Name of the application type displayed on the UI.
                    dial:applicationTypeViewerUrl:
                      type: string
                      description: URL for the UI of the application type.
                    dial:applicationTypeEditorUrl:
                      type: string
                      description: URL for the application builder used by the app type.
                    dial:applicationTypeSchemaEndpoint:
                      type: string
                      description: URL to retrieve JSON schema of the application.
              examples:
                Schema:
                  value:
                    - $id: https://mydial.com/custom_application_schemas/mindmaps
                      dial:applicationTypeDisplayName: Mindmap
                      dial:applicationTypeViewerUrl: https://mydial.com/mindmap
                      dial:applicationTypeEditorUrl: https://mydial.com/editor
                      dial:applicationTypeSchemaEndpoint: https://mydial.com/schema
                    - $id: https://mydial.com/custom_application_schemas/quickapps
                      dial:applicationTypeDisplayName: Quick app
                    - $id: https://mydial.com/custom_application_schemas/dial-rag-app-runner
                      dial:applicationTypeDisplayName: DIAL RAG
                      dial:applicationTypeEditorUrl: https://mydial.com/editor

        '401':
          description: Invalid Authentication
        '500':
          description: The server had an error while processing your request
  /v1/application_type_schemas/meta_schema:
    get:
      operationId: getMetaSchemaOfCustomApplicationSchema
      tags:
        - Applications
      summary: /v1/application_type_schemas/meta_schema
      description: Call this endpoint to get metaschema of custom application schema.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                  type: object
                  description: Json object with metaschema you can use to create other schemas.
              examples:
                Example:
                  value:
                    {
                      "$schema": "http://json-schema.org/draft-07/schema#",
                      "$id": "https://dial.epam.com/application_type_schemas/schema#",
                      "title": "Core meta-schema defining Ai DIAL custom application schemas",
                      "allOf": [
                        {
                    "$ref": "#/definitions/topLevelSchema"
                        },
                        {
                    "$ref": "#/definitions/dialRootSchema"
                        }
                      ],
                      "definitions": {
                        "dialRootSchema": {
                    "properties": {
                      "dial:applicationTypeEditorUrl": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the editor UI of the custom application of given type"
                      },
                      "dial:applicationTypeViewerUrl": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the view UI of the custom application of given type"
                      },
                      "dial:applicationTypeSchemaEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to retrieve JSON schema of the custom application of given type."
                      },
                      "dial:applicationTypeCompletionEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the completion endpoint of the custom application of given type"
                      },
                      "dial:applicationTypeConfigurationEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the configuration endpoint of the custom application of given type"
                      },
                      "dial:applicationTypeRateEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the rate endpoint of the custom application of given type"
                      },
                      "dial:applicationTypeTokenizeEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the tokenize endpoint of the custom application of given type"
                      },
                      "dial:applicationTypeTruncatePromptEndpoint": {
                        "type": "string",
                        "format": "uri",
                        "description": "URL to the truncate prompt of the custom application of given type"
                      },
                      "dial:applicationTypeDisplayName": {
                        "type": "string",
                        "description": "Display name of the custom application of given type"
                      },
                      "dial:appendApplicationPropertiesHeader": {
                        "type": "boolean",
                        "description": "If this flag is set to true, the header with properties will augment the request while proxying"
                      }
                    },
                    "required": [
                      "dial:applicationTypeCompletionEndpoint",
                      "dial:applicationTypeDisplayName"
                    ]
                        },
                        "dialFileFormatAndTypeSchema": {
                    "$comment": "Sub-schema defining the type format and dial:file properties",
                    "properties": {
                      "format": {
                        "type": "string"
                      },
                      "type": {
                        "anyOf": [
                          {
                      "$ref": "#/definitions/simpleTypes"
                          },
                          {
                      "type": "array",
                      "items": {
                        "$ref": "#/definitions/simpleTypes"
                      },
                      "minItems": 1,
                      "uniqueItems": true
                          }
                        ]
                      },
                      "dial:file": {
                        "description": "Required to check file existence in DIAL instance",
                        "type": "boolean",
                        "default": false
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "properties": {
                      "dial:file": {
                        "const": true
                      }
                          },
                          "required": [
                      "dial:file"
                          ]
                        },
                        "then": {
                          "required": [
                      "format",
                      "type"
                          ],
                          "properties": {
                      "format": {
                        "const": "dial-file-encoded"
                      },
                      "type": {
                        "const": "string"
                      }
                          }
                        }
                      }
                    ]
                        },
                        "topLevelSchema": {
                    "allOf": [
                      {
                        "$ref": "#/definitions/dialFileFormatAndTypeSchema"
                      },
                      {
                        "type": [
                          "object",
                          "boolean"
                        ],
                        "properties": {
                          "$id": {
                      "type": "string",
                      "format": "uri-reference"
                          },
                          "$schema": {
                      "type": "string",
                      "format": "uri"
                          },
                          "$ref": {
                      "type": "string",
                      "format": "uri-reference"
                          },
                          "$comment": {
                      "type": "string"
                          },
                          "title": {
                      "type": "string"
                          },
                          "description": {
                      "type": "string"
                          },
                          "default": true,
                          "readOnly": {
                      "type": "boolean",
                      "default": false
                          },
                          "writeOnly": {
                      "type": "boolean",
                      "default": false
                          },
                          "examples": {
                      "type": "array",
                      "items": true
                          },
                          "multipleOf": {
                      "type": "number",
                      "exclusiveMinimum": 0
                          },
                          "maximum": {
                      "type": "number"
                          },
                          "exclusiveMaximum": {
                      "type": "number"
                          },
                          "minimum": {
                      "type": "number"
                          },
                          "exclusiveMinimum": {
                      "type": "number"
                          },
                          "maxLength": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minLength": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "pattern": {
                      "type": "string",
                      "format": "regex"
                          },
                          "additionalItems": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "items": {
                      "anyOf": [
                        {
                          "$ref": "#/definitions/notTopLevelSchema"
                        },
                        {
                          "$ref": "#/definitions/notTopLevelSchemaArray"
                        }
                      ],
                      "default": true
                          },
                          "maxItems": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minItems": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "uniqueItems": {
                      "type": "boolean",
                      "default": false
                          },
                          "contains": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "maxProperties": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minProperties": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "required": {
                      "$ref": "#/definitions/stringArray"
                          },
                          "additionalProperties": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "definitions": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/notTopLevelSchema"
                      },
                      "default": {}
                          },
                          "properties": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/topLevelPropertySchema"
                      },
                      "default": {}
                          },
                          "patternProperties": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/topLevelPropertySchema"
                      },
                      "propertyNames": {
                        "format": "regex"
                      },
                      "default": {}
                          },
                          "dependencies": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "$ref": "#/definitions/notTopLevelSchema"
                          },
                          {
                            "$ref": "#/definitions/stringArray"
                          }
                        ]
                      }
                          },
                          "propertyNames": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "const": true,
                          "enum": {
                      "type": "array",
                      "items": true,
                      "minItems": 1,
                      "uniqueItems": true
                          },
                          "contentMediaType": {
                      "type": "string"
                          },
                          "contentEncoding": {
                      "type": "string"
                          },
                          "if": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "then": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "else": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "allOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "anyOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "oneOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "not": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          }
                        },
                        "default": true
                      }
                    ]
                        },
                        "notTopLevelSchema": {
                    "allOf": [
                      {
                        "$ref": "#/definitions/dialFileFormatAndTypeSchema"
                      },
                      {
                        "type": [
                          "object",
                          "boolean"
                        ],
                        "properties": {
                          "$id": {
                      "type": "string",
                      "format": "uri-reference"
                          },
                          "$schema": {
                      "type": "string",
                      "format": "uri"
                          },
                          "$ref": {
                      "type": "string",
                      "format": "uri-reference"
                          },
                          "$comment": {
                      "type": "string"
                          },
                          "title": {
                      "type": "string"
                          },
                          "description": {
                      "type": "string"
                          },
                          "default": true,
                          "readOnly": {
                      "type": "boolean",
                      "default": false
                          },
                          "writeOnly": {
                      "type": "boolean",
                      "default": false
                          },
                          "examples": {
                      "type": "array",
                      "items": true
                          },
                          "multipleOf": {
                      "type": "number",
                      "exclusiveMinimum": 0
                          },
                          "maximum": {
                      "type": "number"
                          },
                          "exclusiveMaximum": {
                      "type": "number"
                          },
                          "minimum": {
                      "type": "number"
                          },
                          "exclusiveMinimum": {
                      "type": "number"
                          },
                          "maxLength": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minLength": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "pattern": {
                      "type": "string",
                      "format": "regex"
                          },
                          "additionalItems": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "items": {
                      "anyOf": [
                        {
                          "$ref": "#/definitions/notTopLevelSchema"
                        },
                        {
                          "$ref": "#/definitions/notTopLevelSchemaArray"
                        }
                      ],
                      "default": true
                          },
                          "maxItems": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minItems": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "uniqueItems": {
                      "type": "boolean",
                      "default": false
                          },
                          "contains": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "maxProperties": {
                      "$ref": "#/definitions/nonNegativeInteger"
                          },
                          "minProperties": {
                      "$ref": "#/definitions/nonNegativeIntegerDefault0"
                          },
                          "required": {
                      "$ref": "#/definitions/stringArray"
                          },
                          "additionalProperties": {
                      "$ref": "#/definitions/notTopLevelPropertySchema"
                          },
                          "definitions": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/notTopLevelSchema"
                      },
                      "default": {}
                          },
                          "properties": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/notTopLevelPropertySchema"
                      },
                      "default": {}
                          },
                          "patternProperties": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/definitions/notTopLevelPropertySchema"
                      },
                      "propertyNames": {
                        "format": "regex"
                      },
                      "default": {}
                          },
                          "dependencies": {
                      "type": "object",
                      "additionalProperties": {
                        "anyOf": [
                          {
                            "$ref": "#/definitions/notTopLevelSchema"
                          },
                          {
                            "$ref": "#/definitions/stringArray"
                          }
                        ]
                      }
                          },
                          "propertyNames": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "const": true,
                          "enum": {
                      "type": "array",
                      "items": true,
                      "minItems": 1,
                      "uniqueItems": true
                          },
                          "contentMediaType": {
                      "type": "string"
                          },
                          "contentEncoding": {
                      "type": "string"
                          },
                          "if": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "then": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "else": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          },
                          "allOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "anyOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "oneOf": {
                      "$ref": "#/definitions/notTopLevelSchemaArray"
                          },
                          "not": {
                      "$ref": "#/definitions/notTopLevelSchema"
                          }
                        },
                        "default": true
                      }
                    ]
                        },
                        "topLevelPropertySchema": {
                    "allOf": [
                      {
                        "$ref": "#/definitions/notTopLevelSchema"
                      },
                      {
                        "$ref": "#/definitions/dialPropertyMetaSchema"
                      }
                    ]
                        },
                        "notTopLevelPropertySchema": {
                    "allOf": [
                      {
                        "$ref": "#/definitions/notTopLevelSchema"
                      },
                      {
                        "propertyNames": {
                          "not": {
                      "enum": [
                        "dial:meta"
                      ]
                          }
                        }
                      }
                    ]
                        },
                        "dialPropertyKind": {
                    "$comment": "Enum defining the property to be available to the clients or to be server-side only",
                    "enum": [
                      "server",
                      "client"
                    ]
                        },
                        "dialPropertyMetaSchema": {
                    "$comment": "Sub-schema defining the meta-property with information AI Dial purposes",
                    "type": "object",
                    "properties": {
                      "dial:meta": {
                        "type": [
                          "object"
                        ],
                        "properties": {
                          "dial:propertyOrder": {
                      "type": "number",
                      "description": "Order in which the property should be displayed in the default editor UI"
                          },
                          "dial:propertyKind": {
                      "description": "Is property available for the clients or server-side only",
                      "$ref": "#/definitions/dialPropertyKind"
                          }
                        },
                        "required": [
                          "dial:propertyOrder",
                          "dial:propertyKind"
                        ]
                      }
                    },
                    "required": [
                      "dial:meta"
                    ]
                        },
                        "topLevelSchemaArray": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/definitions/topLevelSchema"
                    }
                        },
                        "notTopLevelSchemaArray": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/definitions/notTopLevelSchema"
                    }
                        },
                        "nonNegativeInteger": {
                    "type": "integer",
                    "minimum": 0
                        },
                        "nonNegativeIntegerDefault0": {
                    "allOf": [
                      {
                        "$ref": "#/definitions/nonNegativeInteger"
                      },
                      {
                        "default": 0
                      }
                    ]
                        },
                        "simpleTypes": {
                    "enum": [
                      "array",
                      "boolean",
                      "integer",
                      "null",
                      "number",
                      "object",
                      "string"
                    ]
                        },
                        "stringArray": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "uniqueItems": true,
                    "default": []
                        }
                      }
                    }
        '401':
          description: Invalid Authentication
        '500':
          description: The server had an error while processing your request
  /v1/application_type_schemas/schema:
    get:
      operationId: getCustomApplicationSchema
      tags:
        - Applications
      summary: /v1/application_type_schemas/schema
      description: Call this endpoint to get the application type schema by its id
      parameters:
        - in: query
          name: id
          required: true
          schema:
            type: string
          description: schema ID of custom application
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: Json object with schema of the requested application type. Refer to [/v1/application_type_schemas/schemas](/dial_api#tag/Applications/operation/listCustomApplicationSchemas) to view descriptions of several standard parameters.
              examples:
                Example:
                  value:
                    {
                      "$schema": "https://dial.epam.com/application_type_schemas/schema#",
                      "$id": "https://mydial.epam.com/custom_application_schemas/quickapps",
                      "dial:applicationTypeDisplayName": "Quick app",
                      "dial:applicationTypeSchemaEndpoint": "https://mydial.com/schema",
                      "$defs": {
                        "ToolEndpointInfo": {
                          "properties": {
                            "name": {
                              "title": "Name",
                              "type": "string"
                            },
                            "method_url": {
                              "title": "Method Url",
                              "type": "string"
                            },
                            "method_type": {
                              "$ref": "#/$defs/ToolEndpointInfoMethodType"
                            },
                            "description": {
                              "title": "Description",
                              "type": "string"
                            },
                            "parameters": {
                              "items": {
                                "$ref": "#/$defs/ToolEndpointParameterInfo"
                              },
                              "title": "Parameters",
                              "type": "array"
                            }
                          },
                          "required": [
                            "name",
                            "method_url",
                            "method_type",
                            "description",
                            "parameters"
                          ],
                          "title": "ToolEndpointInfo",
                          "type": "object"
                        },
                        "ToolEndpointInfoMethodType": {
                          "enum": [
                            "get",
                            "post",
                            "put",
                            "delete"
                          ],
                          "title": "ToolEndpointInfoMethodType",
                          "type": "string"
                        },
                        "ToolEndpointParameterInfo": {
                          "properties": {
                            "name": {
                              "title": "Name",
                              "type": "string"
                            },
                            "description": {
                              "title": "Description",
                              "type": "string"
                            },
                            "url_param": {
                              "default": false,
                              "title": "Url Param",
                              "type": "boolean"
                            },
                            "constant_value": {
                              "default": null,
                              "title": "Constant Value"
                            },
                            "parameter_type": {
                              "$ref": "#/$defs/ToolEndpointParameterTypeInfo"
                            },
                            "item_parameter_type": {
                              "anyOf": [
                                {
                                  "$ref": "#/$defs/ToolEndpointParameterTypeInfo"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null
                            },
                            "item_descriptor": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "default": null,
                              "title": "Item Descriptor"
                            }
                          },
                          "required": [
                            "name",
                            "description",
                            "parameter_type"
                          ],
                          "title": "ToolEndpointParameterInfo",
                          "type": "object"
                        },
                        "ToolEndpointParameterTypeInfo": {
                          "enum": [
                            "string",
                            "number",
                            "integer",
                            "object",
                            "array",
                            "boolean"
                          ],
                          "title": "ToolEndpointParameterTypeInfo",
                          "type": "string"
                        },
                        "WebApiToolsetInfo": {
                          "properties": {
                            "tool_endpoints": {
                              "items": {
                                "$ref": "#/$defs/ToolEndpointInfo"
                              },
                              "title": "Tool Endpoints",
                              "type": "array"
                            },
                            "auth_info": {
                              "anyOf": [
                                {
                                  "discriminator": {
                                    "mapping": {
                                      "apikey": "#/$defs/WebApiToolsetKeyAuthInfo",
                                      "obo": "#/$defs/WebApiToolsetOBOAuthInfo"
                                    },
                                    "propertyName": "auth_type"
                                  },
                                  "oneOf": [
                                    {
                                      "$ref": "#/$defs/WebApiToolsetOBOAuthInfo"
                                    },
                                    {
                                      "$ref": "#/$defs/WebApiToolsetKeyAuthInfo"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "title": "Auth Info"
                            }
                          },
                          "required": [
                            "tool_endpoints",
                            "auth_info"
                          ],
                          "title": "WebApiToolsetInfo",
                          "type": "object"
                        },
                        "WebApiToolsetKeyAuthInfo": {
                          "properties": {
                            "auth_type": {
                              "const": "apikey",
                              "enum": [
                                "apikey"
                              ],
                              "title": "Auth Type",
                              "type": "string"
                            },
                            "api_key": {
                              "format": "password",
                              "title": "Api Key",
                              "type": "string",
                              "writeOnly": true
                            },
                            "url_param": {
                              "default": false,
                              "title": "Url Param",
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "auth_type",
                            "api_key"
                          ],
                          "title": "WebApiToolsetKeyAuthInfo",
                          "type": "object"
                        },
                        "WebApiToolsetOBOAuthInfo": {
                          "properties": {
                            "auth_type": {
                              "const": "obo",
                              "enum": [
                                "obo"
                              ],
                              "title": "Auth Type",
                              "type": "string"
                            },
                            "tenant": {
                              "title": "Tenant",
                              "type": "string"
                            },
                            "grant_type": {
                              "title": "Grant Type",
                              "type": "string"
                            },
                            "client_id": {
                              "title": "Client Id",
                              "type": "string"
                            },
                            "client_secret": {
                              "format": "password",
                              "title": "Client Secret",
                              "type": "string",
                              "writeOnly": true
                            },
                            "scope": {
                              "title": "Scope",
                              "type": "string"
                            },
                            "assertion": {
                              "title": "Assertion",
                              "type": "string"
                            }
                          },
                          "required": [
                            "auth_type",
                            "tenant",
                            "grant_type",
                            "client_id",
                            "client_secret",
                            "scope",
                            "assertion"
                          ],
                          "title": "WebApiToolsetOBOAuthInfo",
                          "type": "object"
                        }
                      },
                      "properties": {
                        "temperature": {
                          "title": "Temperature",
                          "type": "number",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 1
                          }
                        },
                        "instructions": {
                          "title": "Instructions",
                          "type": "string",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 2
                          }
                        },
                        "model": {
                          "title": "Model",
                          "type": "string",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 3
                          }
                        },
                        "web_api_toolset": {
                          "items": {
                            "$ref": "#/$defs/WebApiToolsetInfo"
                          },
                          "title": "Web Api Toolset",
                          "type": "array",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 4
                          }
                        },
                        "document_relative_url": {
                          "type": "string",
                          "format": "dial-file-encoded",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 5
                          },
                          "dial:file": true
                        },
                        "starters": {
                          "items": {
                            "type": "string"
                          },
                          "title": "Starter buttons",
                          "type": "array",
                          "dial:meta": {
                            "dial:propertyKind": "server",
                            "dial:propertyOrder": 6
                          }
                        }
                      },
                      "required": [
                        "temperature",
                        "instructions",
                        "model",
                        "web_api_toolset"
                      ]
                    }

        '401':
          description: Invalid Authentication
        '400':
          description: Bad request
        '500':
          description: The server had an error while processing your request
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/application_type_schemas/schema?id=https://mydial.epam.com/custom_application_schemas/quickapps \
              -H "Api-Key: DIAL_API_KEY"

  /v1/applications/{Bucket}/{application_path}:
    put:
      operationId: saveCustomApplication
      tags:
        - Applications
      summary: /v1/applications/{Bucket}/{application_path}
      description: |
        Call this endpoint to add an application to the specified bucket and path. **Note**, that requests differ for apps with and without schemas. See the details in the REQUEST BODY SCHEMA section. Refer to [Documentation](https://docs.dialx.ai/platform/core/apps) to learn more about applications in DIAL.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: application_path
          in: path
          schema:
            type: string
          description: |
            Target application path. The parameter specifies a full path to the application, for example: `folder1/folder2/application_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the application. This is used for conditional requests to ensure that the application is only uploaded if it matches the specified ETag.
            If the application does not exist, this header is ignored.
            If this header is not provided or the value is "*", any existing application at the specified path will be overwritten.
        - name: If-None-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) used to ensure that the application is only uploaded if it does not already exist.
            The only supported value is "*".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
              description: |
                An arbitrary string in JSON format representing the structure of the application.

                **Important**: Applications may or may not include an `application_type_schema_id`, which affects their creation and modification mechanics. If `application_type_schema_id` is absent or `NULL`, `application_properties` are not required. If you provide `application_type_schema_id` but `application_properties` are `NULL`, the application is a "stub" and can be updated later, but completion requests will not be possible. When you supply `application_properties`, they must be a valid JSON object that conforms to the schema specified by `application_type_schema_id`. An invalid JSON object will result in a bad request status.

                If you do not provide `application_type_schema_id`, refer to [DIAL Core](https://github.com/epam/ai-dial-core/blob/development/docs/dynamic-settings/applications.md) documentation to learn about available properties of applications you can pass in the JSON object describing the structure of the application.

                **Note**: When `applicationTypeSchemaId` and `applicationProperties` are specified, parameters defined in the corresponding JSON schema will take precedence and will override the corresponding parameters specified in the `application` object.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  createdAt:
                    type: integer
                  updatedAt:
                    type: integer
              examples:
                Example:
                  value:
                    "name": "application_name"
                    "author": "application_creator_name"
                    "parentPath": "folder1/folder2"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name"
                    "nodeType": "ITEM"
                    "resourceType": "APPLICATION"
                    "createdAt": 1707871723597
                    "updatedAt": 1707876304850
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'Without schema'
          source: |
            curl -X PUT https://chat.<company>.com/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "application": {
                  "endpoint": "http://localhost:7001/openai/deployments/10k/chat/completions",
                  "displayName": "MyApp",
                  "iconUrl": "https://host/app.svg",
                  "viewerUrl": "URL of the application custom UI",
                  "editorUrl": "URL of the application builder UI",
                  "description": "My application description",
                  "userRoles": ["AdminRole"],
                  "forwardAuthToken": true,
                  "features": {
                    "rateEndpoint": "http://host/rate",
                    "configurationEndpoint": "http://host/configure"
                  },
                  "mcp": {
                    "endpoint": "http://host/mcp",
                    "transport": "http",
                    "allowedTools": ["tool1", "tolol2"],
                    "configDelivery": "meta",
                    "forwardPerRequestKey": true
                  },
                  "maxInputAttachments": 10,
                  "inputAttachmentTypes": ["type1", "type2"],
                  "defaults": {
                    "paramStr": "value",
                    "paramBool": true,
                    "paramInt": 123,
                    "paramFloat": 0.25
                  },
                  "interceptors": ["interceptor1", "interceptor2", "interceptor3"]
                }
              }'
        - lang: 'cURL'
          label: 'With schema'
          source: |
            curl -X PUT https://chat.<company>.com/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                  "display_name": "Copilot Deck Explorer",
                  "description": "You can ask about the copilot deck there",
                  "application_type_schema_id": "https://mydial.epam.com/custom_application_schemas/quickapps",
                  "application_properties": {
                    "temperature": 0.8,
                    "instructions": "You should help explore the document containing the Copilot Deck. You must query the document first to do that. You should answer using only the information in the document. Answer \"I don't know\" if there are any other questions.",
                    "model": "gpt-4o-2024-05-13",
                    "web_api_toolset": [],
                    "document_relative_url": "files/DpZGXdhaTxt4FYCWNadE2Ln/GPT%20Deck.docx"
                  }
              }'
    get:
      operationId: getCustomApplication
      tags:
        - Applications
      summary: /v1/applications/{Bucket}/{application_path}
      description: |
        Call this endpoint to get the application structure described in JSON format.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: application_path
          in: path
          schema:
            type: string
          description: |
            The target application path. The parameter specifies full path to the application, for example: `folder1/folder2/application_name`
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: string
              examples:
                Example:
                  value: |
                    {
                      "application": {  "endpoint": "http://localhost:7001/openai/deployments/10k/chat/completions",  "displayName": "MyApp",  "iconUrl": "https://host/app.svg",  "description": "My application description",  "userRoles": ["AdminRole"],  "forwardAuthToken": true,  "features": { "rateEndpoint": "http://host/rate", "configurationEndpoint": "http://host/configure"}, "mcp": { "endpoint": "http://host/mcp", "transport": "http", "allowedTools": ["tool1", "tool2"], "configDelivery": "meta", "forwardPerRequestKey": true }, "maxInputAttachments": 10,  "inputAttachmentTypes": ["type1", "type2"],  "defaults": { "paramStr": "value", "paramBool": true, "paramInt": 123, "paramFloat": 0.25  },  "interceptors": ["interceptor1", "interceptor2", "interceptor3"]}
                    }
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name \
              -H "Api-Key: DIAL_API_KEY"
    delete:
      operationId: deleteCustomApplication
      tags:
        - Applications
      summary: /v1/applications/{Bucket}/{application_path}
      description: |
        Call this endpoint to delete the application.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: application_path
          in: path
          schema:
            type: string
          description: |
            The target application path. The parameter specifies full path to the application, for example: `folder1/folder2/application_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the application. This is used for conditional requests to ensure that the application is only deleted if it matches the specified ETag.
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name \
              -H "Api-Key: DIAL_API_KEY"
  /v1/metadata/applications/{Bucket}/{Path}:
    get:
      operationId: getApplicationMetadata
      tags:
        - Applications
      summary: /v1/metadata/applications/{Bucket}/{Path}
      description: |
        Call this endpoint to get metadata for a folder or an item.
        If the path is a folder, it must end with a "/".
        If it is called for a folder, there can be optional `nextToken` field in the response to be used to request next items if present.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: Path
          in: path
          schema:
            type: string
          description: |
            The parameter specifies path to the requested directory or application, for example: `folder1/folder2/` or `folder1/application_name/`. Note, it could be empty if you want to list the root folder.
          required: true
        - in: query
          name: token
          schema:
            type: string
          description: The token from the previous request to request next items.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Limit on the number of items in the response.
        - in: query
          name: recursive
          schema:
            type: boolean
            default: false
          description: |
            If true, returns items recursively without nested folder metadata.

            For example, request for `/a/` will contain only metadata for items `/a/b/c` and `/a/d/e/f`, but it won't contain metadata for folders: `/a/b/`, `/a/d/`, `/a/d/e`.
        - in: query
          name: permissions
          schema:
            type: boolean
            default: false
          description: If true, returns the permissions applicable to the requestor, indicating what actions they can perform on applications.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                    description: This field is not available for folders.
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                    description: ITEM if the pass is provided for an app and FOLDER in case for a folder.
                  resourceType:
                    type: string
                  etag:
                    type: string
                    description: This field is not available for folders.
                  createdAt:
                    type: integer
                    description: The creation time is not supported by all storage providers.
                  updatedAt:
                    type: integer
                  permissions:
                    type: array
                    items:
                      type: string
                      enum:
                        - READ
                        - WRITE
                        - SHARE
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        parentPath:
                          type: string
                        bucket:
                          type: string
                        url:
                          type: string
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        createdAt:
                          type: integer
                        updatedAt:
                          type: integer
                        permissions:
                          type: array
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                  nextToken:
                    type: string
                    description: An optional field that can be used to request next items if present.
              examples:
                Folder:
                  value:
                    name: folder2
                    parentPath: folder1
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/
                    nodeType: FOLDER
                    resourceType: APPLICATION
                    permissions:
                      - READ
                      - WRITE
                    items:
                      - name: application_name
                        parentPath: folder1/folder2
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name
                        nodeType: ITEM
                        resourceType: APPLICATION
                        updatedAt: 1707876435000
                        permissions:
                          - READ
                          - WRITE
                Application:
                  value:
                    name: application_name
                    author: the name of the app creator
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/application_name
                    nodeType: ITEM
                    resourceType: APPLICATION
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    permissions:
                      - READ
                      - WRITE
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/metadata/applications/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/ \
              -H "Api-Key: DIAL_API_KEY"
  /v1/bucket:
    get:
      operationId: getUserBucket
      tags:
        - Files
        - Conversations
        - Prompts
        - Applications
      summary: /v1/bucket
      description: |
        Call this endpoint to get a bucket.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  bucket:
                    type: string
                  appdata:
                    type: string
                    description: Bucket of the root user, allowing to manage user files in the assistant folder. Exists only for requests made using temporary api-key that were generated for the request to the dial assistants.
                required:
                  - bucket
              examples:
                Example:
                  value:
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "appdata": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/appdata/dall-e-3"
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/bucket \
              -H "Api-Key: DIAL_API_KEY"
  /v1/files/{Bucket}/{file_path}:
    put:
      operationId: uploadFile
      tags:
        - Files
      summary: /v1/files/{Bucket}/{file_path}
      description: |
        Call this endpoint to upload a file to the specified bucket and path.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: file_path
          in: path
          schema:
            type: string
          description: |
            The target file path. The parameter specifies full path to the file, for example: `folder1/folder2/file.png`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the file. This is used for conditional requests to ensure that the file is only uploaded if it matches the specified ETag.
            If the file does not exist, and this header is provided, the request returns 412 Precondition Failed response.
            If this header is not provided or the value is "*", any existing file at the specified path will be overwritten.
        - name: If-None-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) used to ensure that the file is only uploaded if it does not already exist.
            The only supported value is "*".
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: |
                    A part of multipart/form-data request
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  contentLength:
                    type: integer
                  contentType:
                    type: string
              examples:
                Example:
                  value:
                    "name": "file.png"
                    "parentPath": "folder1/folder2"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png"
                    "nodeType": "ITEM"
                    "resourceType": "FILE"
                    "contentLength": 128630
                    "contentType": "image/png"
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X PUT https://chat.<company>.com/v1/files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png \
              -H "Api-Key: DIAL_API_KEY" \
              -F "data=@file.png"
    get:
      operationId: downloadFile
      tags:
        - Files
      summary: /v1/files/{Bucket}/{file_path}
      description: |
        Call this endpoint to get a file content.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: file_path
          in: path
          schema:
            type: string
          description: |
            The target file path. The parameter specifies full path to the file, for example: `folder1/folder2/file.png`
          required: true
      responses:
        '200':
          description: Success
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                Example:
                  value:
                    "<Binary File Content>"
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png \
              -H "Api-Key: DIAL_API_KEY" \
              -o new_file.png
    delete:
      operationId: deleteFile
      tags:
        - Files
      summary: /v1/files/{Bucket}/{file_path}
      description: |
        Call this endpoint to delete the file.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: file_path
          in: path
          schema:
            type: string
          description: |
            The target file path. The parameter specifies full path to the file, for example: `folder1/folder2/file.png`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the file. This is used for conditional requests to ensure that the file is only deleted if it matches the specified ETag.
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png \
              -H "Api-Key: DIAL_API_KEY"
  /v1/metadata/files/{Bucket}/{Path}:
    get:
      operationId: getFileMetadata
      tags:
        - Files
      summary: /v1/metadata/files/{Bucket}/{Path}
      description: |
        Call this endpoint to retrieve metadata for a file or folder at the specified path.
        If the path is a folder, it must end with a "/".
        If it is called for a folder, there can be optional `nextToken` field in the response to be used to request next items if present.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: Path
          in: path
          schema:
            type: string
          description: |
            The parameter specifies path to the requested directory or file, for example: `folder1/folder2/`.  Note, it could be empty if you want to list the root folder.
          required: true
        - in: query
          name: token
          schema:
            type: string
          description: The token from the previous request to request next items.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Limit on the number of items in the response.
        - in: query
          name: recursive
          schema:
            type: boolean
            default: false
          description: |
            If true, returns items recursively without nested folder metadata.

            For example, request for `/a/` will contain only metadata for items `/a/b/c` and `/a/d/e/f`, but it won't contain metadata for folders: `/a/b/`, `/a/d/`, `/a/d/e`.
        - in: query
          name: permissions
          schema:
            type: boolean
            default: false
          description: If true, returns the permissions applicable to the requestor, indicating what actions they can perform on the files.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                    description: This field is not available for folders.
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  etag:
                    type: string
                    description: This field is not available for folders.
                  createdAt:
                    type: integer
                    description: The creation time is not supported by all storage providers.
                  updatedAt:
                    type: integer
                  contentLength:
                    type: integer
                  contentType:
                    type: string
                  permissions:
                    type: array
                    items:
                      type: string
                      enum:
                        - READ
                        - WRITE
                        - SHARE
                  items:
                    type: array
                    description: This field is only available for folders.
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        parentPath:
                          type: string
                        bucket:
                          type: string
                        url:
                          type: string
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        createdAt:
                          type: integer
                        updatedAt:
                          type: integer
                        contentLength:
                          type: integer
                        contentType:
                          type: string
                        permissions:
                          type: array
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                              - SHARE
              examples:
                Folder:
                  value:
                    name: folder2
                    parentPath: folder1
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/
                    nodeType: FOLDER
                    resourceType: FILE
                    permissions:
                      - READ
                      - WRITE
                    items:
                      - name: file.png
                        parentPath: folder1/folder2
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png
                        nodeType: ITEM
                        resourceType: FILE
                        updatedAt: 1707876435000
                        createdAt: 1707876435000
                        contentLength: 128630
                        contentType: image/png
                        permissions:
                          - READ
                          - WRITE
                File:
                  value:
                    name: file.png
                    author: the name of the file author
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png
                    nodeType: ITEM
                    resourceType: FILE
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    contentLength: 128630
                    contentType: image/png
                    permissions:
                      - READ
                      - WRITE
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/metadata/files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/ \
              -H "Api-Key: DIAL_API_KEY"
  /v1/ops/resource/move:
    post:
      operationId: moveResource
      tags:
        - Files
        - Conversations
        - Prompts
        - Applications
      summary: /v1/ops/resource/move
      description: |
        Moves the source resource to the destination.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceUrl:
                  type: string
                  description: Source URL. Must belong to the user.
                destinationUrl:
                  type: string
                  description: Destination URL. Must belong to the user and be of the same type as the source URL.
                overwrite:
                  type: boolean
                  description: If true, the destination URL will be overwritten if it already exists.
            examples:
              Example:
                value:
                  sourceUrl: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/file.txt
                  destinationUrl: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/file.txt
                  overwrite: true
      responses:
        '200':
          description: Success
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/move \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "sourceUrl": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/file.txt",
                "destinationUrl": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/file.txt",
                "overwrite": true
              }'
  /v1/ops/resource/copy:
    post:
      operationId: copyResource
      tags:
        - Files
        - Conversations
        - Prompts
        - Applications
      summary: /v1/ops/resource/copy
      description: |
        Copies the source resource to the destination.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceUrl:
                  type: string
                  description: Source URL. Must belong to the user.
                destinationUrl:
                  type: string
                  description: Destination URL. Must belong to the user and be of the same type as the source URL.
                overwrite:
                  type: boolean
                  description: If true, the destination URL will be overwritten if it already exists.
            examples:
              Example:
                value:
                  sourceUrl: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/file.txt
                  destinationUrl: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/file.txt
                  overwrite: true
      responses:
        '200':
          description: Success
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/copy \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "sourceUrl": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/file.txt",
                "destinationUrl": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/file.txt",
                "overwrite": true
              }'

  /v1/conversations/{Bucket}/{conversation_path}:
    put:
      operationId: saveConversation
      tags:
        - Conversations
      summary: /v1/conversations/{Bucket}/{conversation_path}
      description: |
        Call this endpoint to add a conversation to the specified bucket and path.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: conversation_path
          in: path
          schema:
            type: string
          description: |
            The target conversation path. The parameter specifies full path to the conversation, for example: `folder1/folder2/conversation_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the conversation. This is used for conditional requests to ensure that the conversation is only uploaded if it matches the specified ETag.
            If the conversation does not exist, this header is ignored.
            If this header is not provided or the value is "*", any existing conversation at the specified path will be overwritten.
        - name: If-None-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) used to ensure that the conversation is only uploaded if it does not already exist.
            The only supported value is "*".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
              description: |
                An arbitrary string representing the conversation.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  createdAt:
                    type: integer
                  updatedAt:
                    type: integer
              examples:
                Example:
                  value:
                    "name": "conversation_name"
                    "parentPath": "folder1/folder2"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name"
                    "nodeType": "ITEM"
                    "resourceType": "CONVERSATION"
                    "createdAt": 1707871723597
                    "updatedAt": 1707876304850
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X PUT https://chat.<company>.com/v1/conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "messages": [{"role": "user", "content": "Hello!"}]
              }'
    get:
      operationId: getConversation
      tags:
        - Conversations
      summary: /v1/conversations/{Bucket}/{conversation_path}
      description: |
        Call this endpoint to get the conversation.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: conversation_path
          in: path
          schema:
            type: string
          description: |
            The target conversation path. The parameter specifies full path to the conversation, for example: `folder1/folder2/conversation_name`
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: string
              examples:
                Example:
                  value: |
                    {
                      "messages": [{"role": "user", "content": "Hello!"}]
                    }
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name \
              -H "Api-Key: DIAL_API_KEY"
    delete:
      operationId: deleteConversation
      tags:
        - Conversations
      summary: /v1/conversations/{Bucket}/{conversation_path}
      description: |
        Call this endpoint to delete the conversation.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: conversation_path
          in: path
          schema:
            type: string
          description: |
            The target conversation path. The parameter specifies full path to the conversation, for example: `folder1/folder2/conversation_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the conversation. This is used for conditional requests to ensure that the conversation is only deleted if it matches the specified ETag.
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name \
              -H "Api-Key: DIAL_API_KEY"

  /v1/metadata/conversations/{Bucket}/{Path}:
    get:
      operationId: getConversationMetadata
      tags:
        - Conversations
      summary: /v1/metadata/conversations/{Bucket}/{Path}
      description: |
        Call this endpoint to get metadata for a folder or an item.
        If the path is a folder, it must end with a "/".
        If it is called for a folder, there can be optional `nextToken` field in the response to be used to request next items if present.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: Path
          in: path
          schema:
            type: string
          description: |
            The parameter specifies path to the requested directory or a conversation, for example: `folder1/folder2/`.  Note, it could be empty if you want to list the root folder.
          required: true
        - in: query
          name: token
          schema:
            type: string
          description: The token from the previous request to request next items.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Limit on the number of items in the response.
        - in: query
          name: recursive
          schema:
            type: boolean
            default: false
          description: |
            If true, returns items recursively without nested folder metadata.

            For example, request for `/a/` will contain only metadata for items `/a/b/c` and `/a/d/e/f`, but it won't contain metadata for folders: `/a/b/`, `/a/d/`, `/a/d/e`.
        - in: query
          name: permissions
          schema:
            type: boolean
            default: false
          description: If true, returns the permissions applicable to the requestor, indicating what actions they can perform on the conversations.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                    description: This field is not available for folders.
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  etag:
                    type: string
                    description: This field is not available for folders.
                  createdAt:
                    type: integer
                    description: The creation time is not supported by all storage providers.
                  updatedAt:
                    type: integer
                  permissions:
                    type: array
                    items:
                      type: string
                      enum:
                        - READ
                        - WRITE
                        - SHARE
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        parentPath:
                          type: string
                        bucket:
                          type: string
                        url:
                          type: string
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        createdAt:
                          type: integer
                        updatedAt:
                          type: integer
                        permissions:
                          type: array
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                              - SHARE
                  nextToken:
                    type: string
                    description: An optional field that can be used to request next items if present.
              examples:
                Folder:
                  value:
                    name: folder2
                    parentPath: folder1
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/
                    nodeType: FOLDER
                    resourceType: CONVERSATION
                    permissions:
                      - READ
                      - WRITE
                    items:
                      - name: conversation_name
                        parentPath: folder1/folder2
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        url: conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name
                        nodeType: ITEM
                        resourceType: CONVERSATION
                        updatedAt: 1707876435000
                        permissions:
                          - READ
                          - WRITE
                Conversation:
                  value:
                    name: conversation_name
                    author: the name of the author of the conversation
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name
                    nodeType: ITEM
                    resourceType: CONVERSATION
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    permissions:
                      - READ
                      - WRITE
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/metadata/conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/ \
              -H "Api-Key: DIAL_API_KEY"

  /v1/prompts/{Bucket}/{prompt_path}:
    put:
      operationId: savePrompt
      tags:
        - Prompts
      summary: /v1/prompts/{Bucket}/{prompt_path}
      description: |
        Call this endpoint to add a prompt to the specified bucket and path.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: prompt_path
          in: path
          schema:
            type: string
          description: |
            The target prompt path. The parameter specifies full path to the prompt, for example: `folder1/folder2/prompt_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the prompt. This is used for conditional requests to ensure that the prompt is only uploaded if it matches the specified ETag.
            If the prompt does not exist, this header is ignored.
            If this header is not provided or the value is "*", any existing prompt at the specified path will be overwritten.
        - name: If-None-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) used to ensure that the prompt is only uploaded if it does not already exist.
            The only supported value is "*".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptRequest'
            examples:
              Example:
                value:
                  name: My prompt
                  id: prompt_123
                  folderId: public/folder/
                  content: The content of the prompt
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: Resource name provided in the prompt path
                  parentPath:
                    type: string
                    description: Relative path to the resource starting with the bucket identifier
                  bucket:
                    type: string
                    description: User's bucket name
                  url:
                    type: string
                    description: A full path to the prompt
                  nodeType:
                    type: string
                    description: A node type
                    enum:
                      - ITEM
                      - FOLDER
                  resourceType:
                    type: string
                    description: A resource type
                  etag:
                    type: string
                    description: This field is not available for folders.
                  createdAt:
                    type: integer
                    description: The creation time is not supported by all storage providers.
                  updatedAt:
                    type: integer
                  permissions:
                    type: array
                    items:
                      type: string
                      enum:
                        - READ
                        - WRITE
                        - SHARE
              examples:
                Example:
                  value:
                    name: prompt_name
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                    nodeType: ITEM
                    resourceType: PROMPT
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    createdAt: 1707871723597
                    updatedAt: 1707876304850
                    permissions:
                      - READ
                      - WRITE
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X PUT https://chat.<company>.com/v1/prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name \
              -H "Api-Key: DIAL_API_KEY" \
              -d 'You are a helpful assistant'
    get:
      operationId: getPrompt
      tags:
        - Prompts
      summary: /v1/prompts/{Bucket}/{prompt_path}
      description: |
        Call this endpoint to get the prompt.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: prompt_path
          in: path
          schema:
            type: string
          description: |
            The target prompt path. The parameter specifies full path to the prompt, for example: `folder1/folder2/prompt_name`
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Prompt unique identifier
                  folderId:
                    type: string
                    description: Path to the folder where prompt located according to the user's root
                  name:
                    type: string
                    description: Prompt's display name
                  content:
                    type: string
                    description: Prompt content
              examples:
                Example:
                  value:
                    id: prompt_123
                    folderId: public/folder/
                    name: My prompt
                    content: The content of the prompt
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name \
              -H "Api-Key: DIAL_API_KEY"
    delete:
      operationId: deletePrompt
      tags:
        - Prompts
      summary: /v1/prompts/{Bucket}/{prompt_path}
      description: |
        Call this endpoint to delete the prompt.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: prompt_path
          in: path
          schema:
            type: string
          description: |
            The target prompt path. The parameter specifies full path to the prompt, for example: `folder1/folder2/prompt_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the prompt. This is used for conditional requests to ensure that the prompt is only deleted if it matches the specified ETag.
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name \
              -H "Api-Key: DIAL_API_KEY"
  /v1/metadata/prompts/{Bucket}/{Path}:
    get:
      operationId: getPromptMetadata
      tags:
        - Prompts
      summary: /v1/metadata/prompts/{Bucket}/{Path}
      description: |
        Call this endpoint to get metadata for a folder or an item.
        If the path is a folder, it must end with a "/".
        If it is called for a folder, there can be optional `nextToken` field in the response to be used to request next items if present.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: Path
          in: path
          schema:
            type: string
          description: |
            The parameter specifies path to a directory or a prompt, for example: `folder1/folder2/`.
          required: true
        - in: query
          name: token
          schema:
            type: string
          description: The token from the previous request to request next items.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Limit on the number of items in the response.
        - in: query
          name: recursive
          schema:
            type: boolean
            default: false
          description: |
            If true, returns items recursively without nested folder metadata.

            For example, request for `/a/` will contain only metadata for items `/a/b/c` and `/a/d/e/f`, but it won't contain metadata for folders: `/a/b/`, `/a/d/`, `/a/d/e`.
        - in: query
          name: permissions
          schema:
            type: boolean
            default: false
          description: If true, returns the permissions applicable to the requestor, indicating what actions they can perform on the prompts.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  contentLength:
                    type: integer
                  updatedAt:
                    type: integer
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        author:
                          type: string
                        etag:
                          type: string
                        parentPath:
                          type: string
                        bucket:
                          type: string
                        url:
                          type: string
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        updatedAt:
                          type: integer
                  nextToken:
                    type: string
                    description: An optional field that can be used to request next items if present.
                  etag:
                    type: string
                    description: This field is not available for folders.
              examples:
                Folder:
                  value:
                    "name": "folder2"
                    "parentPath": "folder1"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/"
                    "nodeType": "FOLDER"
                    "resourceType": "PROMPT"
                    items:
                      - name: "prompt_name"
                        "parentPath": "folder1/folder2"
                        "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                        "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name"
                        "nodeType": "ITEM"
                        "resourceType": "PROMPT"
                        "updatedAt": 1707876435000
                Prompt:
                  value:
                    "name": "prompt_name"
                    "author": "the name of the author"
                    "etag": "7dfb93c3c62b88e9a75ff36a6af6c7eb"
                    "parentPath": "folder1/folder2"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name"
                    "nodeType": "ITEM"
                    "resourceType": "PROMPT"
                    "updatedAt": 1707876435000
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/metadata/prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/ \
              -H "Api-Key: DIAL_API_KEY"

  /v1/toolsets/{Bucket}/{toolset_path}:
    put:
      operationId: saveToolSet
      tags:
        - Toolsets
      summary: /v1/toolsets/{Bucket}/{toolset_path}
      description: Call this endpoint to add a toolset to the specified bucket and path or update the existing toolset.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: toolset_path
          in: path
          schema:
            type: string
          description: |
            The target toolset path. The parameter specifies full path to the toolset, for example: `folder1/folder2/toolset_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the toolset. This is used for conditional requests to ensure that the toolset is only uploaded if it matches the specified ETag.
            If the toolset does not exist, this header is ignored.
            If this header is not provided or the value is "*", any existing toolset at the specified path will be overwritten.
        - name: If-None-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) used to ensure that the toolset is only uploaded if it does not already exist.
            The only supported value is "*".
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Toolset'
            examples:
              ToolsetWithOauthAuthStatic:
                value:
                  endpoint: http://toolset/v1/mcp
                  iconUrl: http://toolset/icon.svg
                  description: My toolset description
                  displayName: My Toolset
                  displayVersion: "1.1"
                  forward_per_request_key: true
                  transport: HTTP
                  allowedTools:
                    - tool1
                    - tool2
                  auth_settings:
                    authentication_type: OAUTH
                    client_id: my-client-id
                    client_secret: my-client-secret
                    redirect_uri: https://myapp.com/toolset/sign-in
                    authorization_endpoint: https://authserver.com/authorize
                    token_endpoint: https://authserver.com/token
                    code_challenge_method: S256
                    scopes_supported: [ scope1, scope2 ]
              ToolsetWithOauthAuthDynamic:
                value:
                  endpoint: http://toolset/v1/mcp
                  iconUrl: http://toolset/icon.svg
                  description: My toolset description
                  displayName: My Toolset
                  displayVersion: "1.1"
                  forward_per_request_key: true
                  transport: HTTP
                  allowedTools:
                    - tool1
                    - tool2
                  auth_settings:
                    authentication_type: OAUTH
                    redirect_uri: https://myapp.com/toolset/sign-in
              ToolsetWithApiKeyAuth:
                value:
                  endpoint: http://toolset/v1/mcp
                  iconUrl: http://toolset/icon.svg
                  description: My toolset description
                  displayName: My Toolset
                  displayVersion: "1.1"
                  forward_per_request_key: true
                  transport: HTTP
                  allowedTools:
                    - tool1
                    - tool2
                  auth_settings:
                    authentication_type: API_KEY
                    api_key_header: X-API-KEY
              ToolsetWithNoneAuth:
                value:
                  endpoint: http://toolset/v1/mcp
                  iconUrl: http://toolset/icon.svg
                  description: My toolset description
                  displayName: My Toolset
                  displayVersion: "1.1"
                  forward_per_request_key: true
                  transport: HTTP
                  allowedTools:
                    - tool1
                    - tool2
                  auth_settings:
                    authentication_type: NONE
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  createdAt:
                    type: integer
                  updatedAt:
                    type: integer
                  etag:
                    type: string
              examples:
                Example:
                  value:
                    name: toolset-name
                    parentPath: folder1/folder2
                    bucket: encrypted-bucket
                    url: toolsets/encrypted-bucket/folder1/folder2/toolset-name
                    nodeType: ITEM
                    resourceType: TOOL_SET
                    createdAt: 1707871723597
                    updatedAt: 1707876304850
                    etag: 59b9715451eac909281701f490633b5c
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X PUT https://chat.<company>.com/v1/toolsets/ENCRYPTED_BUCKET/my-toolset \
              -H "Api-Key: DIAL_API_KEY"
    get:
      operationId: getCustomToolSet
      tags:
        - Toolsets
      summary: /v1/toolsets/{Bucket}/{toolset_path}
      description: Call this endpoint to retrieve a specific toolset.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: toolset_path
          in: path
          schema:
            type: string
          description: |
            The target toolset path. The parameter specifies full path to the toolset, for example: `folder1/folder2/toolset_name`
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/Toolset'
              examples:
                ToolsetWithOauthAuth:
                  value:
                    name: toolsets/encrypted-bucket/folder/toolSetName-1
                    endpoint: http://toolset/v1/mcp
                    reference: bf9500f0-6977-4cf3-8a01-a29c8431cffc
                    forward_auth_token: false
                    defaults: { }
                    interceptors: [ ]
                    icon_url: http://toolset/icon.svg
                    description: My toolset description
                    display_name: My Toolset
                    user_roles:
                      - admin
                    description_keywords:
                      - keyword1
                      - keyword2
                    max_retry_attempts: 2
                    author: Author's name
                    created_at: 1672534800
                    updated_at: 1672534900
                    forward_per_request_key: false
                    transport: HTTP
                    allowed_tools:
                      - tool1
                      - tool2
                    auth_settings:
                      authentication_type: OAUTH
                      client_id: my-client-id
                      redirect_uri: https://myapp.com/toolset/sign-in
                      authorization_endpoint: https://authserver.com/authorize
                      token_endpoint: https://authserver.com/token
                      code_challenge_method: S256
                      scopes_supported: [scope1, scope2]
                      global_auth_status: SIGNED_OUT
                      user_level_auth_status: SIGNED_OUT
                ToolsetWithApiKeyAuth:
                  value:
                    name: toolsets/encrypted-bucket/folder/toolSetName-1
                    endpoint: http://toolset/v1/mcp
                    reference: bf9500f0-6977-4cf3-8a01-a29c8431cffc
                    forward_auth_token: false
                    defaults: { }
                    interceptors: [ ]
                    icon_url: http://toolset/icon.svg
                    description: My toolset description
                    display_name: My Toolset
                    user_roles:
                      - admin
                    description_keywords:
                      - keyword1
                      - keyword2
                    max_retry_attempts: 2
                    author: Author's name
                    created_at: 1672534800
                    updated_at: 1672534900
                    forward_per_request_key: false
                    transport: HTTP
                    allowed_tools:
                      - tool1
                      - tool2
                    auth_settings:
                      authentication_type: API_KEY
                      api_key_header: X-API-KEY
                      global_auth_status: SIGNED_OUT
                      user_level_auth_status: SIGNED_OUT
                ToolsetWithNoneAuth:
                  value:
                    name: toolsets/encrypted-bucket/folder/toolSetName-1
                    endpoint: http://toolset/v1/mcp
                    reference: bf9500f0-6977-4cf3-8a01-a29c8431cffc
                    forward_auth_token: false
                    defaults: { }
                    interceptors: [ ]
                    icon_url: http://toolset/icon.svg
                    description: My toolset description
                    display_name: My Toolset
                    user_roles:
                      - admin
                    description_keywords:
                      - keyword1
                      - keyword2
                    max_retry_attempts: 2
                    author: Author's name
                    created_at: 1672534800
                    updated_at: 1672534900
                    forward_per_request_key: false
                    transport: HTTP
                    allowed_tools:
                      - tool1
                      - tool2
                    auth_settings:
                      authentication_type: NONE
                      global_auth_status: SIGNED_OUT
                      user_level_auth_status: SIGNED_OUT
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/toolsets/ENCRYPTED_BUCKET/my-toolset \
              -H "Api-Key: DIAL_API_KEY"

    delete:
      operationId: deleteToolSet
      tags:
        - Toolsets
      summary: /v1/toolsets/{Bucket}/{toolset_path}
      description: Call this endpoint to delete a toolset from the specified path.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: toolset_path
          in: path
          schema:
            type: string
          description: |
            The target toolset path. The parameter specifies full path to the toolset, for example: `folder1/folder2/toolset_name`
          required: true
        - name: If-Match
          in: header
          schema:
            type: string
          description: |
            The entity tag (ETag) of the toolset. This is used for conditional requests to ensure that the toolset is only deleted if it matches the specified ETag.
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
        '412':
          description: Precondition Failed - ETag mismatch
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/toolsets/ENCRYPTED_BUCKET/my-toolset \
              -H "Api-Key: DIAL_API_KEY"

  /v1/toolset/{toolset_id}/tools:
    get:
      operationId: getAllToolSetTools
      tags:
        - Toolsets
      summary: /v1/toolset/{toolset_id}/tools
      description: Call this endpoint to retrieve all tools supported by a specific MCP server. Available to admins and toolset owners. Used during toolset configuration to select allowed tools.
      parameters:
        - name: toolset_id
          in: path
          schema:
            type: string
          description: |
            The target toolset ID. The parameter specifies the unique identifier of the toolset.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  result:
                    type: object
                    properties:
                      tools:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            title:
                              type: string
              examples:
                Example:
                  value:
                    {
                       "id": "1",
                       "result": {
                        "tools": [
                          {
                            "name": "tool_name",
                            "title": "tool_title"
                          },
                          {
                            "name": "tool_name",
                            "title": "tool_title"
                          }
                        ]
                       }
                    }
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/toolset/{toolset_id}/tools
              -H "Api-Key: DIAL_API_KEY"

  /v1/toolset/{toolset_id}/allowed-tools:
    get:
      operationId: getAllToolSetAllowedTools
      tags:
        - Toolsets
      summary: /v1/toolset/{toolset_id}/allowed-tools
      description: Call this endpoint to retrieve a filtered list of all allowed tools for a specific MCP server.
      parameters:
        - name: toolset_id
          in: path
          schema:
            type: string
          description: |
            The target toolset ID. The parameter specifies the unique identifier of the toolset.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  result:
                    type: object
                    properties:
                      tools:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            title:
                              type: string
              examples:
                Example:
                  value:
                    {
                       "id": "1",
                       "result": {
                        "tools": [
                          {
                            "name": "tool_name",
                            "title": "tool_title"
                          },
                          {
                            "name": "tool_name",
                            "title": "tool_title"
                          }
                        ]
                       }
                    }
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/toolset/{toolset_id}/allowed-tools
              -H "Api-Key: DIAL_API_KEY"

  /v1/ops/toolset/signin:
    post:
      operationId: toolsetSignin
      tags:
        - Toolsets
      summary: /v1/ops/toolset/signin
      description: Authenticates a user with a specified Toolset using OAUTH or API_KEY.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The Toolset URL (e.g., toolsets/{bucket}/{path}).
                credentials_level:
                  type: string
                  enum: [ GLOBAL, APP, USER ]
                  description: The scope of credentials for the Toolset.
                authentication_type:
                  type: string
                  enum: [ OAUTH, API_KEY ]
                  description: The authentication method.
                code:
                  type: string
                  description: The authorization code (OAUTH only).
                api_key:
                  type: string
                  description: The API key value (API_KEY only).
              required:
                - url
                - credentials_level
                - authentication_type
            examples:
              ToolsetWithOauthAuth:
                value:
                  url: toolsets/my-encrypted-bucket/toolSetName-1
                  credentials_level: USER
                  authentication_type: OAUTH
                  code: my-auth-code-value
              ToolsetWithApiKeyAuth:
                value:
                  url: toolsets/encrypted-bucket/toolSetName-1
                  credentials_level: USER
                  authentication_type: API_KEY
                  api_key: my-api-key-value
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Signin status.
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request

  /v1/ops/toolset/signout:
    post:
      operationId: toolSetSignout
      tags:
        - Toolsets
      summary: /v1/ops/toolset/signout
      description: Logs the user out from the Toolset by removing the associated credentials.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The Toolset URL (e.g., toolsets/{bucket}/{path}).
                credentials_level:
                  type: string
                  enum: [ GLOBAL, APP, USER ]
                  description: The scope of credentials for the Toolset.
                authentication_type:
                  type: string
                  enum: [ OAUTH, API_KEY ]
                  description: The authentication method.
              required:
                - url
                - credentials_level
                - authentication_type
            examples:
              ToolsetWithOauthAuth:
                value:
                  url: toolsets/my-encrypted-bucket/toolSetName-1
                  credentials_level: USER
                  authentication_type: OAUTH
              ToolsetWithApiKeyAuth:
                value:
                  url: toolsets/encrypted-bucket/toolSetName-1
                  credentials_level: USER
                  authentication_type: API_KEY
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Signout status.
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request

  /v1/metadata/toolsets/{Bucket}/{Path}:
    get:
      operationId: getToolSetMetadata
      tags:
        - Toolsets
      summary: /v1/metadata/toolsets/{Bucket}/{Path}
      description: |
        Call this endpoint to get metadata for a toolset folder or item.<br />
        If the path is a folder, it must end with a "/".
        If it is called for a folder, there can be optional `nextToken` field in the response to be used to request next items if present.
      parameters:
        - name: Bucket
          in: path
          schema:
            type: string
          description: The target bucket.
          required: true
        - name: Path
          in: path
          schema:
            type: string
          description: |
            The parameter specifies path to a directory or a toolset, for example: `folder1/folder2/`.
          required: true
        - in: query
          name: token
          schema:
            type: string
          description: The token from the previous request to request next items.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
          description: Limit on the number of items in the response.
        - in: query
          name: recursive
          schema:
            type: boolean
            default: false
          description: |
            If true, returns items recursively without nested folder metadata.

            For example, request for `/a/` will contain only metadata for items `/a/b/c` and `/a/d/e/f`, but it won't contain metadata for folders: `/a/b/`, `/a/d/`, `/a/d/e`.
        - in: query
          name: permissions
          schema:
            type: boolean
            default: false
          description: If true, returns the permissions applicable to the requestor, indicating what actions they can perform on the toolsets.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  author:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  contentLength:
                    type: integer
                  updatedAt:
                    type: integer
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        author:
                          type: string
                        etag:
                          type: string
                        parentPath:
                          type: string
                        bucket:
                          type: string
                        url:
                          type: string
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        updatedAt:
                          type: integer
                  nextToken:
                    type: string
                    description: An optional field that can be used to request next items if present.
                  etag:
                    type: string
                    description: This field is not available for folders.
              examples:
                Folder:
                  value:
                    "name": "folder2"
                    "parentPath": "folder1"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/"
                    "nodeType": "FOLDER"
                    "resourceType": "TOOL_SET"
                    items:
                      - name: "toolset_name"
                        "parentPath": "folder1/folder2"
                        "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                        "url": "toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/toolset_name"
                        "nodeType": "ITEM"
                        "resourceType": "TOOL_SET"
                        "updatedAt": 1707876435000
                Toolset:
                  value:
                    "name": "toolset_name"
                    "author": "the name of the author"
                    "etag": "7dfb93c3c62b88e9a75ff36a6af6c7eb"
                    "parentPath": "folder1/folder2"
                    "bucket": "3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST"
                    "url": "toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/toolset_name"
                    "nodeType": "ITEM"
                    "resourceType": "TOOL_SET"
                    "updatedAt": 1707876435000
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/metadata/toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/ \
              -H "Api-Key: DIAL_API_KEY"

  /v1/ops/publication/list:
    post:
      operationId: getPublications
      tags:
        - Publications
      summary: /v1/ops/publication/list
      description: Call this endpoint to get a list of publication requests. For admins, it is a list of all publication requests that are `PENDING` for review (approve or reject). For users, it is a list of all publication requests created by a particular user. Refer to documentation to learn more about working with publications for [users](https://docs.dialx.ai/platform/collaboration-intro#publication) and [admins](https://docs.dialx.ai/platform/admin-panel/approvals-prompt-publications).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: The publication URL. For admins it is  `publications/public/`. For users it is `publications/user_bucket/`.
            examples:
              ExampleUser:
                value:
                  url: "publications/3CcedGxCx23EwiVbV/"
              ExampleAdmin:
                value:
                  url: "publications/public/"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationResponse'
              examples:
                ExampleUser:
                  value:
                    publications:
                      - url: publications/3CcedGxCx23EwiVbV/0123
                        author: the name of the publication request author
                        displayAuthor: the name of the publication request author displayed on UI
                        targetFolder: public/folder/
                        status: PENDING
                        createdAt: 0
                        resourceTypes: [ "CONVERSATION" ]
                ExampleAdmin:
                  value:
                    publications:
                      - url: publications/3CcedGxCx23EwiVbV/0123
                        author: the name of the publication request author
                        displayAuthor: the name of the publication request author displayed on UI
                        name: Publication name
                        targetFolder: public/folder/
                        status: PENDING
                        createdAt: 0
                        resourceTypes: [ "CONVERSATION" ]
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/publication/get:
    post:
        operationId: getPublication
        tags:
          - Publications
        summary: /v1/ops/publication/get
        description: Call this endpoint to get a specific publication request.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The publication request. Template is `publications/bucketId/requestId`.
              examples:
                Example:
                  value:
                    url: "publications/3CcedGxCx23EwiVbV/0123"
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/GetPublicationResponseObject'
                examples:
                  Example:
                    value:
                      url: publications/3CcedGxCx23EwiVbV/0123
                      targetFolder: public/folder/
                      author: the name of the publication request author
                      displayAuthor: the name of the publication request author displayed on UI
                      status: APPROVED
                      createdAt: 0
                      resources:
                        - action: ADD
                          sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                          targetUrl: conversations/public/folder/conversation
                          reviewUrl: conversations/3CcedGxCx23EwiVbV/conversation
                      rules:
                        - function: EQUAL
                          source: roles
                          targets:
                          - user
                      resourceTypes:
                        - CONVERSATION
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/create:
      post:
        operationId: createPublication
        tags:
          - Publications
        summary: /v1/ops/publication/create
        description: Call this endpoint to create a publish or unpublish request.
        requestBody:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationRequest'
              examples:
                Example:
                  value:
                    name: Publication name
                    displayAuthor: The author's name displayed on UI
                    targetFolder: public/folder/
                    resources:
                      - action: ADD
                        sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                        targetUrl: conversations/public/folder/conversation
                        publishCredentials: true
                    rules:
                      - function: EQUAL
                        source: roles
                        targets:
                        - user
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/PublicationResponseObject'
                examples:
                  Example:
                    value:
                      url: publications/3CcedGxCx23EwiVbV/0123
                      name: Publication name
                      author: The name of the publication request author
                      displayAuthor: The author's name displayed on UI
                      targetFolder: public/folder/
                      status: PENDING
                      createdAt: 0
                      resources:
                        - action: ADD
                          sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                          targetUrl: conversations/public/folder/conversation
                          reviewUrl: conversations/3CcedGxCx23EwiVbV/conversation
                      rules:
                        - function: EQUAL
                          source: roles
                          targets:
                          - user
                      resourceTypes:
                        - CONVERSATION
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/update:
      post:
        operationId: updatePublication
        tags:
          - Publications
        summary: /v1/ops/publication/update
        description: Call this endpoint to update a publish request. Available for admins.
        requestBody:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePublicationRequest'
              examples:
                Example:
                  value:
                    name: Publication name
                    displayAuthor: The author's name displayed on UI
                    url: publications/3CcedGxCx23EwiVbV/0123
                    targetFolder: public/folder/
                    resources:
                      - action: ADD
                        sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                        targetUrl: conversations/public/folder/conversation
                        publishCredentials: true
                    rules:
                      - function: EQUAL
                        source: roles
                        targets:
                        - user
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/PublicationResponseObject'
                examples:
                  Example:
                    value:
                      url: publications/3CcedGxCx23EwiVbV/0123
                      name: Publication name
                      author: The name of the publication request author
                      displayAuthor: The author's name displayed on UI
                      targetFolder: public/folder/
                      status: PENDING
                      createdAt: 0
                      resources:
                        - action: ADD
                          sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                          targetUrl: conversations/public/folder/conversation
                          reviewUrl: conversations/3CcedGxCx23EwiVbV/conversation
                      rules:
                        - function: EQUAL
                          source: roles
                          targets:
                          - user
                      resourceTypes:
                        - CONVERSATION
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/delete:
      post:
        operationId: deletePublication
        tags:
          - Publications
        summary: /v1/ops/publication/delete
        description: Call this endpoint to delete the publication request. Only requests that are in the `PENDING` status can be deleted.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The publication URL. Template is `publications/bucketId/requestId`.
              examples:
                Example:
                  value:
                    url: publications/3CcedGxCx23EwiVbV/0123
        responses:
          '200':
            description: Success
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/reject:
      post:
        operationId: rejectPublication
        tags:
          - Publications
        summary: /v1/ops/publication/reject
        description: Admins only! <br> Call this endpoint to reject the publication request.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The publication URL. Template is `publications/bucketId/requestId`.
                  comment:
                    type: string
                    description: Rejection comment.
              examples:
                Example:
                  value:
                    url: publications/3CcedGxCx23EwiVbV/0123
                    comment: The rejection reason.
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/PublicationResponseObject'
                examples:
                  Example:
                    value:
                      url: publications/3CcedGxCx23EwiVbV/0123
                      name: Publication name
                      targetFolder: public/folder/
                      status: REJECTED
                      createdAt: 0
                      resources:
                        - action: ADD
                          sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                          targetUrl: conversations/public/folder/conversation
                          reviewUrl: conversations/3CcedGxCx23EwiVbV/conversation
                      rules:
                        - function: EQUAL
                          source: roles
                          targets:
                          - user
                      resourceTypes:
                        - CONVERSATION
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/approve:
      post:
        operationId: approvePublication
        tags:
          - Publications
        summary: /v1/ops/publication/approve
        description: Admins only! <br> Call this endpoint to approve the publication request.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: The publication URL. Template is `publications/bucketId/requestId`.
              examples:
                Example:
                  value:
                    url: publications/3CcedGxCx23EwiVbV/0123
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/PublicationResponseObject'
                examples:
                  Example:
                    value:
                      url: publications/3CcedGxCx23EwiVbV/0123
                      name: Publication name
                      targetFolder: public/folder/
                      status: APPROVED
                      createdAt: 0
                      resources:
                        - action: ADD
                          sourceUrl: conversations/3CcedGxCx23EwiVbV/my/folder/conversation
                          targetUrl: conversations/public/folder/conversation
                          reviewUrl: conversations/3CcedGxCx23EwiVbV/conversation
                      rules:
                        - function: EQUAL
                          source: roles
                          targets:
                          - user
                      resourceTypes:
                        - CONVERSATION
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/publication/rule/list:
      post:
        operationId: getPublicationRules
        tags:
          - Publications
        summary: /v1/ops/publication/rule/list
        description: Call this endpoint to get a list of rules for publications.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: Publication public folder URL. Template is `public/folderName`
              examples:
                Example:
                  value:
                    url: publications/3CcedGxCx23EwiVbV/
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/PublicationRules'
                examples:
                  Example:
                    value:
                      rules:
                        public/folder:
                          - source: roles
                            function: EQUAL
                            targets:
                              - user
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/resource/per-request-permissions/grant:
    post:
      operationId: grantPerRequestPermissions
      tags:
        - Sharing
      summary: /v1/ops/resource/per-request-permissions/grant
      description: |
        Call this endpoint to share resources between deployments (toolsets and applications). 
        
        **Important**: This request can be authorized only with a [per-request API](https://docs.dialx.ai/platform/core/per-request-keys) key issued by DIAL Core for the deployment sending the request.
        
        Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/sharing) for more details on how to share resources between deployments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to share.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to share.
                      permissions:
                        type: array
                        description: Lists the permissions you grant for the resource.
                        items:
                          type: string
                          enum:
                            - READ
                            - WRITE
                receiver:
                  type: string
                  description: The ID of the receiving DIAL deployment (application or toolset).
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmyf46KypuBQ65miviST/folder1/folder2/prompt_name
                      permissions:
                        - READ
                    - url: files/3CcedGxCx23EwiVbVms6KypuBQ65miviST/folder1/image.png
                      permissions:
                        - WRITE
                  receiver: deploymentID
      responses:
        '200':
          description: Success
        '403':
          description: Unauthorized - Operation is only permitted by per request API key
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/per-request-permissions/grant \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name",
                    "permissions": ["READ"]
                  },
                  {
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png",
                    "permissions": ["WRITE"]
                  }
                ],
                "receiver": "132465798"
              }'
  /v1/ops/resource/per-request-permissions/revoke:
    post:
      operationId: revokePerRequestPermissions
      tags:
        - Sharing
      summary: /v1/ops/resource/per-request-permissions/revoke
      description: |
        Call this endpoint to revoke access to a shared resources between deployments (toolsets and applications). 
        
        **Important**: This request can be authorized only with a [per-request API](https://docs.dialx.ai/platform/core/per-request-keys) key issued by DIAL Core for the deployment sending the request.
        
        Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/sharing) for more details on how to share resources between deployments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to share.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to share.
                      permissions:
                        type: array
                        description: Lists the permissions you grant for the resource.
                        items:
                          type: string
                          enum:
                            - READ
                            - WRITE
                receiver:
                  type: string
                  description: The ID of the receiving DIAL deployment (application or toolset).
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmyf46KypuBQ65miviST/folder1/folder2/prompt_name
                      permissions:
                        - READ
                    - url: files/3CcedGxCx23EwiVbVms6KypuBQ65miviST/folder1/image.png
                      permissions:
                        - WRITE
                  receiver: deploymentID
      responses:
        '200':
          description: Success
        '403':
          description: Unauthorized - Operation is only permitted by per request API key
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/per-request-permissions/revoke \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name",
                    "permissions": ["READ"]
                  },
                  {
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png",
                    "permissions": ["WRITE"]
                  }
                ],
                "receiver": "132465798"
              }'
  /v1/ops/resource/per-request-permissions/list:
    post:
      operationId: getPerRequestPermissions
      tags:
        - Sharing
      summary: /v1/ops/resource/per-request-permissions/list
      description: |
        Call this endpoint to get a list of shared resources by or with a specific deployment (toolset and application). 
        
        **Important**: This request can be authorized only with a [per-request API](https://docs.dialx.ai/platform/core/per-request-keys) key issued by DIAL Core for the deployment sending the request.
        
        Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/sharing) for more details on how to share resources between deployments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                with:
                  type: string
                  enum:
                    - me
                    - others
                  description: |
                    Currently, supported the next options:
                    - `me`: returns shared resources with you.
                    - `others`: returns resources that you have shared with others
            examples:
              Example:
                value:
                  with: me
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  resources:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                        permissions:
                          description: |
                            Lists the permissions you have on the resource if `with` is set to "me".
                            Lists the permissions you have granted to others if `with` is set to "others".
                          type: array
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                  receivers:
                    type: array
                    items:
                      type: object
                      properties:
                        receiver:
                          type: string
                        resources:
                          type: array
                          items:
                            type: object
                            properties:
                              url:
                                type: string
                              permissions:
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - READ
                                    - WRITE
              examples:
                me:
                  value:
                    resources:
                      - url: prompts/3CcedGxCx23EwiVbVmyf46KypuBQ65miviST/folder1/folder2/prompt_name
                        permissions:
                          - READ
                others:
                  value:
                    receivers:
                      - receiver: "112345678"
                        resources:
                          - url: prompts/3CcedGxCx23EwiVbVmyf46KypuBQ65miviST/folder1/folder2/prompt_name
                            permissions:
                              - READ
        '403':
          description: Unauthorized - Operation is only permitted by per request API key
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/per-request-permissions/list \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "with": "me",
              }'
  /v1/ops/resource/share/create:
    post:
      operationId: shareResource
      tags:
        - Sharing
      summary: /v1/ops/resource/share/create
      description: |
        Call this endpoint to share and re-share resources. Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/sharing) for more details on how to share resources.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to share.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to share.
                      permissions:
                        type: array
                        description: Lists the permissions you have on the resource.
                        items:
                          type: string
                          enum:
                            - READ
                            - WRITE
                            - SHARE
                      shareCredentials:
                        type: boolean
                        description: Indicates whether global resource credentials should be shared with user.
                        default: false
                invitationType:
                  type: string
                  description: The invitation type. Only `link` is currently supported.
                maxAcceptedUsers:
                  type: integer
                  description: The number of users that can accept the invitation link. Defaults to unlimited.
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmyf46KypuBQ65miviST/folder1/folder2/prompt_name
                      permissions:
                        - READ
                    - url: files/3CcedGxCx23EwiVbVms6KypuBQ65miviST/folder1/image.png
                      permissions:
                        - WRITE
                    - url: files/3CcedGxCx23EwiVbVmscVkKypuBQ65miviST/folder1/document.pdf
                      permissions:
                        - SHARE
                      shareCredentials: false
                    - url: toolsets/3CcedGxCx23EwiVbVmscVkKypuBQ65miviST/folder1/my-toolset
                      permissions:
                        - READ
                      shareCredentials: true
                  invitationType: link
                  maxAcceptedUsers: 10
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  invitationLink:
                    type: string
              examples:
                Example:
                  value:
                    invitationLink: v1/invitations/2818T2YRgFaMt8YW176ix7f3adFjxBx5TMQbzmnxgRGNPbDtctJ1wwGkigG78YU6juKnUKRWPNAt1f8Cna5Do7X48FnXwHs5MutEpefm6jTuMQ
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/share/create \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name"
                  },
                  {
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png"
                  }
                ],
                "invitationType": "link"
              }'
  /v1/ops/resource/share/list:
    post:
      operationId: getSharedResources
      tags:
        - Sharing
      summary: /v1/ops/resource/share/list
      description: |
        Call this endpoint to get the list of shared resources. Returns only resources that were accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resourceTypes:
                  type: array
                  items:
                    type: string
                    enum:
                      - FILE
                      - PROMPT
                      - CONVERSATION
                      - APPLICATION
                      - TOOL_SET
                with:
                  type: string
                  enum:
                    - me
                    - others
                  description: |
                    Currently, supported the next options:
                    - `me`: returns shared resources with you.
                    - `others`: returns resources that you have shared with others
                includeUserInfo:
                    type: boolean
                    description: |
                        If true, includes additional user information such as resource owner display name, users who have shared the resource with you, and users with whom you have shared the resource.
                    default: false
            examples:
              Example:
                value:
                  resourceTypes:
                    - FILE
                    - PROMPT
                    - CONVERSATION
                    - APPLICATION
                    - TOOL_SET
                  with: me
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  resources:
                    type: array
                    items:
                      type: object
                      properties:
                        nodeType:
                          type: string
                        resourceType:
                          type: string
                        bucket:
                          type: string
                        parentPath:
                          type: string
                        name:
                          type: string
                        url:
                          type: string
                        permissions:
                          description: |
                            Lists the permissions you have on the resource if `with` is set to "me".
                            Lists the permissions you have granted to others if `with` is set to "others".
                          type: array
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                              - SHARE
                        author:
                          description: |
                            Resource owner display name (a configurable claim from JWT or a project name for API keys). The field is populated if `with` is set to "me" and `includeUserInfo` is true.
                          type: string
                        sharedBy:
                          description: |
                            A list of users who have shared the resource with you. The field is populated if `with` is set to "me" and `includeUserInfo` is true.
                          type: array
                          items:
                            type: object
                            properties:
                              user:
                                description: User display name (a configurable claim from JWT or a project name for API keys).
                                type: string
                              acceptedAt:
                                description: The timestamp when the shared resource has been accepted.
                                type: integer
                              permissions:
                                description: A list of permissions granted by the user.
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - READ
                                    - WRITE
                                    - SHARE
                        sharedWith:
                          description: |
                            A list of users with whom you have shared the resource. The field is populated if `with` is set to "others" and `includeUserInfo` is true.
                          type: array
                          items:
                            type: object
                            properties:
                                user:
                                  description: User display name (a configurable claim from JWT or a project name for API keys).
                                  type: string
                                permissions:
                                  description: A list of permissions granted to the user.
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - READ
                                      - WRITE
                                      - SHARE
                        shareCredentials:
                          type: boolean
                          description: Indicates whether global resource credentials were shared with user.
                          default: false
              examples:
                Example:
                  value:
                    resources:
                      - nodeType: ITEM
                        resourceType: PROMPT
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        parentPath: folder1/folder2
                        name: prompt_name
                        url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                        permissions:
                          - WRITE
                      - nodeType: ITEM
                        resourceType: FILE
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        parentPath: folder1
                        name: image.png
                        url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png
                        permissions:
                          - READ
                        author: user_2
                        sharedBy:
                          - user: user_1
                            acceptedAt: 1707874031765
                            permissions:
                              - READ
                          - user: user_2
                            acceptedAt: 1707875031765
                            permissions:
                              - WRITE
                      - nodeType: ITEM
                        resourceType: TOOL_SET
                        bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                        parentPath: folder1
                        name: my-toolset
                        url: toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/my-toolset
                        shareCredentials: true
                        permissions:
                          - READ
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/share/list \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resourceTypes": ["FILE", "PROMPT", "CONVERSATION"],
                "with": "me",
                "includeUserInfo": true
              }'
  /v1/ops/resource/share/revoke:
    post:
      operationId: revokeSharedResources
      tags:
        - Sharing
      summary: /v1/ops/resource/share/revoke
      description: |
        Call this endpoint to revoke shared access from all users.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to revoke.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to revoke.
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                    - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/share/revoke \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name"
                  },
                  {
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png"
                  }
                ]
              }'
  /v1/ops/resource/share/discard:
    post:
      operationId: discardSharedResources
      tags:
        - Sharing
      summary: /v1/ops/resource/share/discard
      description: |
        Call this endpoint to discard the resource shared with you.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to discard.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to discard.
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                    - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/share/discard \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name"
                  },
                  {
                    "url": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png"
                  }
                ]
              }'
  /v1/ops/resource/share/copy:
      post:
        operationId: copySharedResources
        tags:
          - Sharing
        summary: /v1/ops/resource/share/copy
        description: |
          Call this endpoint to share the *destination* resource with users who have access to the *source* resource. Note, user's permissions will be copied from a source to a destination.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  sourceUrl:
                    type: string
                    description: The relative URL of the original resource where user's permissions will be copied from.
                  destinationUrl:
                    type: string
                    description: The relative URL of the original resource where user's permissions will be copied to.
              examples:
                Example:
                  value:
                    sourceUrl: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                    destinationUrl: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
        responses:
          '200':
            description: Success
          '401':
            description: Invalid Authentication
        x-codeSamples:
          - lang: 'cURL'
            label: 'CURL'
            source: |
              curl -X POST https://chat.<company>.com/v1/ops/resource/share/copy \
                -H "Api-Key: DIAL_API_KEY" \
                -d '{
                      "sourceUrl": "conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/conversation_name",
                      "destinationUrl": "files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file_name",
                      }'

  /v1/invitations:
    get:
      operationId: getInvitations
      tags:
        - Sharing
      summary: /v1/invitations
      description: |
        Call this endpoint to get the list of your active invitations.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  invitations:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        author:
                          type: string
                        resources:
                          type: array
                          items:
                            type: object
                            properties:
                              url:
                                type: string
                                description: A relative url of the resource.
                              author:
                                description: Resource owner display name (a configurable claim from JWT or a project name for API keys).
                                type: string
                              permissions:
                                description: Lists of permissions to be granted.
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - READ
                                    - WRITE
                                    - SHARE
                              shareCredentials:
                                type: boolean
                                description: Indicates whether global resource credentials was shared with user.
                                default: false
                        createdAt:
                          type: integer
                        expireAt:
                          type: integer
              examples:
                Example:
                  value:
                    invitations:
                      - id: 2818T2YRgFaMt8YW176ix7f3adFjxBx5TMQbzmnxgRGNPbDtctJ1wwGkigG78YU6juKnUKRWPNAt1f8Cna5Do7X48FnXwHs5MutEpefm6jTuMQ
                        resources:
                          - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                            author: user_1
                            permissions:
                              - READ
                            shareCredentials: false
                          - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png
                            author: user_1
                            permissions:
                              - READ
                              - WRITE
                            shareCredentials: false
                          - url: toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/my-toolset
                            author: user_1
                            permissions:
                              - READ
                            shareCredentials: true
                          - url: credentials/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/my-toolset
                            author: user_1
                            permissions:
                              - READ
                            shareCredentials: false
                        createdAt: 1707874031765
                        expireAt: 1708133231765
                        author: the name of the author of the invitation request
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/invitations \
              -H "Api-Key: DIAL_API_KEY"
  /v1/invitations/{invitation_id}:
    get:
      operationId: getInvitation
      tags:
        - Sharing
      summary: /v1/invitations/{invitation_id}
      description: |
        Call this endpoint to get the invitation details or accept the invitation.
      parameters:
        - in: path
          name: invitation_id
          schema:
            type: string
          required: true
        - in: query
          name: accept
          schema:
            type: boolean
          description: Requests with `accept=true` accept an invitation.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  author:
                    type: string
                  resources:
                    type: array
                    description: An array of shared resources.
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                          description: A relative url of the shared resource.
                        permissions:
                          type: array
                          description: Lists the permissions you have on the resource.
                          items:
                            type: string
                            enum:
                              - READ
                              - WRITE
                              - SHARE
                        shareCredentials:
                          type: boolean
                          description: Indicates whether global resource credentials was shared with user.
                          default: false
                  createdAt:
                    type: integer
                  expireAt:
                    type: integer
              examples:
                Example:
                  value:
                    id: 2818T2YRgFaMt8YW176ix7f3adFjxBx5TMQbzmnxgRGNPbDtctJ1wwGkigG78YU6juKnUKRWPNAt1f8Cna5Do7X48FnXwHs5MutEpefm6jTuMQ
                    resources:
                      - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                        permissions:
                          - READ
                        shareCredentials: false
                      - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/image.png
                        permissions:
                          - READ
                        shareCredentials: false
                      - url: toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/my-toolset
                        permissions:
                          - READ
                        shareCredentials: true
                      - url: credentials/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/toolsets/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/my-toolset
                        permissions:
                          - READ
                        shareCredentials: false
                    createdAt: 1707874031765
                    expireAt: 1708133231765
                    author: the name of the author of the invitation request
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/invitations/2818T2Y...pefm6jTuMQ \
              -H "Api-Key: DIAL_API_KEY"
        - lang: 'cURL'
          label: 'CURL (Accept)'
          source: |
            curl -X GET https://chat.<company>.com/v1/invitations/2818T2Y...pefm6jTuMQ?accept=true \
              -H "Api-Key: DIAL_API_KEY"
    delete:
      operationId: deleteInvitation
      tags:
        - Sharing
      summary: /v1/invitations/{invitation_id}
      description: |
        Call this endpoint to revoke the invitation.
      parameters:
        - in: path
          name: invitation_id
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Success
        '401':
          description: Invalid Authentication
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X DELETE https://chat.<company>.com/v1/invitations/2818T2Y...pefm6jTuMQ \
              -H "Api-Key: DIAL_API_KEY"
  /v1/ops/notification/list:
      post:
        operationId: getNotifications
        tags:
          - Notifications
        summary: /v1/ops/notification/list
        description: Call this endpoint to get a list of notifications. Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/notifications#notification-api) for more details on how to work with notifications.
        responses:
          '200':
            description: Success
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/NotificationsResponse'
                examples:
                  Example:
                    value:
                      notifications:
                        - id: 5a0bc26f-787a-4dae-8d7b-617e11a2fe31
                          url: publications/3CcedGxCx23EwiV/0123
                          type: PUBLICATION
                          message: Your request has been approved by admin
                          timestamp: 1723218135157
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/notification/delete:
      post:
        operationId: deleteNotifications
        tags:
          - Notifications
        summary: /v1/ops/notification/delete
        description: Call this endpoint to delete one or more than one notification.
        requestBody:
          required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  ids:
                    type: array
                    description: Notification identifiers.
                    items:
                      type: string
              examples:
                Example:
                  value:
                    ids:
                      - 5a0bc26f-787a-4dae-8d7b-617e11a2fe32
                      - 5a0bc26f-787a-4dae-8d7b-617e11a2fe31
        responses:
          '200':
            description: Success
          '400':
            description: Bad request
          '401':
            description: Invalid Authentication
          '403':
            description: Forbidden
          '500':
            description: The server had an error while processing your request
  /v1/ops/resource/subscribe:
    post:
      operationId: subscribeToResources
      tags:
        - Notifications
      summary: /v1/ops/resource/subscribe
      description: |
        Use this endpoint to subscribe to resource updates. Refer to [Documentation](https://docs.dialx.ai/tutorials/developers/work-with-resources/notifications#subscribe-api) for more details on how to work with subscriptions.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                resources:
                  type: array
                  description: An array of resources to subscribe to.
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: |
                          A relative url of the resource to subscribe to.
            examples:
              Example:
                value:
                  resources:
                    - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                    - url: conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/conversation
                    - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/image.png
      responses:
        '200':
          description: Success
          content:
            text/event-stream:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    url:
                      type: string
                    action:
                      type: string
                      enum:
                        - CREATE
                        - UPDATE
                        - DELETE
                    timestamp:
                      type: integer
              examples:
                Event Streaming:
                  value:
                    - url: prompts/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/prompt_name
                      action: CREATE
                      timestamp: 1722463025552
                    - url: conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/conversation
                      action: UPDATE
                      timestamp: 1722463025552
                    - url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/image.png
                      action: DELETE
                      timestamp: 1722463025552
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: The server had an error while processing your request.
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/resource/subscribe \
              -H "Content-Type: application/json" \
              -H "Api-Key: DIAL_API_KEY" \
              -d '{
                "resources": [
                  {
                    "url": "conversations/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder/conversation"
                  }
                ]
              }'
  /v1/ops/code_interpreter/open_session:
    post:
      operationId: openSession
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/open_session
      description: Call this endpoint to open session for code interpreter application
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  type: string
                  description: session id.
            examples:
              ExampleUser:
                value:
                  sessionId: "3CcedGxCx23EwiVbV"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
              examples:
                Session:
                  value:
                    sessionId: 3CcedGxCx23EwiVbV
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/close_session:
    post:
      operationId: closeSession
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/close_session
      description: Call this endpoint to close session for code interpreter application
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  type: string
                  description: session id.
            examples:
              ExampleUser:
                value:
                  sessionId: "3CcedGxCx23EwiVbV"
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    type: string
              examples:
                Session:
                  value:
                    sessionId: 3CcedGxCx23EwiVbV
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/execute_code:
    post:
      operationId: executeCode
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/execute_code
      description: Call this endpoint to execute code by code interpreter application
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  type: string
                  description: session id.
                code:
                  description: code to be executed
                  type: string
                inputFiles:
                  $ref: '#/components/schemas/CodeInterpreterRequestFile'
                outputFiles:
                  $ref: '#/components/schemas/CodeInterpreterRequestFile'
            examples:
              ExecuteCode:
                value:
                  sessionId: "3CcedGxCx23EwiVbV"
                  code: |-
                    some Python code could be inserted here

      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  stdout:
                    type: string
                  stderr:
                    type: string
                  result:
                    type: object
                  display:
                    type: object
              examples:
                CodeExecuteResponse:
                  value:
                    status: completed
                    stdout: Application is completed
                    result:
                      success: true
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/upload_file:
    post:
      operationId: uploadFileToCodeInterpreter
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/upload_file
      description: Call this endpoint to upload file to code interpreter container
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: |
                    A part of multipart/form-data request
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeInterpreterFile'
              examples:
                UploadFile:
                  value:
                    sessionId: 2e2e329dided
                    path: files/21jen1j12e/myfile.txt
                    size: 512
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/download_file:
    post:
      operationId: downloadFileFromCodeInterpreter
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/download_file
      description: Call this endpoint to download file from code interpreter container
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CodeInterpreterFile'
      responses:
        '200':
          description: Success
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
              examples:
                Example:
                  value:
                    "<Binary File Content>"
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/list_files:
    post:
      operationId: listFilesFromCodeInterpreter
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/list_files
      description: Call this endpoint to list files from code interpreter container
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                sessionId:
                  type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                properties:
                  files:
                    type: array
                    items:
                      $ref: '#/components/schemas/CodeInterpreterFile'
              examples:
                UploadFile:
                  value:
                    files:
                      - sessionId: 2e2e329dided
                        path: files/21jen1j12e/myfile.txt
                        size: 512
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/transfer_input_file:
    post:
      operationId: transferInputFile
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/transfer_input_file
      description: Call this endpoint to transfer file from Core storage to code interpreter container
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CodeInterpreterRequestFile'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeInterpreterFile'
              examples:
                UploadFile:
                  value:
                      sessionId: 2e2e329dided
                      path: files/21jen1j12e/myfile.txt
                      size: 512
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request
  /v1/ops/code_interpreter/transfer_output_file:
    post:
      operationId: transferOutputFile
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/transfer_output_file
      description: Call this endpoint to transfer file from code interpreter container to Core storage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CodeInterpreterRequestFile'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  parentPath:
                    type: string
                  bucket:
                    type: string
                  url:
                    type: string
                  etag:
                    type: string
                  nodeType:
                    type: string
                  resourceType:
                    type: string
                  createdAt:
                    type: integer
                  updatedAt:
                    type: integer
                  contentLength:
                    type: integer
                  contentType:
                    type: string
                  permissions:
                    type: array
                    items:
                      type: string
                      enum:
                        - READ
                        - WRITE
              examples:
                File:
                  value:
                    name: file.png
                    parentPath: folder1/folder2
                    bucket: 3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST
                    url: files/3CcedGxCx23EwiVbVmscVktScRyf46KypuBQ65miviST/folder1/folder2/file.png
                    nodeType: ITEM
                    resourceType: FILE
                    etag: 7dfb93c3c62b88e9a75ff36a6af6c7eb
                    updatedAt: 1707876435000
                    createdAt: 1707876435000
                    contentLength: 128630
                    contentType: image/png
                    permissions:
                      - READ
                      - WRITE
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '500':
          description: The server had an error while processing your request

  /v1/ops/code_interpreter/get_session:
    post:
      operationId: getSession
      tags:
        - Code interpreter
      summary: /v1/ops/code_interpreter/get_session
      description: Call this endpoint to get a session description. Note, this API does not reset TTL for a session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  type: string
                  description: session id.
            examples:
              Example:
                value:
                  sessionId: "123456"
      responses:
        '200':
          description: Session is alive
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSession'
              examples:
                GetSession:
                  value:
                      sessionId: "123456"
        '400':
          description: Bad request
        '401':
          description: Invalid Authentication
        '403':
          description: Forbidden
        '404':
          description: Session is not found
        '500':
          description: The server had an error while processing your request

  /v1/deployments:
    get:
      operationId: getDeploymentsByInterfaceType
      tags:
        - Deployment listing
      summary: /v1/deployments
      description: |
        Call this endpoint to get basic details about the available deployments of all types (AI models, applications, toolsets) filtered by the interface type.
      parameters:
        - name: interface_type
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - chat
                - embeddings
                - mcp
                - custom_ui
                - all
          description: Filter deployments by the interface types they support. Can accept multiple values as comma-separated list or array. <br> `chat` - Deployments that expose chat-based interfaces. This includes the OpenAI-compatible chat completion interface and Responses API. Matches models with `chat` type and applications with `dial:applicationTypeCompletionEndpoint`. Never includes toolsets. <br> `embedding` - Deployments that expose embedding endpoints. Matches only models with `embedding` type. Never includes applications and toolsets. <br> `mcp` - Deployments that expose MCP (Model Context Protocol) interface (toolsets and applications with `dial:applicationTypeMcp`). Never includes models. <br> `custom_ui` - Deployments that expose custom UI interfaces (applications with `dial:applicationTypeViewerUrl`). Never includes models and toolsets. <br> `all` - Include all deployments regardless of interface type (default behavior if parameter is omitted). 

          required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployments'
              examples:
                DeploymentsSample:
                  value:
                    {
                      "deployments": [
                        {
                            "id": "text-embedding-ada-002",
                            "model": "text-embedding-ada-002",
                            "interfaces":[
                              "embedding"
                            ],
                            "display_name": "Embedding Ada",
                            "icon_url": "https://chat.<company>.com/ada.svg",
                            "description": "Symmetrical embedding model.",
                            "owner": "organization-owner",
                            "object": "model",
                            "status": "succeeded",
                            "created_at": 1672534800,
                            "updated_at": 1672534800,
                            "lifecycle_status": "generally-available",
                            "capabilities": {
                              "scale_types": [
                                "standard"
                              ],
                              "completion": false,
                              "chat_completion": false,
                              "embeddings": true,
                              "fine_tune": false,
                              "inference": false
                            },
                        },
                        {
                          "id": "gpt-world",
                          "application": "gpt-world",
                          "interfaces":[
                            "chat",
                            "custom_ui"
                          ],
                          "display_name": "GPT World",
                          "icon_url": "https://chat.<company>.com/gpt_world.svg",
                          "description": "This application producing answer based on the curated set of LLM related publications.\\n\\nThe source of publications is [arxiv.org](https://arxiv.org/). GPT World is classic example of conversational semantic search application.\\nOn every new user question, it performs summarization using GPT-4, calculates embedding using text-embedding-ada-002 model and then it uses chunks of text from curated set.\\n\\nThis is DIAL version of the [original demo](https://deltix.io/interactive-gpt-world-map.html) with [TSNE map](https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding).",
                          "owner": "organization-owner",
                          "object": "application",
                          "status": "succeeded",
                          "created_at": 1672534800,
                          "updated_at": 1672534800
                        },
                        {
                          "id": "toolsets/encrypted-bucket/folder/toolset-name",
                          "toolset": "toolsets/encrypted-bucket/folder/toolset-name",
                          "interfaces":[
                            "mcp"
                          ],
                          "display_name": "Toolset display name",
                          "display_version": "0.0.1",
                          "description": "My toolset description",
                          "icon_url": "http://toolset/icon.svg",
                          "owner": "Owner's name",
                          "object": "toolset",
                          "status": "succeeded",
                          "description_keywords": [
                          "keyword1",
                          "keyword2"
                          ],
                          "reference": "ff5584b7-a82b-4f4f-bf42-5bf74a3893d6",
                          "max_retry_attempts": 2,
                          "created_at": 1672534800,
                          "updated_at": 1672534900,
                          "transport": "HTTP",
                          "allowed_tools": [
                          "tool1",
                          "tool2"
                          ],
                          "auth_settings": {
                          "authentication_type": "OAUTH",
                          "client_id": "my-client-id",
                          "redirect_uri": "https://myapp.com/toolset/sign-in",
                          "authorization_endpoint": "https://authserver.com/authorize",
                          "token_endpoint": "https://authserver.com/token",
                          "code_challenge_method": "S256",
                          "scopes_supported": [
                          "scope1",
                          "scope2"
                          ],
                          "global_auth_status": "SIGNED_OUT",
                          "user_level_auth_status": "SIGNED_OUT"
                          }
                        }
                      ]
                    }

        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/deployments?interface_type={interface_type} \
              -H "Api-Key: DIAL_API_KEY"

  /openai/deployments:
    get:
      operationId: getDeployments
      tags:
        - Deployment listing
      summary: /openai/deployments
      description: |
        Call this endpoint to get basic details about the available deployments.
        The response contains model objects (same as `/openai/models`).
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: An array of models.
                    items:
                      $ref: '#/components/schemas/ModelOpenAi'
              examples:
                DeploymentsSample:
                  value:
                    data:
                      - id: text-embedding-ada-002
                        model: text-embedding-ada-002
                        display_name: Embedding Ada
                        icon_url: https://chat.<company>.com/ada.svg
                        description: Symmetrical embedding model.
                        owner: organization-owner
                        object: model
                        status: succeeded
                        created_at: 1672534800
                        updated_at: 1672534800
                        lifecycle_status: generally-available
                        capabilities:
                          scale_types:
                            - standard
                          completion: false
                          chat_completion: false
                          embeddings: true
                          fine_tune: false
                          inference: false
                        features:
                          rate: false
                          mcp: true
                          tokenize: false
                          truncate_prompt: false
                          configuration: false
                          system_prompt: false
                          tools: false
                          seed: false
                          url_attachments: false
                          folder_attachments: false
                      - id: gpt-4
                        model: gpt-4
                        display_name: GPT 4
                        icon_url: https://chat.<company>.com/openai.svg
                        description: Chat completion model.
                        owner: organization-owner
                        object: model
                        status: succeeded
                        created_at: 1672534800
                        updated_at: 1672534800
                        lifecycle_status: generally-available
                        capabilities:
                          scale_types:
                            - standard
                          completion: false
                          chat_completion: true
                          embeddings: false
                          fine_tune: false
                          inference: false
                        features:
                          rate: true
                          mcp: true
                          tokenize: true
                          truncate_prompt: true
                          configuration: false
                          system_prompt: true
                          tools: true
                          seed: true
                          url_attachments: true
                          folder_attachments: false
                        defaults:
                          max_tokens: 1024
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/deployments \
              -H "Api-Key: DIAL_API_KEY"
  /openai/deployments/{deployment_name}:
    get:
      operationId: getDeployment
      tags:
        - Deployment listing
      summary: /openai/deployments/{deployment_name}
      description: |
        Call this endpoint to get information about a model by its deployment name.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelOpenAi'
              examples:
                DeploymentsSample:
                  value:
                    id: gpt-4
                    model: gpt-4
                    display_name: GPT 4
                    icon_url: https://chat.<company>.com/openai.svg
                    description: Chat completion model.
                    owner: organization-owner
                    object: model
                    status: succeeded
                    created_at: 1672534800
                    updated_at: 1672534800
                    lifecycle_status: generally-available
                    capabilities:
                      scale_types:
                        - standard
                      completion: false
                      chat_completion: true
                      embeddings: false
                      fine_tune: false
                      inference: false
                    features:
                      rate: true
                      mcp: true
                      tokenize: true
                      truncate_prompt: true
                      configuration: false
                      system_prompt: true
                      tools: true
                      seed: true
                      url_attachments: true
                      folder_attachments: false
                    defaults:
                      max_tokens: 1024
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/deployments/gpt-4 \
              -H "Api-Key: DIAL_API_KEY"
  /openai/models:
    get:
      operationId: getModels
      tags:
        - Deployment listing
      summary: /openai/models
      description: |
        Call this endpoint to get extended details about the available models.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: An array of models.
                    items:
                      $ref: '#/components/schemas/ModelOpenAi'
              examples:
                ModelsSample:
                  value:
                    data:
                      - id: text-embedding-ada-002
                        model: text-embedding-ada-002
                        display_name: Embedding Ada
                        icon_url: https://chat.<company>.com/ada.svg
                        description: Symmetrical embedding model.
                        owner: organization-owner
                        object: model
                        status: succeeded
                        created_at: 1672534800
                        updated_at: 1672534800
                        lifecycle_status: generally-available
                        capabilities:
                          scale_types:
                            - standard
                          completion: false
                          chat_completion: false
                          embeddings: true
                          fine_tune: false
                          inference: false
                      - id: gpt-4
                        model: gpt-4
                        display_name: GPT 4
                        icon_url: https://chat.<company>.com/openai.svg
                        description: Chat completion model.
                        owner: organization-owner
                        object: model
                        status: succeeded
                        created_at: 1672534800
                        updated_at: 1672534800
                        lifecycle_status: generally-available
                        capabilities:
                          scale_types:
                            - standard
                          completion: false
                          chat_completion: true
                          embeddings: false
                          fine_tune: false
                          inference: false
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/models \
              -H "Api-Key: DIAL_API_KEY"
  /openai/models/{model_name}:
    get:
      operationId: getModel
      tags:
        - Deployment listing
      summary: /openai/models/{model_name}
      description: |
        Call this endpoint to get an extended information about a model by its name.
      parameters:
        - name: model_name
          in: path
          schema:
            type: string
          description: The name of the model.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/ModelOpenAi'
              examples:
                ModelsSample:
                  value:
                    id: gpt-4
                    model: gpt-4
                    display_name: GPT 4
                    icon_url: https://chat.<company>.com/openai.svg
                    description: Chat completion model.
                    owner: organization-owner
                    object: model
                    status: succeeded
                    created_at: 1672534800
                    updated_at: 1672534800
                    lifecycle_status: generally-available
                    capabilities:
                      scale_types:
                        - standard
                      completion: false
                      chat_completion: true
                      embeddings: false
                      fine_tune: false
                      inference: false
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/models/gpt-4 \
              -H "Api-Key: DIAL_API_KEY"
  /openai/applications:
    get:
      operationId: getApplications
      tags:
        - Deployment listing
      summary: /openai/applications
      description: Call this endpoint to get extended details about the available Applications.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: An array of Applications.
                    items:
                      $ref: '#/components/schemas/ApplicationOpenAi'
              examples:
                ApplicationsSample:
                  value:
                    data:
                      - id: gpt-world
                        application: gpt-world
                        display_name: GPT World
                        icon_url: https://chat.<company>.com/gpt_world.svg
                        description: This application producing answer based on the curated set of LLM related publications.\n\nThe source of publications is [arxiv.org](https://arxiv.org/). GPT World is classic example of conversational semantic search application.\nOn every new user question, it performs summarization using GPT-4, calculates embedding using text-embedding-ada-002 model and then it uses chunks of text from curated set.\n\nThis is DIAL version of the [original demo](https://deltix.io/interactive-gpt-world-map.html) with [TSNE map](https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding).
                        owner: organization-owner
                        object: application
                        status: succeeded
                        created_at: 1672534800
                        updated_at: 1672534800
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/applications \
              -H "Api-Key: DIAL_API_KEY"
  /openai/applications/{application_name}:
    get:
      operationId: getApplication
      tags:
        - Deployment listing
      summary: /openai/applications/{application_name}
      description: |
        Call this endpoint to get extended information about an Application by its name.
      parameters:
        - name: application_name
          in: path
          schema:
            type: string
          description: The name of the Application.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/ApplicationOpenAi'
              examples:
                ApplicationsSample:
                  value:
                    id: gpt-world
                    application: gpt-world
                    display_name: GPT World
                    icon_url: https://chat.<company>.com/gpt_world.svg
                    description: This application producing answer based on the curated set of LLM related publications.\n\nThe source of publications is [arxiv.org](https://arxiv.org/). GPT World is classic example of conversational semantic search application.\nOn every new user question, it performs summarization using GPT-4, calculates embedding using text-embedding-ada-002 model and then it uses chunks of text from curated set.\n\nThis is DIAL version of the [original demo](https://deltix.io/interactive-gpt-world-map.html) with [TSNE map](https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding).
                    owner: organization-owner
                    object: application
                    status: succeeded
                    created_at: 1672534800
                    updated_at: 1672534800
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/applications/gpt-world \
              -H "Api-Key: DIAL_API_KEY"
  /openai/toolsets:
    get:
      operationId: getToolSets
      tags:
        - Deployment listing
      summary: /openai/toolsets
      description: Call this endpoint to get extended details about the available toolsets.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: An array of toolsets.
                    items:
                      $ref: '#/components/schemas/ToolsetOpenAi'
              examples:
                ToolsetsSamples:
                  value:
                    data:
                      - id: toolsets/encrypted-bucket/folder/toolset-name
                        toolset: toolsets/encrypted-bucket/folder/toolset-name
                        display_name: Toolset display name
                        display_version: 0.0.1
                        description: My toolset description
                        icon_url: http://toolset/icon.svg
                        owner: Owner's name
                        object: toolset
                        status: succeeded
                        description_keywords:
                          - keyword1
                          - keyword2
                        reference: ff5584b7-a82b-4f4f-bf42-5bf74a3893d6
                        max_retry_attempts: 2
                        created_at: 1672534800
                        updated_at: 1672534900
                        transport: HTTP
                        allowed_tools:
                          - tool1
                          - tool2
                        auth_settings:
                          authentication_type: OAUTH
                          client_id: my-client-id
                          redirect_uri: https://myapp.com/toolset/sign-in
                          authorization_endpoint: https://authserver.com/authorize
                          token_endpoint: https://authserver.com/token
                          code_challenge_method: S256
                          scopes_supported: [ scope1, scope2 ]
                          global_auth_status: SIGNED_OUT
                          user_level_auth_status: SIGNED_OUT
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/toolsets \
              -H "Api-Key: DIAL_API_KEY"

  /openai/toolsets/{toolset_name}:
    get:
      operationId: getToolset
      tags:
        - Deployment listing
      summary: /openai/toolsets/{toolset_name}
      description: Call this endpoint to get an extended information about a specific toolset by name
      parameters:
        - name: toolset_name
          in: path
          schema:
            type: string
          description: The name of the toolset.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/ToolsetOpenAi'
              examples:
                ToolsetSamples:
                  value:
                      id: toolsets/encrypted-bucket/folder/toolset-name
                      toolset: toolsets/encrypted-bucket/folder/toolset-name
                      display_name: Toolset display name
                      display_version: 0.0.1
                      description: My toolset description
                      icon_url: http://toolset/icon.svg
                      owner: Owner's name
                      object: toolset
                      status: succeeded
                      description_keywords:
                        - keyword1
                        - keyword2
                      reference: ff5584b7-a82b-4f4f-bf42-5bf74a3893d6
                      max_retry_attempts: 2
                      created_at: 1672534800
                      updated_at: 1672534900
                      transport: HTTP
                      allowed_tools:
                        - tool1
                        - tool2
                      auth_settings:
                        authentication_type: OAUTH
                        client_id: my-client-id
                        redirect_uri: https://myapp.com/toolset/sign-in
                        authorization_endpoint: https://authserver.com/authorize
                        token_endpoint: https://authserver.com/token
                        code_challenge_method: S256
                        scopes_supported: [ scope1, scope2 ]
                        global_auth_status: SIGNED_OUT
                        user_level_auth_status: SIGNED_OUT
        '401':
          description: Invalid Authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl https://chat.<company>.com/openai/toolsets/my-toolset \
              -H "Api-Key: DIAL_API_KEY"

  /v1/deployments/{deployment_name}/limits:
    get:
      operationId: getDeploymentLimits
      tags:
        - Limits
      summary: /v1/deployments/{deployment_name}/limits
      description: |
        Call this endpoint to get information about spent limits for a given deployment.
      parameters:
        - name: deployment_name
          in: path
          schema:
            type: string
          description: The name of the deployment.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  hourRequestStats:
                    type: object
                    description: Statistics for requests per hour.
                    properties:
                      total:
                        description: Total number of requests allowed per hour.
                        type: integer
                      used:
                        description: Number of requests used in the current hour.
                        type: integer
                  dayRequestStats:
                    type: object
                    description: Statistics for requests per day.
                    properties:
                      total:
                        description: Total number of requests allowed per day.
                        type: integer
                      used:
                        description: Number of requests used in the current day.
                        type: integer
                  minuteTokenStats:
                    type: object
                    description: Statistics for tokens per minute.
                    properties:
                      total:
                        description: Total number of tokens allowed per minute.
                        type: integer
                      used:
                        description: Number of tokens used in the current minute.
                        type: integer
                  dayTokenStats:
                    type: object
                    description: Statistics for tokens per day.
                    properties:
                      total:
                        description: Total number of tokens allowed per day.
                        type: integer
                      used:
                        description: Number of tokens used in the current day.
                        type: integer
                  weekTokenStats:
                    type: object
                    description: Statistics for tokens per week.
                    properties:
                      total:
                        description: Total number of tokens allowed per week.
                        type: integer
                      used:
                        description: Number of tokens used in the current week.
                        type: integer
                  monthTokenStats:
                    type: object
                    description: Statistics for tokens per month.
                    properties:
                      total:
                        description: Total number of tokens allowed per month.
                        type: integer
                      used:
                        description: Number of tokens used in the current month.
                        type: integer
                  minuteCostStats:
                    type: object
                    description: Statistics for cost per minute.
                    properties:
                      total:
                        description: Total cost allowed per minute.
                        type: number
                      used:
                        description: Cost used in the current minute.
                        type: number
                  dayCostStats:
                    type: object
                    description: Statistics for cost per day.
                    properties:
                      total:
                        description: Total cost allowed per day.
                        type: number
                      used:
                        description: Cost used in the current day.
                        type: number
                  weekCostStats:
                    type: object
                    description: Statistics for cost per week.
                    properties:
                      total:
                        description: Total cost allowed per week.
                        type: number
                      used:
                        description: Cost used in the current week.
                        type: number
                  monthCostStats:
                    type: object
                    description: Statistics for cost per month.
                    properties:
                      total:
                        description: Total cost allowed per month.
                        type: number
                      used:
                        description: Cost used in the current month.
                        type: number
              examples:
                Example:
                  value:
                    "hourRequestStats":
                      "total": 10
                      "used": 5
                    "dayRequestStats":
                      "total": 100
                      "used": 10
                    "minuteTokenStats":
                      "total": 1000
                      "used": 100
                    "dayTokenStats":
                      "total": 10000
                      "used": 4000
                    "weekTokenStats":
                      "total": 50000
                      "used": 20000
                    "monthTokenStats":
                      "total": 200000
                      "used": 80000
                    "minuteCostStats":
                      "total": 0.069
                      "used": 0.001
                    "dayCostStats":
                      "total": 100.00
                      "used": 10.00
                    "weekCostStats":
                      "total": 500.00
                      "used": 100.00
                    "monthCostStats":
                      "total": 20000.00
                      "used": 1000.00
        '401':
          description: Invalid Authentication
        '404':
          description: Limit not found
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/deployments/gpt-4/limits \
              -H "Api-Key: DIAL_API_KEY"
  /v1/ops/config/reload:
    post:
      operationId: reloadConfig
      tags:
        - Config
      summary: /v1/ops/config/reload
      description: |
        Call this endpoint to reload [DIAL Core configuration](https://github.com/epam/ai-dial-core).

        <b>Allowed for admin users only</b>!
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: string
              examples:
                Example:
                  value: |
                    {
                      "roles": {"default": {"limits": {"chat-gpt-35-turbo": {"minute":"100000", "day":"10000000"}}}}
                    }
        '403':
          description: Forbidden
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/config/reload \
              -H "Api-Key: DIAL_API_KEY"

  /v1/consent/{deployment_id}:
    get:
      operationId: requestUserConsent
      tags:
        - User Consent
      summary: /v1/consent/{deployment_id}
      description: |
        Call this endpoint to get a user's consent for the deployment id. Refer to [DIAL documentation](https://docs.dialx.ai/tutorials/developers/apps-development/auth-matrix#dial-api) to learn more about consent forms and Auth Matrix.
      parameters:
        - name: deployment_id
          in: path
          schema:
            type: string
          description: The unique identifier of the deployment.
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewConsentResponse'
        '403':
          description: Forbidden
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X GET https://chat.<company>.com/v1/consent/{deployment_id} \
              -H "Api-Key: DIAL_API_KEY"
    post:
      operationId: acceptUserConsent
      tags:
        - User Consent
      summary: /v1/consent/{deployment_id}
      description: |
        Call this endpoint to accept user's consent for the deployment id.
      parameters:
        - name: deployment_id
          in: path
          schema:
            type: string
          description: The unique identifier of the deployment.
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptConsentRequest'
      responses:
        '200':
          description: Success
        '403':
          description: Forbidden
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/consent/{deployment_id} \
              -H "Api-Key: DIAL_API_KEY"
  /v1/ops/client-channel/subscribe:
    post:
      operationId: subscribeOnClientChannel
      tags:
        - Client channel
      summary: /v1/ops/client-channel/subscribe
      description: |
        **Note**: This endpoint is in PREVIEW - it can be removed or modified in nearest future. Call this endpoint to get subscription on events from client channel. 
      parameters:
          - name: X-DIAL-CLIENT-CHANNEL-ID
            in: header
            required: false
            schema:
              type: string
            description: Client channel ID. The client should provide the header in case of reconnect.
      responses:
        '200':
          description: Success
          headers:
            X-DIAL-CLIENT-CHANNEL-ID:
              description: |
                Client channel ID. **Note**: The header is optional and is passed in the response only if provided in the request.
              schema:
                type: string
          content:
            text/event-stream:
              schema:
                type: string
                description: |
                  Server-Sent Events stream. Data is sent as a sequence of
                  heartbeat comments / "data:" lines separated by blank lines.
              examples:
                rpcRequestStream:
                  summary: Example of SSE stream
                  value: |
                    : heartbeat
                    : heartbeat
                    : heartbeat
                    data: {"jsonrpc": "2.0", "method": "toolset/signin", "params": {"toolsetId": "toolsets/public/toolset2"}, "id": "1"}
                    : heartbeat
                    : heartbeat
                    data: {"jsonrpc": "2.0", "method": "toolset/signin", "params": {"toolsetId": "toolsets/public/my-toolset"}, "id": "2"}
        '401':
          description: Unauthorized
        '400':
          description: Bad request
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/client-channel/subscribe \
              -H "Api-Key: DIAL_API_KEY"
  /v1/ops/client-channel/unsubscribe:
    post:
      operationId: unsubscribeOnClientChannel
      tags:
        - Client channel
      summary: /v1/ops/client-channel/unsubscribe
      description: |
        **Note**: This endpoint is in PREVIEW - it can be removed or modified in nearest future. Call this endpoint to remove subscription on events from client channel.
      parameters:
        - name: X-DIAL-CLIENT-CHANNEL-ID
          in: header
          required: true
          schema:
            type: string
          description: Client channel ID
      responses:
        '200':
          description: Success
        '401':
          description: Unauthorized
        '404':
          description: Client channel is not found
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/client-channel/unsubscribe \
              -H "Api-Key: DIAL_API_KEY" \
              -H "X-DIAL-CLIENT-CHANNEL-ID: 12345"
  /v1/ops/client-channel/report:
    post:
      operationId: reportResponseToClientChannel
      tags:
        - Client channel
      summary: /v1/ops/client-channel/report
      description: |
        **Note**: This endpoint is in PREVIEW - it can be removed or modified in nearest future. Call this endpoint to report RPC response to client channel.
      parameters:
        - name: X-DIAL-CLIENT-CHANNEL-ID
          in: header
          required: true
          schema:
            type: string
          description: Client channel ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcResponse'
      responses:
        '200':
          description: Success
        '401':
          description: Unauthorized
        '400':
          description: Bad request
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/client-channel/report \
              -H "Api-Key: DIAL_API_KEY" \
              -H "X-DIAL-CLIENT-CHANNEL-ID: 12345"
              -d '{"jsonrpc":"2.0","result":"success","id":"1"}'
  /v1/ops/client-channel/interact:
    post:
      operationId: interactWithClientChannel
      tags:
        - Client channel
      summary: /v1/ops/client-channel/interact
      description: |
        **Note**: This endpoint is in PREVIEW - it can be removed or modified in nearest future. Call this endpoint to send RPC request to client channel and wait for RPC response.
      parameters:
        - name: X-DIAL-CLIENT-CHANNEL-ID
          in: header
          required: true
          schema:
            type: string
          description: Client channel ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              # Single JSON-RPC request or batch
              oneOf:
                - $ref: '#/components/schemas/JsonRpcRequest'
                - type: array
                  items:
                    $ref: '#/components/schemas/JsonRpcRequest'
      responses:
        '200':
          description: Success
          content:
            text/event-stream:
              schema:
                type: string
                description: |
                  Server-Sent Events stream. Data is sent as a sequence of
                  heartbeat comments / "data:" lines separated by blank lines.
              examples:
                rpcResponseStream:
                  summary: Example of SSE stream
                  value: |
                    : heartbeat
                    : heartbeat
                    : heartbeat
                    data: [{"jsonrpc":"2.0","result":"success","id":"1"},{"jsonrpc":"2.0","result":"denied","id":"2"}]
        '401':
          description: Unauthorized
        '400':
          description: Bad request
      x-codeSamples:
        - lang: 'cURL'
          label: 'CURL'
          source: |
            curl -X POST https://chat.<company>.com/v1/ops/client-channel/interact \
              -H "Api-Key: DIAL_API_KEY" \
              -H "X-DIAL-CLIENT-CHANNEL-ID: 12345"
              -d '[{"jsonrpc": "2.0", "method": "toolset/signin", "params": {"toolsetId": "toolsets/public/toolset2"}, "id": "1"},{"jsonrpc": "2.0", "method": "toolset/signin", "params": {"toolsetId": "toolsets/public/my-toolset"}, "id": "2"}]'          

components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: |-
        All API requests must include the API key in the `Api-Key` HTTP header as follows:
        ```bash
        Api-Key: DIAL_API_KEY
        ```
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        Some API requests require additional information about the user's JWT token. In this case, it must be included in the `Authorization` HTTP header as follows:

        <br>

        ```bash
        Authorization: Bearer <JWT>
        ```
  schemas:
    ReviewConsentResponse:
      type: object
      description: Response for reviewing user consent status.
      properties:
        consent:
          $ref: '#/components/schemas/Consent'
        accepted:
          type: boolean
          description: Whether the user has already accepted the consent.

    AcceptConsentRequest:
      type: object
      description: Request body for accepting user consent.
      properties:
        consent:
          $ref: '#/components/schemas/Consent'

    Consent:
      type: object
      description: User consent for deployments. Keys are deployment IDs.
      properties:
        deployments:
          type: object
          additionalProperties:
            type: object
            properties:
              consentRequired:
                type: boolean
                description: Whether the consent is required for the deployment.
    ChatCompletionTool:
      type: object
      properties:
        type:
          type: string
          enum: ["function"]
          description: The type of the tool. Currently, only `function` is supported.
        function:
          $ref: "#/components/schemas/FunctionObject"
        custom_fields:
          $ref: "#/components/schemas/ToolCustomFields"
      required:
        - type
        - function

    ToolCustomFields:
      type: object
      properties:
        cache_breakpoint:
          $ref: "#/components/schemas/CacheBreakpoint"

    CacheBreakpoint:
      type: object
      description: A manual cache breakpoint. The part of the chat completion request up to this breakpoint will be cached by the deployment. Follow-up requests sharing the same prefix have a chance of hitting the cache and reusing the input tokens associated with this prefix. The field only makes sense for the deployments that support [prompt caching](https://docs.dialx.ai/tutorials/developers/prompt-caching).
      properties:
        expire_at:
          type: string
          description: "An optional expiration time for the given cache breakpoint, e.g. '2025-10-02T15:01:23Z'"
          example: '2025-10-02T15:01:23Z'

    FunctionObject:
      type: object
      properties:
        description:
          type: string
          description: A description of what the `function` does, used by the model to choose when and how to call the `function`.
        name:
          type: string
          description: 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.
        parameters:
          $ref: "#/components/schemas/FunctionParameters"
        strict:
          type: boolean
          nullable: true
          default: false
          description: Whether to enable strict schema adherence when generating the `function` call. If set to `true`, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).
      required:
        - name

    FunctionParameters:
      type: object
      description: "The parameters the `function` accepts, described as a JSON Schema object. See the [guide](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. \n\nOmitting `parameters` defines a `function` with an empty parameter list."
    ChatCompletionToolChoiceOption:
      description: |
        Controls which (if any) tool is called by the model.

        `none` means the model will not call any `tool` and instead generates a `message`.

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

        Specifying a particular `tool` via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that `tool`.

        `none` is the default when no `tools` are present.
        `auto` is the default if `tools` are present.
      oneOf:
        - type: string
          description: >
            `none` means the model will not call any `tool` and instead generates a `message`.
            `auto` 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`.
          enum:
            - none
            - auto
            - required
        - $ref: "#/components/schemas/ChatCompletionNamedToolChoice"

    ChatCompletionNamedToolChoice:
      type: object
      description: Specifies a `tool` the model should use. Use to force the model to call a specific `function`.
      properties:
        type:
          type: string
          enum:
            - "function"
          description: The type of the `tool`. Currently, only `function` is supported.
        function:
          type: object
          properties:
            name:
              type: string
              description: The name of the `function` to call.
          required:
            - name
      required:
        - type
        - function

    ParallelToolCalls:
      description: Whether to enable parallel `function` calling during the `tool` use.
      type: boolean
      default: true

    ChatCompletionMessageToolCalls:
      type: array
      description: The `tool` calls generated by the model, such as `function` calls.
      items:
        $ref: "#/components/schemas/ChatCompletionMessageToolCall"

    ChatCompletionFunctionCall:
      type: object
      description: Deprecated and replaced by `tool_calls`. The name and arguments of a `function` that should be called, as generated by the model.
      properties:
        name:
          type: string
          description: The name of the `function` to call.
        arguments:
          type: string
          description: The arguments to call the `function` with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your `function` schema. Validate the arguments in your code before calling your `function`.
      required:
        - name
        - arguments

    ChatCompletionMessageToolCall:
      type: object
      properties:
        id:
          type: string
          description: The ID of the `tool` call.
        type:
          $ref: "#/components/schemas/ToolCallType"
        function:
          type: object
          description: The `function` that the model called.
          properties:
            name:
              type: string
              description: The name of the `function` to call.
            arguments:
              type: string
              description: The arguments to call the `function` with, as generated by the model in JSON format. Note that the model does not always generate a valid JSON, and may hallucinate parameters not defined by your `function` schema. Validate the arguments in your code before calling your `function`.
          required:
            - name
            - arguments
      required:
        - id
        - type
        - function

    ToolCallType:
      type: string
      enum:
        - function
      description: The type of the `tool` call, in this case `function`.

    DeploymentFeatures:
      type: object
      description: The features supported by a deployment.
      properties:
        rate:
          type: boolean
          description: |
            Does the deployment support endpoint for rating a request: `POST /v1/{deployment_name}/rate`?
        mcp:
          type: boolean
          description: |
            Does the deployment support endpoint for MCP (Multi-Channel Processing) requests: `GET /v1/deployments/{deployment_name}/mcp`?
        tokenize:
          type: boolean
          description: |
            Does the deployment support endpoint for tokenization: `POST /v1/{deployment_name}/tokenize`?
        truncate_prompt:
          type: boolean
          description: |
            Does the deployment support endpoint for prompt truncation: `POST /v1/{deployment_name}/truncate_prompt`?
        configuration:
          type: boolean
          description: |
            Does the deployment support endpoint that provides JSON schema for deployment configuration: `GET /v1/deployments/{deployment_name}/configuration`?
        system_prompt:
          type: boolean
          description: |
            Does the deployment support system prompt in a chat completion request?
        tools:
          type: boolean
          description: |
            Does the deployment support `tools` and `functions` in chat completion request?
        seed:
          type: boolean
          description: |
            Does the deployment support seed parameter in chat completion request?
        url_attachments:
          type: boolean
          description: |
            Does the deployment support URL attachments in messages of a chat completion request?
            <br><br>
            An example of message with URL attachment:
            ```json
            {
              "messages": [
                {
                  "content": "Message content",
                  "attachments": [
                    {
                      "title": "Title of the URL attachment",
                      "url": "https://en.wikipedia.org/wiki/URL"
                    }
                  ]
                }
              ]
            }
            ```
        folder_attachments:
          type: boolean
          description: |
            Does the deployment support folder attachments in messages of a chat completion request?
            A folder attachment must point to a metadata of a directory in DIAL file storage.
            <br><br>
            An example of a message with folder attachment:
            ```json
            {
              "messages": [
                {
                  "content": "Message content",
                  "attachments": [
                    {
                      "title": "Title of the folder attachment",
                      "type": "application/vnd.dial.metadata+json",
                      "url": "metadata/BUCKET/PATH/TO/FOLDER/"
                    }
                  ]
                }
              ]
            }
            ```
        allow_resume:
          type: boolean
          description: Whether the deployment supports resuming conversations. Defaults to `true`.
          default: true
        accessible_by_per_request_key:
          type: boolean
          description: Whether the deployment is accessible by per-request API key. Defaults to `true`.
          default: true
        content_parts:
          type: boolean
          description: Whether the deployment supports content parts in messages. Defaults to `false`.
          default: false
        temperature:
          type: boolean
          description: Whether the deployment supports the temperature parameter. Defaults to `true`.
          default: true
        cache:
          type: boolean
          description: Whether the deployment supports LLM prompt caching (manual or automatic). Defaults to `false`.
          default: false
        auto_caching:
          type: boolean
          description: Whether the deployment supports automatic prompt caching. Defaults to `false`.
          default: false
        parallel_tool_calls:
          type: boolean
          description: Whether the deployment supports parallel tool calls. Defaults to `true`.
          default: true
        assistant_attachments_in_request:
          type: boolean
          description: Whether the deployment supports assistant attachments in the request. Defaults to `false`.
          default: false
      required:
        - rate
        - mcp
        - tokenize
        - truncate_prompt
        - configuration
        - system_prompt
        - tools
        - seed
        - url_attachments
        - folder_attachments

    DeploymentInputAttachmentTypes:
      type: array
      description: |
        A list of [content types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) that the deployment supports for input attachments.
        <br><br>
        The deployment does not support input attachments if the list is empty or the listing parameter is missing.
      items:
        type: string

    DeploymentMaxInputAttachments:
      type: integer
      description: |
        The maximum number of input attachments that the deployment supports.
        <br><br>
        When the listing parameter is missing and application does not support input attachments, the value is defaulted to `0`.
        <br><br>
        When the listing parameter is missing and application supports input attachments, there is no restriction on the number of attachments.

    DeploymentDefaultParameters:
      type: object
      description: |
        A dictionary providing default values for chat completion request parameters in case the parameters are missing in the request.
        <br><br>
        This is useful when a deployment requires specific parameters to be set, when those parameters are optional in the request schema.
        <br><br>
        For example the following default parameter sets the `max_tokens` parameter to `1024` when it's missing in the chat completion request:
        ```json
        {
          "max_tokens": 1024
        }
        ```
      example:
        max_tokens: 1024

    DeploymentBase:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the deployment.
        display_name:
          type: string
          description: The display name of the deployment. Returned only with the response from `/v1/deployments` endpoint.
        display_version:
          type: string
          description: The display version of the deployment.
        icon_url:
          type: string
          description: The icon of the deployment.
        description:
          type: string
          description: The description of the deployment in the Markdown format.
        reference:
          type: string
          description: The reference identifier of the deployment.
        owner:
          type: string
          description: The name of the owner for the deployment.
        status:
          type: string
          description: The status of the deployment. Always is `succeeded`.
        created_at:
          type: integer
          description: The value, in seconds since the epoch, that represents the time at which the object was created.
        updated_at:
          type: integer
          description: The value, in seconds since the epoch, that represents the time at which the object was modified.
        description_keywords:
          type: array
          items:
            type: string
          description: A list of keywords describing the deployment.
        max_retry_attempts:
          type: integer
          description: The maximum number of retry attempts to route a single user's request to the deployment's endpoint.
        interfaces:
          type: array
          items:
            type: string
          description: Interface types supported by the deployment. Returned only with the response from `/v1/deployments` endpoint.

    DeploymentWithFeatures:
      type: object
      properties:
        features:
          $ref: '#/components/schemas/DeploymentFeatures'
        input_attachment_types:
          $ref: '#/components/schemas/DeploymentInputAttachmentTypes'
        max_input_attachments:
          $ref: '#/components/schemas/DeploymentMaxInputAttachments'
        defaults:
          $ref: '#/components/schemas/DeploymentDefaultParameters'

    Deployment:
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            model:
              type: string
              description: The deployment name.
            object:
              type: string
              description: The object type. Always is `deployment`.
            scale_settings:
              type: object
              description: The scale settings of the deployment.
              properties:
                scale_type:
                  type: string
                  description: The scale type. Only the `standard` type is currently supported.
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    ModelOpenAi:
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            model:
              type: string
              description: The model name. Same as the `id` field.
            object:
              type: string
              description: The object type. Always is `model`.
            lifecycle_status:
              type: string
              description: Lifecycle status. Always is `generally-available`.
            capabilities:
              $ref: '#/components/schemas/ModelCapabilities'
            tokenizer_model:
              type: string
              description: |
                This parameter specifies the exact model whose tokenization algorithm matches the one used by the given model. Typically, this is the name of the first model released in a series that shares the same tokenization algorithm _(e.g., `gpt-3.5-turbo-0301`, `gpt-4-0314`, `gpt-4-1106-vision-preview`)_.
                <br><br>
                This parameter is useful for DIAL clients that implement tokenization algorithms on their side, rather than using the `/tokenize` endpoint provided by the model.
            limits:
              $ref: '#/components/schemas/ModelLimits'
            pricing:
              $ref: '#/components/schemas/ModelPricing'
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    ApplicationOpenAi:
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            application:
              type: string
              description: The application name.
            viewer_url:
              type: string
              description: The URL of the custom app UI.
            editor_url:
              type: string
              description: The URL of the custom app builder UI.
            object:
              type: string
              description: The object type. Always is `application`.
            application_properties:
              type: object
              description: Custom application properties.
            application_type_schema_id:
              type: string
              format: uri
              description: The URI of the application type schema.
            function:
              $ref: '#/components/schemas/ApplicationFunction'
            routes:
              type: object
              description: Custom routes for the application.
              additionalProperties:
                type: object
            invalid:
              type: boolean
              description: Indicates whether the application is invalid (e.g., missing required properties or schema violations). Only applicable for schema-rich applications. Null when the application is valid.
              readOnly: true
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    Assistant:
      deprecated: true
      description: "Deprecated: Assistant type has been removed from the codebase."
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            assistant:
              type: string
              description: The assistant name.
            object:
              type: string
              description: The object type. Always is `assistant`.
            addons:
              type: array
              description: The array of addons enabled by default in the assistant.
              items:
                type: string
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    Addon:
      deprecated: true
      description: "Deprecated: Addon type has been removed from the codebase."
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            addon:
              type: string
              description: The addon name.
            object:
              type: string
              description: The object type. Always is `addon`.

    ApplicationFunction:
      type: object
      description: Function deployment configuration for the application.
      properties:
        id:
          type: string
          description: The function identifier.
        runtime:
          type: string
          description: The runtime environment for the function.
        author_bucket:
          type: string
          description: The author's bucket.
        source_folder:
          type: string
          description: The source folder for the function code.
        target_folder:
          type: string
          description: The target folder for the deployed function.
        status:
          type: string
          enum: [DEPLOYING, UNDEPLOYING, DEPLOYED, UNDEPLOYED, FAILED]
          description: The current deployment status of the function.
        error:
          type: string
          description: Error message if the function deployment failed.
        mapping:
          type: object
          description: The mapping configuration for the function.
        env:
          type: object
          description: Environment variables for the function.
          additionalProperties:
            type: string

    ResourceAuthSettings:
      type: object
      description: Authentication settings for a resource.
      properties:
        authentication_type:
          type: string
          enum: [OAUTH, API_KEY, NONE]
          description: Type of authentication.
        client_id:
          type: string
          description: (OAUTH only) Client ID for OAuth flows.
        client_secret:
          type: string
          description: (OAUTH only) Client secret for OAuth flows.
          writeOnly: true
        redirect_uri:
          type: string
          description: (OAUTH only) Redirect URI for OAuth flows.
        authorization_endpoint:
          type: string
          description: (OAUTH only) Authorization endpoint for OAuth.
        token_endpoint:
          type: string
          description: (OAUTH only) Token endpoint for OAuth.
        code_challenge:
          type: string
          description: (OAUTH only) Code challenge for PKCE.
          readOnly: true
        code_challenge_method:
          type: string
          description: (OAUTH only) Code challenge method for PKCE.
        scopes_supported:
          type: array
          items:
            type: string
          description: (OAUTH only) Supported OAuth scopes.
        global_auth_status:
          type: string
          enum: [SIGNED_IN, SIGNED_OUT]
          description: Global credentials status.
          readOnly: true
        app_level_auth_status:
          type: string
          enum: [SIGNED_IN, SIGNED_OUT]
          description: Application-level credentials status.
          readOnly: true
        user_level_auth_status:
          type: string
          enum: [SIGNED_IN, SIGNED_OUT]
          description: User-level credentials status.
          readOnly: true
        api_key_header:
          type: string
          description: (API_KEY only) Header name for API key.
      required:
        - authentication_type

    ToolsetOpenAi:
      allOf:
        - type: object
          properties:
            id:
              type: string
              description: DIAL toolset id ('name' by default).
            toolset:
              type: string
              description:  DIAL toolset name.
            interfaces:
              type: string
              description:  Interfaces supported by the toolset. Default value `mcp`. Returned only with the response from `/v1/deployments` endpoint.
            icon_url:
              type: string
              description: The path for the location of the icon applied to the toolset on UI.
            description:
              type: string
              description: A brief description of the toolset.
            display_name:
              type: string
              description: A display name of the toolset on the UI.
            display_version:
              type: string
              description: A display version of the toolset on the UI.
            reference:
              type: string
              description: A reference id of the toolset ('name' or server-generated identifier).
            description_keywords:
              type: array
              description: A list of keywords describing the toolset, e.g. code-gen, text2image.
            max_retry_attempts:
              type: integer
              description: The maximum number of retry attempts to route a single user's request to the toolset's endpoint.
            object:
              type: string
              description: The object type. Always is `toolset`.
            status:
              type: string
              description: The status of the toolset. Always is `succeeded`.
            owner:
              type: string
              description: A toolset's owner.
            created_at:
              type: integer
              description: The date of the toolset creation.
            updated_at:
              type: integer
              description: The date of the toolset last update.
            transport:
              type: string
              description: The transport supported by a specific MCP server. Available options are `HTTP` or `SSE`.
            allowed_tools:
              type: array
              description: A list of available tools in the MCP server.
            auth_settings:
              $ref: '#/components/schemas/ResourceAuthSettings'
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    ToolSet:
      allOf:
        - $ref: '#/components/schemas/DeploymentBase'
        - type: object
          properties:
            toolset:
              type: string
              description: The toolset name.
            transport:
              type: string
              description: The transport supported by the MCP server. Available options are `HTTP` or `SSE`.
            allowed_tools:
              type: array
              description: A list of available tools in the MCP server.
              items:
                type: string
            object:
              type: string
              description: The object type. Always is `toolset`.
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    Toolset:
      allOf:
        - type: object
          properties:
            name:
              type: string
              description: DIAL Toolset's name.
            endpoint:
              type: string
              description:  DIAL Toolset API for MCP calls.
            icon_url:
              type: string
              description: The path for the location of the icon that applies for the DIAL toolset on UI.
            description:
              type: string
              description: A brief description of the toolset.
            display_name:
              type: string
              description: A display name of the toolset on the UI.
            display_version:
              type: string
              description: A display version of the toolset on the UI.
            description_keywords:
              type: array
              description: A list of keywords describing the toolset, e.g. code-gen, text2image.
            reference:
              type: string
              description: A reference id of the toolset ('name' or server-generated identifier).
            forward_per_request_key:
              type: boolean
              description: Indicates if a per-request API key should be forwarded to an upstream call.
            max_retry_attempts:
              type: integer
              description: The maximum number of retry attempts to route a single user's request to the toolset's endpoint.
            author:
              type: string
              description: The toolset's developer.
            created_at:
              type: integer
              description: The date of the toolset creation.
              readOnly: true
            updated_at:
              type: integer
              description: The date of the toolset last update.
              readOnly: true
            forward_auth_token:
              type: boolean
              description: Indicates if the authorization token should be forwarded to an upstream request.
              readOnly: true
            transport:
              type: string
              description: The transport supported by a specific MCP server. The available options are `HTTP` or `SSE`.
            allowed_tools:
              type: array
              description: A list of allowed tools supported by the MCP server.
            auth_settings:
              $ref: '#/components/schemas/ResourceAuthSettings'
        - $ref: '#/components/schemas/DeploymentWithFeatures'

    ModelCapabilities:
      type: object
      description: The capabilities of the model.
      properties:
        scale_types:
          type: array
          description: The scale types of the model. Defaults to `["standard"]`.
          items:
            type: string
        completion:
          type: boolean
          description: True if the model is a completion.
        chat_completion:
          type: boolean
          description: True if the model is a chat completion.
        embeddings:
          type: boolean
          description: True if the model is an embedding.
        fine_tune:
          type: boolean
          description: True if it is a fine-tuned model.
        inference:
          type: boolean
          description: True if the model can be deployed.

    ModelLimits:
      description: |
        Defines the token limits for the model.
        <br><br>
        Either `max_total_tokens` is specified by itself, or `max_prompt_tokens` and `max_completion_tokens` are specified together.
      type: object
      oneOf:
        - type: object
          properties:
            max_total_tokens:
              type: integer
              description: The maximum number of tokens allowed in a completion request and response combined.
          required:
            - max_total_tokens
        - type: object
          properties:
            max_prompt_tokens:
              type: integer
              description: The maximum number of tokens allowed in a completion request.
            max_completion_tokens:
              type: integer
              description: The maximum number of tokens allowed in a completion response.
          required:
            - max_prompt_tokens
            - max_completion_tokens

    ModelPricing:
      description: Defines the pricing for the model in an unspecified currency.
      type: object
      properties:
        unit:
          type: string
          enum:
            - token
            - char_without_whitespace
          description: The pricing units.
        prompt:
          type: string
          description: The per-unit price for the completion request.
        completion:
          type: string
          description: |
            The per-unit price for the completion response.
            <br><br>
            This field is typically missing for embedding models.
      required:
        - unit
        - prompt

    EmbeddingRequest:
      type: object
      properties:
        input:
          description: |-
            The input text to generate embeddings for. It can be either:
            - a string,
            - an array of strings,
            - an array of token ids <i>(representing a single tokenized string)</i> and
            - an array of arrays of token ids <i>(representing an array of tokenized strings)</i>.

            **Note:** representation of strings as an array of token ids may not be supported by certain models.
          anyOf:
            - type: string
              description: The string that will be turned into an embedding.
            - type: array
              items:
                type: string
              description: The array of strings that will be turned into embeddings.
            - type: array
              items:
                type: integer
              description: The array of token ids that will be turned into an embedding.
            - type: array
              items:
                type: array
                items:
                  type: integer
              description: The array of arrays of token ids that will be turned into embeddings.
        custom_input:
          $ref: '#/components/schemas/EmbeddingsCustomInput'
        user:
          type: string
          description: A unique identifier representing the end-user.
        encoding_format:
          description: The format in which the embeddings are returned.
          type: string
          enum:
            - float
            - base64
          default: float
          example: base64
        dimensions:
          description: |-
            The number of dimensions the resulting output embeddings should have.

            **Note:** instruction may not be supported by some models.
          type: integer
          example: 512
        custom_fields:
          $ref: '#/components/schemas/EmbeddingsCustomFields'
      required:
        - input

    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          description: Object type. Always is `list`.
        model:
          type: string
          description: The name of the model that generated the response.
        data:
          type: array
          description: A list of generated vectors.
          items:
            type: object
            description: The representation of an embedding vector corresponding to `index`-th input.
            properties:
              index:
                type: integer
                description: The index of the embedding from `0` to `number of regular and custom inputs in the request - 1`.
              object:
                type: string
                description: Object type. Always is `embedding`.
              embedding:
                description: Embedding output corresponding to the `index`-th embedding input. It's either an array of floats or base64-encoded vector depending on the value of `encoding_format` request parameter.
                oneOf:
                  - type: array
                    items:
                      type: number
                  - type: string
            required:
              - index
              - object
              - embedding
        usage:
          type: object
          description: This field contains information about the tokens from the model that were used to generate the response.
          properties:
            prompt_tokens:
              type: integer
              description: The number of tokens in the request to the model.
            total_tokens:
              type: integer
              description: The number of tokens in the request to the model.
          required:
            - prompt_tokens
            - total_tokens
      required:
        - object
        - model
        - data
        - usage

    ChatCompletionFunction:
      type: object
      deprecated: true
      properties:
        description:
          type: string
          description: A description of what the function does, used by the model to choose when and how to call the function.
        name:
          type: string
          description: 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.
        parameters:
          $ref: "#/components/schemas/FunctionParameters"
      required:
        - name

    ChatCompletionFunctionCallOption:
      type: object
      description: >
        Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
      properties:
        name:
          type: string
          description: The name of the function to call.
      required:
        - name

    ChatCompletionAddon:
      oneOf:
        - type: object
          properties:
            name:
              type: string
              description: The name of an addon defined in the DIAL Core config.
        - type: object
          properties:
            url:
              type: string
              description: |
                The URL pointing to an OpenAI Plugin Schema.
                <br><br>
                See for example the [to-do plugin](https://github.com/openai/plugins-quickstart/blob/main/.well-known/ai-plugin.json).

    ChatCompletionRequestMessage:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestDeveloperMessage"
        - $ref: "#/components/schemas/ChatCompletionRequestSystemMessage"
        - $ref: "#/components/schemas/ChatCompletionRequestUserMessage"
        - $ref: "#/components/schemas/ChatCompletionRequestAssistantMessage"
        - $ref: "#/components/schemas/ChatCompletionRequestToolMessage"
        - $ref: "#/components/schemas/ChatCompletionRequestFunctionMessage"

    ChatCompletionRequestDeveloperMessage:
      type: object
      title: Developer message
      description: >
        Developer-provided instructions that the model should follow, regardless
        of

        messages sent by the user. With o1 models and newer, `developer`
        messages

        replace the previous `system` messages.
      properties:
        content:
          description: The contents of the developer message.
          oneOf:
            - type: string
              description: The contents of the developer message.
              title: Text content
            - type: array
              description: An array of content parts with a defined type. For developer
                messages, only type `text` is supported.
              title: Array of content parts
              items:
                $ref: "#/components/schemas/ChatCompletionRequestDeveloperMessageContentPart"
              minItems: 1
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        role:
          type: string
          enum:
            - developer
          description: The role of the messages author, in this case `developer`.
        name:
          type: string
          description: An optional name for the participant. Provides the model
            information to differentiate between participants of the same role.
      required:
        - content
        - role

    ChatCompletionRequestSystemMessage:
      type: object
      title: System message
      properties:
        content:
          description: The contents of the system message.
          oneOf:
            - type: string
              description: The contents of the system message.
              title: Text content
            - type: array
              description: An array of content parts with a defined type. For system messages, only type `text` is supported.
              title: Array of content parts
              items:
                $ref: "#/components/schemas/ChatCompletionRequestSystemMessageContentPart"
              minItems: 1
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        role:
          type: string
          enum: ["system"]
          description: The role of the messages author, in this case `system`.
        name:
          type: string
          description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
      required:
        - content
        - role

    ChatCompletionRequestUserMessage:
      type: object
      title: User message
      properties:
        content:
          description: |
            The contents of the user message.
          oneOf:
            - type: string
              description: The text contents of the message.
              title: Text content
            - type: array
              description: An array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Image input is only supported when using the `gpt-4o` model.
              title: Array of content parts
              items:
                $ref: "#/components/schemas/ChatCompletionRequestUserMessageContentPart"
              minItems: 1
        custom_content:
          $ref: "#/components/schemas/ChatCompletionRequestUserMessageCustomContent"
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        role:
          type: string
          enum: ["user"]
          description: The role of the messages author, in this case `user`.
        name:
          type: string
          description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
      required:
        - content
        - role

    ChatCompletionRequestAssistantMessage:
      type: object
      title: Assistant message
      properties:
        content:
          nullable: true
          type: string
          oneOf:
            - type: string
              description: The contents of the assistant message.
              title: Text content
            - type: array
              description: An array of content parts with a defined type. Can be one or more of type `text`, or exactly one of type `refusal`.
              title: Array of content parts
              items:
                $ref: "#/components/schemas/ChatCompletionRequestAssistantMessageContentPart"
              minItems: 1
          description: |
            The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
        custom_content:
          $ref: "#/components/schemas/ChatCompletionRequestAssistantMessageCustomContent"
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        refusal:
          nullable: true
          type: string
          description: The refusal message by the assistant.
        role:
          type: string
          enum: ["assistant"]
          description: The role of the messages author, in this case `assistant`.
        name:
          type: string
          description: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
        tool_calls:
          $ref: "#/components/schemas/ChatCompletionMessageToolCalls"
        function_call:
          type: object
          deprecated: true
          description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model."
          nullable: true
          properties:
            arguments:
              type: string
              description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
            name:
              type: string
              description: The name of the function to call.
          required:
            - arguments
            - name
      required:
        - role

    ChatCompletionRequestToolMessage:
      type: object
      title: Tool message
      properties:
        role:
          type: string
          enum: ["tool"]
          description: The role of the messages author, in this case `tool`.
        content:
          oneOf:
            - type: string
              description: The contents of the tool message.
              title: Text content
            - type: array
              description: An array of content parts with a defined type. For tool messages, only type `text` is supported.
              title: Array of content parts
              items:
                $ref: "#/components/schemas/ChatCompletionRequestToolMessageContentPart"
              minItems: 1
          description: The contents of the tool message.
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        tool_call_id:
          type: string
          description: Tool call that this message is responding to.
      required:
        - role
        - content
        - tool_call_id

    ChatCompletionRequestFunctionMessage:
      type: object
      title: Function message
      deprecated: true
      properties:
        role:
          type: string
          enum: ["function"]
          description: The role of the messages author, in this case `function`.
        content:
          nullable: true
          type: string
          description: The contents of the function message.
        custom_fields:
          $ref: "#/components/schemas/ChatCompletionRequestCustomFields"
        name:
          type: string
          description: The name of the function to call.
      required:
        - role
        - content
        - name

    ChatCompletionRequestDeveloperMessageContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText"

    ChatCompletionRequestSystemMessageContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText"

    ChatCompletionRequestUserMessageContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText"
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartImage"

    ChatCompletionRequestAssistantMessageContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText"
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartRefusal"

    ChatCompletionRequestToolMessageContentPart:
      oneOf:
        - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText"

    ChatCompletionRequestMessageContentPartText:
      type: object
      title: Text content part
      properties:
        type:
          type: string
          enum: ["text"]
          description: The type of the content part.
        text:
          type: string
          description: The text content.
      required:
        - type
        - text

    ChatCompletionRequestMessageContentPartImage:
      type: object
      title: Image content part
      properties:
        type:
          type: string
          enum: ["image_url"]
          description: The type of the content part.
        image_url:
          type: object
          properties:
            url:
              type: string
              description: Either a URL of the image or the base64 encoded image data.
              format: uri
            detail:
              type: string
              description: Specifies the detail level of the image. Learn more in the [Vision guide](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/gpt-with-vision?tabs=rest%2Csystem-assigned%2Cresource#detail-parameter-settings-in-image-processing-low-high-auto).
              enum: ["auto", "low", "high"]
              default: "auto"
          required:
            - url
      required:
        - type
        - image_url

    ChatCompletionRequestMessageContentPartRefusal:
      type: object
      title: Refusal content part
      properties:
        type:
          type: string
          enum: ["refusal"]
          description: The type of the content part.
        refusal:
          type: string
          description: The refusal message generated by the model.
      required:
        - type
        - refusal

    ChatCompletionResponseMessage:
      type: object
      description: The Assistant message.
      properties:
        role:
          type: string
          enum:
            - assistant
          description: The role of the author of the response message.
        refusal:
          type: string
          description: The refusal message generated by the model.
          nullable: true
        content:
          type: string
          description: The contents of the message. `content` is set for all messages except messages with tool calls, function calls and refusals.
          nullable: true
        custom_content:
          $ref: "#/components/schemas/ChatCompletionResponseCustomContent"
        tool_calls:
          type: array
          description: The tool calls generated by the model, such as function calls.
          items:
            $ref: "#/components/schemas/ChatCompletionMessageToolCall"
        function_call:
          $ref: "#/components/schemas/ChatCompletionFunctionCall"
      required:
        - role
        - content
        - refusal

    ChatCompletionStreamResponseDelta:
      type: object
      description: A chat completion delta generated by streamed model responses.
      properties:
        role:
          type: string
          enum: ["assistant"]
          description: The role of the author of this message.
        refusal:
          type: string
          description: The refusal message generated by the model.
          nullable: true
        content:
          type: string
          description: The contents of the chunk message.
          nullable: true
        custom_content:
          $ref: "#/components/schemas/ChatCompletionResponseCustomContent"
        function_call:
          deprecated: true
          type: object
          description: "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model."
          properties:
            arguments:
              type: string
              description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
            name:
              type: string
              description: The name of the function to call.
        tool_calls:
          type: array
          items:
            $ref: "#/components/schemas/ChatCompletionMessageToolCallChunk"

    ChatCompletionMessageToolCallChunk:
      type: object
      properties:
        index:
          type: integer
        id:
          type: string
          description: The ID of the tool call.
        type:
          type: string
          enum: ["function"]
          description: The type of the tool. Currently, only `function` is supported.
        function:
          type: object
          properties:
            name:
              type: string
              description: The name of the function to call.
            arguments:
              type: string
              description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
      required:
        - index

    ChatCompletionRequestAssistantMessageCustomContent:
      type: object
      description: The custom content of the assistant message.
      properties:
        state:
          type: object
          description: |-
            The internal state of the Assistant. This field can have an arbitrary set of fields with an arbitrary structure.
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/RequestAttachment"
          description: List of attachments used to supply an additional output from the model.
        form_schema:
          type: object
          description: |-
            The JSON schema describing a form that the assistant prompts the user to fill in.
            Given this schema, the user is expected to provide a JSON value in the next message in the `custom_content.form_value` field.
    ChatCompletionRequestUserMessageCustomContent:
      type: object
      description: The custom content of the user message.
      properties:
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/RequestAttachment"
          description: List of attachments used to supply an additional input for the model.
        form_value:
          type: object
          description: |-
            The JSON value corresponding to the JSON schema sent by the assistant in the previous message in the `custom_content.form_schema` field.
    ChatCompletionRequestCustomFields:
      type: object
      description: DIAL-specific extensions of the Chat Completions message.
      properties:
        cache_breakpoint:
          $ref: "#/components/schemas/CacheBreakpoint"

    EmbeddingsCustomInput:
      type: array
      description: |-
        The custom embedding inputs that represent multi-modal inputs (e.g. images and video) along with compound inputs (e.g. a title for an image and the image itself).
      items:
        $ref: '#/components/schemas/EmbeddingsCustomInputElement'

    EmbeddingsCustomInputElement:
      description: A particular embedding input which embeddings model translates to an embedding vector.
      oneOf:
        - type: string
          description: Input text to get embeddings for, encoded as a string.
        - $ref: "#/components/schemas/RequestAttachment"
        - $ref: "#/components/schemas/EmbeddingsCustomInputCompoundElement"

    EmbeddingsCustomInputCompoundElement:
      description: An embedding input composed of multiple strings and attachments.
      type: array
      items:
        oneOf:
          - type: string
          - $ref: "#/components/schemas/RequestAttachment"

    EmbeddingsCustomFields:
      type: object
      description: |-
        Additional parameters for an embedding model.
      properties:
        type:
          type: string
          description: |-
            Type of embedding to embed an input with.

            The particular values of this parameter are specific for particular models.

            **Note:** embedding types may not be supported by some models.
        instruction:
          type: string
          description: |-
            Allows to specify an instruction prompt for an instructor-like embedding model.

            **Note:** instruction may not be supported by some models.

    ResponseFormatText:
      type: object
      properties:
        type:
          type: string
          description: "The type of response format being defined: `text`"
          enum: ["text"]
      required:
        - type

    ResponseFormatJsonObject:
      type: object
      properties:
        type:
          type: string
          description: "The type of response format being defined: `json_object`"
          enum: ["json_object"]
      required:
        - type

    ResponseFormatJsonSchemaSchema:
      type: object
      description: "The schema for the response format, described as a JSON Schema object."
    ResponseFormatJsonSchema:
      type: object
      properties:
        type:
          type: string
          description: "The type of response format being defined: `json_schema`"
          enum: ["json_schema"]
        json_schema:
          type: object
          properties:
            description:
              type: string
              description: A description of what the response format is for, used by the model to determine how to respond in the format.
            name:
              type: string
              description: The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
            schema:
              $ref: "#/components/schemas/ResponseFormatJsonSchemaSchema"
            strict:
              type: boolean
              nullable: true
              default: false
              description: Whether to enable strict schema adherence when generating the output. If set to `true`, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`.
          required:
            - schema
            - name
      required:
        - type
        - json_schema

    ChatCompletionsCustomFields:
      type: object
      description: |-
        Additional DIAL-specific parameters for a chat completion request.
      properties:
        configuration:
          type: object
          description: |-
            The object that represents configuration of the deployment.
            The schema of the object is specific for each deployment and provided by the endpoint
            `GET /v1/deployments/{deployment_name}/configuration`.
            <br><br>
            A deployment supports configuration if its listing, retrieved by `GET /openai/deployments/{deployment_name}`, has a field `features.configuration` set to **true**.
            <br><br>
            Certain models connected via DIAL adapters are configurable. For detailed configuration information, refer to the documentation of each adapter:
              - [OpenAI Adapter](https://github.com/epam/ai-dial-adapter-openai/?tab=readme-ov-file#configurable-models)
              - [Google VertexAI Adapter](https://github.com/epam/ai-dial-adapter-vertexai/?tab=readme-ov-file#configurable-models)
              - [AWS Bedrock Adapter](https://github.com/epam/ai-dial-adapter-bedrock/?tab=readme-ov-file#configurable-models)
          example:
            $ref: ./examples/configuration_value.json

    ChatCompletionResponseCustomContent:
      type: object
      description: The custom content of a message.
      properties:
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/ChatCompletionResponseAttachment"
          description: List of attachments.
        stages:
          type: array
          readOnly: true
          items:
            $ref: "#/components/schemas/ChatCompletionResponseStage"
          description: The intermediate stages that the Assistant went through to generate the response.
        state:
          type: object
          description: The internal state of the Assistant. This field can have an arbitrary set of fields with an arbitrary structure. In case of a streaming, the state is published fully in one chunk.

    RequestAttachment:
      type: object
      properties:
        type:
          type: string
          default: text/markdown
          description: The content type of the attachment. Should be one of the MIME types.
        title:
          type: string
          description: The title of the attachment.
        data:
          type: string
          description: |-
            Should follow the format described in the MIME standard for `type`.

            It is <span style="color: #f604fe;">mandatory</span> for the attachment to have exactly one of the following fields (never both): `data` or `url`.
        url:
          type: string
          description: |-
            The content of `url` should follow the format described in the MIME standard for `type`.

            It is <span style="color: #f604fe;">mandatory</span> for the attachment to have exactly one of the following fields (never both): `data` or `url`.
        reference_type:
          type: string
          description: The content type of `reference_url`. Should be one of the MIME types.
        reference_url:
          type: string
          description: If `reference_type` is specified, the content of `reference_url` should follow the format described in the MIME standard for `reference_type`.

    ChatCompletionResponseAttachment:
      type: object
      properties:
        index:
          type: integer
          description: |-
            In *streaming* chat completion responses, each attachment includes an `index` field
            indicating its position in the final ordered list. This field is required because
            attachments may arrive out of order, and the client must reconstruct the correct
            sequence using `index`.
            <br><br>
            In *non-streaming* responses, the `index` field is omitted because an attachment's
            position is already determined by its place in the returned list.
        type:
          type: string
          default: text/markdown
          description: The content type of the attachment. Should be one of the MIME types.
        title:
          type: string
          description: The title of the attachment.
        data:
          type: string
          description: |-
            Should follow the format described in the MIME standard for `type`.

            It is <span style="color: #f604fe;">mandatory</span> for the attachment to have one of the following fields (never both): `data` or `url`.
        url:
          type: string
          description: |-
            The content of `url` should follow the format described in the MIME standard for `type`.

            It is <span style="color: #f604fe;">mandatory</span> for the attachment to have one of the following fields (never both): `data` or `url`.
        reference_type:
          type: string
          description: The content type of `reference_url`. Should be one of the MIME types.
        reference_url:
          type: string
          description: If `reference_type` is specified, the content of `reference_url` should follow the format described in the MIME standard for `reference_type`.
      required:
        - index

    ChatCompletionResponseStage:
      type: object
      properties:
        index:
          type: integer
          description: |-
            In *streaming* chat completion responses, each stage includes an `index` field
            indicating its position in the final ordered list. This field is required because
            stages may arrive out of order, and the client must reconstruct the correct
            sequence using `index`.
            <br><br>
            In *non-streaming* responses, the `index` field is omitted because a stage's
            position is already determined by its place in the returned list.
        name:
          type: string
          description: The name of the stage.
        content:
          type: string
          description: The contents of the stage.
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/ChatCompletionResponseAttachment"
          description: List of attachments to the stage.
        status:
          type: string
          nullable: true
          description: |-
            The execution status of the stage. Available status values:

            * `null`: The stage is in progress.
            * `completed`: The stage is completed.
            * `failed`: The stage is failed.
      required:
        - index
        - name
        - status

    CreateChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the response.
        object:
          type: string
          description: Object type. Always is `chat.completion` for non-streaming.
        created:
          type: integer
          description: The response timestamp. The time in seconds since the epoch.
        model:
          type: string
          description: The name of the model that generated the response. May not be the same as the deployment name.
        choices:
          type: array
          description: List of generated messages. Contains _n_ items.
          items:
            type: object
            properties:
              index:
                type: integer
                description: The index of the choice from `0` to `n - 1`.
              message:
                type: object
                $ref: "#/components/schemas/ChatCompletionResponseMessage"
              finish_reason:
                type: string
                nullable: true
                description: |-
                  The reason indicating the completion of the choice generation process. The possible reasons:

                  * `stop`: Successful generation.
                  * `length`: The generation was stopped because it surpassed the available number of tokens.
                  * `function_call`: The Assistant decided to call a function.
                  * `tool_calls`: The Assistant decided to call a tool.
                  * `content_filter`: Omitted content due to a flag from content filters.
            required:
              - index
              - message
              - finish_reason
        usage:
          type: object
          description: This field contains information about the tokens from the model that were used to generate the response.
          properties:
            prompt_tokens:
              type: integer
              description: The number of tokens in the request to the model.
            completion_tokens:
              type: integer
              description: The number of tokens in the response from the model.
            total_tokens:
              type: integer
              description: The sum of prompt and completion tokens.
        statistics:
          type: object
          $ref: "#/components/schemas/ChatCompletionResponseStatistics"
        system_fingerprint:
          type: string
          description: Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.

    PublicationRequest:
      type: object
      properties:
        name:
          type: string
          description: A publication request name.
        displayAuthor:
          type: string
          description: The name that will be displayed on UI instead of the name of the author of the publication request.
        targetFolder:
          type: string
          description: The name of the target folder for the publication.
        resources:
          type: array
          description: List of resources to be published. **Required** either `rules` or `resources` or both.
          items:
            type: object
            properties:
              action:
                type: string
                description: The type of action to performed. Use `ADD` to create a publish request. Use `DELETE` to create an unpublish request.
                enum:
                  - ADD
                  - DELETE
                  - ADD_IF_ABSENT
              sourceUrl:
                type: string
                description: The path to the source of the publication.
              targetUrl:
                type: string
                description: The path to the destination of the publication.
              publishCredentials:
                type: boolean
                description: A flag enabling resource publication with credentials. Set `true` for publishing with credentials.
        rules:
          type: array
          description: List of rules to restrict access to the published resource. Applies to `targetFolder`. The request is invalid if `rules` is specified together with `public` as value for `targetFolder`.  **Required** either `rules` or `resources` or both. Skip `resources` and include `rules` to update only rules. You can pass an empty `rules` object to delete all rules.
          items:
            type: object
            properties:
              source:
                type: string
                description: Claim for authorization using JWT. For authorization with API keys the source is `roles`.
              function:
                type: string
                description: The function.
                enum:
                - EQUAL
                - CONTAIN
                - REGEX
              targets:
                type: array
                description: Claim value(s) for authorization using JWT. For authorization with API keys - the roles assigned to API key.
                items:
                  type: string
      required:
            - name
            - targetFolder

    UpdatePublicationRequest:
      type: object
      properties:
        name:
          type: string
          description: A publication request name.
        displayAuthor:
          type: string
          description: The name that will be displayed on UI instead of the name of the author of the publication request.
        url:
          type: string
          description: The publication request URL.
        targetFolder:
          type: string
          description: The name of the target folder for the publication.
        resources:
          type: array
          description: A list of resources to be published. **Required** either `rules` or `resources` or both.
          items:
            type: object
            properties:
              action:
                type: string
                description: A type of action to performed. Use `ADD` to create a publish request. Use `DELETE` to create an unpublish request.
                enum:
                  - ADD
                  - DELETE
                  - ADD_IF_ABSENT
              sourceUrl:
                type: string
                description: The path to the source of the publication.
              targetUrl:
                type: string
                description: The path to the destination of the publication.
              publishCredentials:
                type: boolean
                description: A flag enabling resource publication with credentials. Set `true` for publishing with credentials.
        rules:
          type: array
          description: A list of rules to restrict access to the published resource. **Required** either `rules` or `resources` or both. Skip `resources` and include `rules` to update only rules. You can pass an empty `rules` object to delete all rules.
          items:
            type: object
            properties:
              source:
                type: string
                description: Claim for authorization using JWT. For authorization with API keys the source is `roles`.
              function:
                type: string
                description: The function.
                enum:
                - EQUAL
                - CONTAIN
                - REGEX
              targets:
                type: array
                description: Claim value(s) for authorization using JWT. For authorization with API keys - the roles assigned to API key.
                items:
                  type: string
      required:
            - name
            - url
            - targetFolder

    PublicationResponse:
      type: object
      description: Publications
      properties:
        publications:
          type: array
          description: List of publications.
          items:
            type: object
            properties:
              url:
                type: string
                description: The URL that represents the publication request.
              name:
                type: string
                description: The publication name.
              author:
                type: string
                description: The author of the publication request.
              displayAuthor:
                type: string
                description: The name displayed on UI instead of the author of the publication request.
              createdAt:
                type: integer
                description: The creation time of the publication request in milliseconds.
              targetFolder:
                type: string
                description: The name of the target folder for the publication.
              status:
                type: string
                description: Publication status.
                enum:
                  - PENDING
                  - APPROVED
                  - REJECTED
              resourceTypes:
                type: array
                description: The type of resource.
                items:
                  type: string
                  enum:
                    - FILE
                    - PROMPT
                    - CONVERSATION
                    - APPLICATION

    NotificationsResponse:
      type: object
      description: Notifications
      properties:
        notifications:
          type: array
          description: List of notifications.
          items:
            type: object
            properties:
              id:
                type: string
                description: The identifier of the notification.
              url:
                type: string
                description: The URL of the resource the notification applies to. For example, a publication request URL if the notification is created for publication requests.
              type:
                type: string
                description: The notification type.
              message:
                type: string
                description: The notification text.
              timestamp:
                type: number
                description: The notification timestamp.

    GetPublicationResponseObject:
      type: object
      description: Publications
      properties:
        url:
          type: string
          description: The URL with the publication bucket id, and the publication request id.
        createdAt:
          type: integer
          description: The creation time of the publication request in milliseconds.
        name:
          type: string
          description: The publication name.
        author:
          type: string
          description: The author of the publication request.
        displayAuthor:
          type: string
          description: The name displayed on UI instead of the author of the publication request.
        targetFolder:
          type: string
          description: The name of the target folder for the publication.
        status:
          type: string
          description: Publication status.
          enum:
            - PENDING
            - APPROVED
            - REJECTED
        resources:
          type: array
          description: List of resources to be published.
          items:
            type: object
            properties:
              action:
                type: string
                description: The type of action to be performed.
                enum:
                  - ADD
                  - DELETE
                  - ADD_IF_ABSENT
              sourceUrl:
                type: string
                description: The location of the source for the publication resource.
              targetUrl:
                type: string
                description: The path to the destination for the publication.
              reviewUrl:
                type: string
                description: The URL of the source.
        resourceTypes:
          type: array
          description: The type of resource.
          items:
            type: string
            enum:
              - FILE
              - PROMPT
              - CONVERSATION
              - APPLICATION
        rules:
          type: array
          description: List of rules to restrict access to the published resource.
          items:
            type: object
            properties:
              source:
                type: string
                description: Claim for authorization using JWT. For authorization with API keys the source is `roles`.
              targets:
                type: array
                description: Claim value(s) for authorization using JWT. For authorization with API keys - the roles assigned to API key.
                items:
                  type: string
              function:
                type: string
                description: The function for the rule.
                enum:
                - EQUAL
                - CONTAIN
                - REGEX

    PublicationResponseObject:
      type: object
      description: Publications
      properties:
        url:
          type: string
          description: The URL with the publication bucket id, and the publication request id.
        createdAt:
          type: integer
          description: The creation time of the publication request in milliseconds.
        name:
          type: string
          description: The publication name.
        author:
          type: string
          description: The author of the publication request.
        displayAuthor:
          type: string
          description: The name displayed on UI instead of the author of the publication request.
        targetFolder:
          type: string
          description: The name of the target folder for the publication.
        status:
          type: string
          description: Publication status.
          enum:
            - PENDING
            - APPROVED
            - REJECTED
        resources:
          type: array
          description: List of resources to be published.
          items:
            type: object
            properties:
              action:
                type: string
                description: The type of action to be performed.
                enum:
                  - ADD
                  - DELETE
                  - ADD_IF_ABSENT
              sourceUrl:
                type: string
                description: The location of the source for the publication resource.
              targetUrl:
                type: string
                description: The path to the destination for the publication.
              reviewUrl:
                type: string
                description: The URL of the source.
        resourceTypes:
          type: array
          description: The type of resource.
          items:
            type: string
            enum:
              - FILE
              - PROMPT
              - CONVERSATION
              - APPLICATION
        rules:
          type: array
          description: List of rules to restrict access to the published resource.
          items:
            type: object
            properties:
              source:
                type: string
                description: Claim for authorization using JWT. For authorization with API keys the source is `roles`.
              targets:
                type: array
                description: Claim value(s) for authorization using JWT. For authorization with API keys - the roles assigned to API key.
                items:
                  type: string
              function:
                type: string
                description: The function for the rule.
                enum:
                - EQUAL
                - CONTAIN
                - REGEX

    PublicationRules:
      type: object
      description: Publication rules
      properties:
        rules:
          type: object
          description: Map of rules to restrict access to the published resource, where a key is a path to target folder and a value is a list of rules
          additionalProperties: true
          properties:
            key:
              type: string
              description: target folder
            value:
              type: array
              description: rules' list
              items:
                type: object
                properties:
                  source:
                    type: string
                    description: Claim for authorization using JWT. For authorization with API keys the source is `roles`.
                  targets:
                    type: array
                    description: Claim value(s) for authorization using JWT. For authorization with API keys - the roles assigned to API key.
                    items:
                      type: string
                  function:
                    type: string
                    description: The function.
                    enum:
                      - EQUAL
                      - CONTAIN
                      - REGEX
    ChatCompletionResponseStatistics:
      type: object
      description: The Assistant work statistics.
      properties:
        usage_per_model:
          type: array
          description: Statistics of tokens used in models by the Assistant. In case of streaming, the statistics is published fully in one chunk.
          items:
            type: object
            properties:
              index:
                type: integer
                description: |-
                  In *streaming* chat completion responses, each model usage includes an `index` field
                  indicating its position in the final ordered list. This field is required because
                  model usages may arrive out of order, and the client must reconstruct the correct
                  sequence using `index`.
                  <br><br>
                  In *non-streaming* responses, the `index` field is omitted because the position of a model usage is already determined by its place in the returned list.
              model:
                type: string
                description: The model name.
              prompt_tokens:
                type: integer
                description: The number of tokens in the request to the model.
              completion_tokens:
                type: integer
                description: The number of tokens in the response from the model.
              total_tokens:
                type: integer
                description: The sum of prompt and completion tokens.
        discarded_messages:
          type: array
          items:
            type: integer
          description: |
            The list of indices of messages that were discarded by the Assistant.

            Returned only when `max_prompt_tokens` was set in the request.

    CreateChatCompletionStreamResponse:
      type: object
      description: Represents a streamed chunk of a chat completion response returned by model, based on the provided input.
      properties:
        id:
          type: string
          description: A unique identifier for the chat completion. Each chunk has the same ID.
        object:
          type: string
          description: The object type, which is always `chat.completion.chunk`.
          enum: [chat.completion.chunk]
        created:
          type: integer
          description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp.
        model:
          type: string
          description: The model name that generated the response. May not be the same as the deployment name.
        system_fingerprint:
          type: string
          description: |
            This fingerprint represents the backend configuration that the model runs with.
            Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.
        choices:
          type: array
          description: A list of generated chunks.
          items:
            type: object
            properties:
              index:
                type: integer
                description: The index of the choice from 0 to _n - 1_
              delta:
                type: object
                $ref: "#/components/schemas/ChatCompletionStreamResponseDelta"
              finish_reason:
                type: string
                nullable: true
                description: |-
                  The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence,

                  `length` if the maximum number of tokens specified in the request was reached,

                  `content_filter` if content was omitted due to a flag from our content filters,

                  `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function.
            required:
              - index
              - delta
              - finish_reason
        usage:
          type: object
          description: This field contains information about used models tokens for generation of the response. In case of streaming, the usage is published fully in one chunk.
          properties:
            prompt_tokens:
              type: integer
              description: The number of tokens in the request to the model.
            completion_tokens:
              type: integer
              description: The number of tokens in the response from the model.
            total_tokens:
              type: integer
              description: The sum of prompt and completion tokens.
          required:
            - prompt_tokens
            - completion_tokens
            - total_tokens
        statistics:
          type: object
          $ref: "#/components/schemas/ChatCompletionResponseStatistics"
      required:
        - choices
        - created
        - id
        - model
        - object

    Error:
      type: object
      properties:
        type:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        param:
          type: string
          nullable: true
        code:
          type: string
          nullable: true
        display_message:
          type: string
          nullable: true
          description: |
            The user-friendly error message for non-technical users.

    userinfo:
      type: object
      description: User info
      properties:
        project:
          type: string
          description: The project name.
        roles:
          type: array
          description: List of user or API key roles.
          items:
            type: string
        userClaims:
          type: object
          description: Claims extracted from the access token.
          properties:
            email:
              type: array
              description: The email of the user.
              items:
                type: string
            sub:
              type: array
              description: Identifies the principal or subject of the token.
              items:
                type: string

    ApplicationLogs:
      type: object
      description: Application logs
      properties:
        logs:
          type: array
          description: log records
          items:
            $ref: '#/components/schemas/ApplicationLog'

    ApplicationLog:
      type: object
      properties:
        instance:
          description: machine instance ID
          type: string
        content:
          description: log content
          type: string

    CodeInterpreterRequestFile:
      type: object
      properties:
        sessionId:
          type: string
          description: session ID
        sourceUrl:
          type: string
          description: URL to source file
        targetPath:
          type: string
          description: Path to target file

    CodeInterpreterFile:
      type: object
      properties:
        sessionId:
          type: string
          description: session ID
        path:
          type: string
          description: path to file
        size:
          type: integer
          description: file size

    GetSession:
      type: object
      properties:
        sessionId:
          type: string
          description: Session ID

    PromptRequest:
      type: object
      properties:
        id:
          type: string
          description: Prompt unique identifier
        name:
          type: string
          description: Display name
        folderId:
          type: string
          description: Path to the folder where prompt located according to the user's root
        content:
          type: string
          description: Prompt body
      required:
        - id
        - name
        - folderId
        - content

    JsonRpcRequest:
      type: object
      required: [ jsonrpc, method ]
      properties:
        jsonrpc:
          type: string
          enum: [ "2.0" ]
          description: JSON-RPC protocol version
        method:
          type: string
          description: Name of the method to be invoked.
        params:
          description: |
            Parameter values for the RPC call. Can be: `array` (by-position parameters) OR `object` (by-name parameters).
          oneOf:
            - type: array
              items: { }
            - type: object
        id:
          description: |
            Identifier established by the client. Must be included in the
            response if present. If omitted, it's a notification.
          oneOf:
            - type: string
            - type: integer

    JsonRpcResponse:
      type: object
      required: [ jsonrpc ]
      properties:
        jsonrpc:
          type: string
          enum: [ "2.0" ]
          description: JSON-RPC protocol version
        result:
          description: |
            The successful result of the RPC call. Must not be included
            if `error` is present.
        error:
          description: |
            Error object in case of failure. Must not be included
            if `result` is present.
          type: object
          required: [ code, message ]
          properties:
            code:
              type: integer
              description: Error code.
            message:
              type: string
              description: Error message.
            data:
              description: Additional error information
        id:
          description: |
            Same `id` as in the request. `Null` for certain errors where the
            request `id` cannot be determined.
          oneOf:
            - type: string
            - type: integer

    Deployments:
      type: object
      properties:
        deployments:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/ModelOpenAi'
              - $ref: '#/components/schemas/ApplicationOpenAi'
              - $ref: '#/components/schemas/ToolsetOpenAi'

