H2O.ai Chat API

The Chat API from H2O.ai — 29 operation(s) for chat.

OpenAPI Specification

h2o-ai-chat-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: h2oGPTe REST Chat API
  description: "\n# Overview \n\nUsers can easily interact with the h2oGPTe API through its REST API, allowing HTTP requests from any programming language.\n\n## Authorization: Getting an API key\n\nSign up/in at Enterprise h2oGPTe and generate one of the following two types of API keys: \n\n- **Global API key**: If a Collection is not specified when creating a new API Key, that key is considered to be a global API Key. Use global API Keys to grant full user impersonation and system-wide access to all of your work. Anyone with access to one of your global API Keys can create, delete, or interact with any of your past, current, and future Collections, Documents, Chats, and settings.\n\n- **Collection-specific API key**: Use Collection-specific API Keys to grant external access to only Chat with a specified Collection and make related API calls to it. Collection-specific API keys do not allow other API calls, such as creation, deletion, or access to other Collections or Chats.\n \nAccess Enterprise h2oGPTe through your [H2O Generative AI](https://genai.h2o.ai/appstore) app store account, available with a freemium tier.\n\n## Authorization: Using an API key \n\nAll h2oGPTe REST API requests must include an API Key in the \"Authorization\" HTTP header, formatted as follows:\n\n```\nAuthorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n```\n\n```sh\ncurl -X 'POST' \\\n  'https://h2ogpte.genai.h2o.ai/api/v1/collections' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Authorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \\\n  -d '{\n    \"name\": \"The name of my Collection\",\n    \"description\": \"The description of my Collection\",\n    \"embedding_model\": \"BAAI/bge-large-en-v1.5\"\n  }'\n```\n    \n## Interactive h2oGPTe API testing\n\nThis page only showcases the h2oGPTe REST API; you can test it directly in the [Swagger UI](https://h2ogpte.genai.h2o.ai/swagger-ui/). Ensure that you are logged into your Enterprise h2oGPTe account.\n"
  version: v1.0.0
