> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datris.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Assistant chat (SSE)

> Runs the build-mode Assistant agent loop and streams agent-loop events (text deltas, tool calls, tool results, errors) as Server-Sent Events. The client cancels by disconnecting. Attachments reference files previously staged via `/assistant/attachment`.



## OpenAPI

````yaml /openapi.yaml post /api/v1/assistant/chat
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.11.3
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/assistant/chat:
    post:
      tags:
        - Assistant
      summary: Assistant chat (SSE)
      description: >-
        Runs the build-mode Assistant agent loop and streams agent-loop events
        (text deltas, tool calls, tool results, errors) as Server-Sent Events.
        The client cancels by disconnecting. Attachments reference files
        previously staged via `/assistant/attachment`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ChatRequest'
                - type: object
                  properties:
                    attachments:
                      type: array
                      items:
                        type: object
                        properties:
                          attachmentId:
                            type: string
                      description: >-
                        Handles of files staged via /assistant/attachment for
                        this turn
      responses:
        '200':
          description: Server-Sent Events stream of agent-loop events
          content:
            text/event-stream:
              schema:
                type: string
components:
  schemas:
    ChatRequest:
      type: object
      required:
        - messages
      properties:
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - user
                  - assistant
              content:
                type: string
        maxIterations:
          type: integer
          default: 50
          description: >-
            Maximum agent-loop iterations (LLM + tool-call rounds) before the
            loop stops
        context:
          type: object
          description: >-
            Optional endpoint-specific context object (see each chat endpoint's
            description)
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````