servers:
- url: https://h2ogpte.genai.h2o.ai/api/v1
security:
- bearerAuth: []
tags:
- name: Chat
paths:
  /chats:
    post:
      tags:
      - Chat
      summary: Creates chat session.
      description: Creates chat session with a collection if provided. Otherwise, the session will be with a generic LLM.
      operationId: create_chat_session
      parameters:
      - name: collection_id
        in: query
        description: Id of collection
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  description: Workspace to be associated with the chat session. If not provided, the collection's workspace or default workspace will be used.
                  type: string
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
    get:
      operationId: list_chat_sessions
      summary: List chat sessions.
      description: List chat sessions.
      tags:
      - Chat
      parameters:
      - name: offset
        in: query
        description: How many chat sessions to skip before returning.
        required: false
        schema:
          type: integer
          default: 0
      - name: limit
        in: query
        description: How many chat sessions to return.
        required: false
        schema:
          type: integer
          default: 100
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/count:
    get:
      operationId: get_chat_session_count
      summary: Counts a number of chat sessions.
      description: Counts a number of chat sessions.
      tags:
      - Chat
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Count'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/delete_job:
    post:
      tags:
      - Chat
      summary: Creates job to delete chat sessions.
      description: Creates job to delete chat sessions.
      operationId: create_delete_chat_session_job
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteChatSessionsJobRequest'
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobDetails'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}:
    get:
      tags:
      - Chat
      summary: Finds a chat session by id.
      description: Returns a single chat session by its unique identifier.
      operationId: get_chat_session
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
    delete:
      tags:
      - Chat
      summary: Deletes collection.
      description: Deletes collection with a given unique identifier.
      operationId: delete_chat_session
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      - name: timeout
        in: query
        description: Timeout in seconds
        schema:
          type: number
          format: double
          default: 300
      responses:
        '204':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
    patch:
      tags:
      - Chat
      summary: Updates the name of a chat session.
      description: Updates the name of a chat session.
      operationId: update_chat_session
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatSessionUpdateRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/synth_message_pair:
    post:
      tags:
      - Chat
      summary: Insert a synthetic user-question + AI-reply pair into chat history.
      description: 'Used by slash-command flows (e.g. /schedule, /create-assistant) that

        produce an LLM response outside the normal streaming pipeline and need

        the resulting prompt/response pair to show up in the chat history on

        reload. The pair is tagged with chat_message_meta(message_type="command_synth",

        content=command_name) so UIs can identify these turns later.

        '
      operationId: insert_command_synth_pair
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session to attach the pair to.
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - user_prompt
              - ai_response
              - command_name
              properties:
                user_prompt:
                  type: string
                  description: The user-authored prompt (the question turn).
                ai_response:
                  type: string
                  description: The LLM-generated response (the reply turn).
                command_name:
                  type: string
                  description: Slash-command identifier (e.g. "schedule", "create-assistant").
      responses:
        '201':
          description: Pair inserted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  question_id:
                    type: string
                    description: ID of the inserted question turn.
                  reply_id:
                    type: string
                    description: ID of the inserted reply turn.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Chat session not found or not owned by the caller.
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/fork:
    post:
      tags:
      - Chat
      summary: Forks a chat session.
      description: Creates a new independent copy of a chat session with all messages, references, metadata, and document associations preserved.
      operationId: fork_chat_session
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session to fork
        required: true
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                message_id:
                  type: string
                  description: Optional message ID to branch from. When provided, only messages up to and including this message are copied.
      responses:
        '201':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/collection:
    put:
      tags:
      - Chat
      summary: Updates a collection reference of a chat session.
      description: Updates a collection reference of a chat session.
      operationId: update_chat_session_collection
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollectionChangeRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
    delete:
      tags:
      - Chat
      summary: Removes a collection reference from the chat session.
      description: Removes a collection reference from the chat session.
      operationId: delete_chat_session_collection
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/prompt_template:
    put:
      tags:
      - Chat
      summary: Updates a prompt template reference of a chat session.
      description: Updates a prompt template reference of a chat session.
      operationId: update_chat_session_prompt_template
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptTemplateChangeRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
    delete:
      tags:
      - Chat
      summary: Removes a prompt template reference from the chat session.
      description: Removes a prompt template reference from the chat session.
      operationId: delete_chat_session_prompt_template
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSession'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/guardrails:
    get:
      operationId: get_chat_session_guardrails
      summary: Get guardrails settings for a chat session.
      description: Returns the guardrails settings configured for a specific chat session.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/GuardrailsSettings'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/agent_server_files:
    get:
      operationId: list_agent_server_files
      summary: Lists agent server files.
      description: Lists agent server files.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentServerFile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
    delete:
      operationId: delete_agent_server_files
      summary: Deletes agent server files.
      description: Deletes agent server files.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/Conflict'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_ids}/agent_server_directories:
    delete:
      operationId: delete_agent_server_directories
      summary: Deletes agent server directories.
      description: 'Deletes agent server directories.


        Deprecated: this endpoint will be removed in a future release. Agent

        directories are now cleaned up automatically as part of the

        chat-session delete cascade — call `DELETE /chats/{session_ids}`

        instead. Deleting agent files mid-conversation leaves the agent in

        an inconsistent state (see h2oai/h2ogpte#7302), so this standalone

        path is no longer recommended.

        '
      deprecated: true
      tags:
      - Chat
      parameters:
      - name: session_ids
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: array
          items:
            type: string
      - name: dir_types
        in: query
        description: Types of agent directories to be deleted
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/Conflict'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/agent_server_directories/stats:
    get:
      operationId: list_all_agent_server_directories_stats
      summary: Lists stats of  agent server directories.
      description: Lists stats of agent server directories.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      - name: detail_level
        in: query
        description: the higher value, more details are returned.
        required: false
        schema:
          type: integer
          default: 0
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentServerDirectoryStats'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/agent_server_directories/{directory_name}/stats:
    get:
      operationId: get_agent_server_directory_stats
      summary: Gets stats of a agent server directory.
      description: Gets stats of a agent server directory.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      - name: directory_name
        in: path
        description: Directory name
        required: true
        schema:
          type: string
      - name: detail_level
        in: query
        description: the higher value, more details are returned.
        required: false
        schema:
          type: integer
          default: 0
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentServerDirectoryStats'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/completions:
    post:
      operationId: get_completion
      description: Asks question in a given chat session. If stream is enabled, the server sends stream of delta messages. The stream is terminated with the massage having property finished set to true. This message terminating message contains also the full completion.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of a chat session
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
            application/jsonl:
              schema:
                anyOf:
                - $ref: '#/components/schemas/ChatCompletionDelta'
                - $ref: '#/components/schemas/ChatError'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/questions:
    get:
      operationId: list_questions_for_chat_session
      summary: List suggested questions for a given chat session.
      description: List suggested questions for a given chat session.
      tags:
      - Chat
      parameters:
      - name: session_id
        in: path
        description: Id of a chat session
        required: true
        schema:
          type: string
      - name: limit
        in: query
        description: How many questions to return.
        required: false
        schema:
          type: integer
          default: 100
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuggestedQuestion'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /chats/{session_id}/messages:
    get:
      tags:
      - Chat
      summary: Fetches chat message and metadata for messages in a chat session.
      description: Fetches chat message and metadata for messages in a chat session. Messages without a `reply_to` are from the end user, messages with a `reply_to` are from an LLM and a response to a specific user message.
      operationId: get_chat_session_messages
      parameters:
      - name: session_id
        in: path
        description: Id of the chat session
        required: true
        schema:
          type: string
      - name: offset
        in: query
        description: How many chat sessions to skip before returning.
        required: false
        schema:
          type: integer
          default: 0
      - name: limit
        in: query
        description: How many chat sessions to return.
        required: false
        schema:
          type: integer
          default: 100
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatMessage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{message_ids}:
    delete:
      tags:
      - Chat
      summary: Deletes specific chat messages.
      description: Deletes specific chat messages.
      operationId: delete_messages
      parameters:
      - name: message_ids
        in: path
        description: Ids of messages to be deleted
        required: true
        schema:
          type: array
          items:
            type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{message_id}/references:
    get:
      tags:
      - Chat
      summary: Fetches metadata for references of a chat message.
      description: Fetches metadata for references of a chat message. References are only available for messages sent from an LLM, an empty list will be returned for messages sent by the user.
      operationId: get_message_references
      parameters:
      - name: message_id
        in: path
        description: Id of the chat message
        required: true
        schema:
          type: string
      - name: limit
        in: query
        description: The number of references to consider based on the highest confidence scores.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatMessageReference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{message_id}/meta:
    get:
      tags:
      - Chat
      summary: Fetches chat message meta information.
      description: Fetches chat message meta information.
      operationId: get_message_meta
      parameters:
      - name: message_id
        in: path
        description: Id of the chat message.
        required: true
        schema:
          type: string
      - name: info_type
        in: query
        description: Metadata type to fetch.
        required: false
        schema:
          type: string
          enum:
          - self_reflection
          - usage_stats
          - prompt_raw
          - llm_only
          - hyde1
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatMessageMeta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{message_id}/votes:
    put:
      tags:
      - Chat
      summary: Changes the vote value of a chat message.
      description: Set the exact value of a vote for a chat message. Any message type can be updated, but only LLM response votes will be visible in the UI. The expectation is 0 - unvoted, -1 - dislike, 1 - like. Values outside of this will not be viewable in the UI.
      operationId: set_message_votes
      parameters:
      - name: message_id
        in: path
        description: Id of the chat message.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageVoteUpdateRequest'
        required: true
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{question_id}/pause:
    post:
      tags:
      - Chat
      summary: Pause a streaming chat response.
      description: Pauses the streaming generation of a chat message response. The message can be resumed later using the resume endpoint.
      operationId: pause_chat_message
      parameters:
      - name: question_id
        in: path
        description: The ID of the chat question to pause.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{question_id}/resume:
    post:
      tags:
      - Chat
      summary: Resume a paused chat response.
      description: Resumes the streaming generation of a previously paused chat message response.
      operationId: resume_chat_message
      parameters:
      - name: question_id
        in: path
        description: The ID of the chat question to resume.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        default:
          $ref: '#/components/responses/Unexpected'
  /messages/{question_id}/stop:
    post:
      tags:
      - Chat
      summary: Stop a streaming chat response immediately.
      description: Immediately stops/cancels the streaming generation of a chat message response. This may result in an incomplete sentence or thought.
      operationId: stop_chat_message
      parameters:
      - name: question_id
        in: path
        description: The ID of the chat question to stop.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
      

# --- truncated at 32 KB (73 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/h2o-ai/refs/heads/main/openapi/h2o-ai-chat-api-openapi.yml