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

# Send a message and receive an AI response

> Sends a conversation turn to the ARIS AI engine and streams back a
response. The AI classifies the intent, invokes tools (property search,
mortgage calculator, etc.) as needed, and returns a natural-language
reply with any relevant listing data embedded in the stream.

Responses are streamed as Server-Sent Events (SSE) in OpenAI-compatible
delta format. The final event is `data: [DONE]`.

**Intent types handled automatically:**
`property_search`, `property_question`, `general_question`, `correction`,
`contact_info`, `scheduling`, `small_talk`, `off_topic`, `follow_up`,
`comparison`, `affordability`, `negotiation`, `location_info`




## OpenAPI

````yaml openapi.yaml post /v1/chat
openapi: 3.1.0
info:
  title: ARIS API
  version: 1.0.0
  description: >
    The ARIS API provides programmatic access to the AI real estate assistant

    engine, MLS listing search, widget configuration, and lead management.


    ## Authentication


    All requests must include your developer API key in the `X-ARIS-API-Key`
    header.

    Obtain a key from the ARIS dashboard under **Settings → Developer Keys**.


    ```

    X-ARIS-API-Key: your-api-key

    ```


    Your API key is scoped to your brokerage. The `brokerageId` field in request

    bodies must match the brokerage associated with your key.


    ## Base URL


    ```

    https://dqgynnlsclfbqysauesf.supabase.co/functions/v1/api-router

    ```


    ## Rate Limits


    Requests are subject to your plan's monthly credit allowance. Each

    `/v1/chat` request consumes credits proportional to token usage. Listing

    search and config endpoints do not consume credits.


    ## Streaming


    The `/v1/chat` endpoint returns a Server-Sent Events (SSE) stream in

    OpenAI-compatible delta format. Each event is:


    ```

    data: {"choices":[{"delta":{"content":"..."},"index":0}]}

    ```


    The stream ends with:


    ```

    data: [DONE]

    ```
servers:
  - url: https://dqgynnlsclfbqysauesf.supabase.co/functions/v1/api-router
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /v1/chat:
    post:
      summary: Send a message and receive an AI response
      description: >
        Sends a conversation turn to the ARIS AI engine and streams back a

        response. The AI classifies the intent, invokes tools (property search,

        mortgage calculator, etc.) as needed, and returns a natural-language

        reply with any relevant listing data embedded in the stream.


        Responses are streamed as Server-Sent Events (SSE) in OpenAI-compatible

        delta format. The final event is `data: [DONE]`.


        **Intent types handled automatically:**

        `property_search`, `property_question`, `general_question`,
        `correction`,

        `contact_info`, `scheduling`, `small_talk`, `off_topic`, `follow_up`,

        `comparison`, `affordability`, `negotiation`, `location_info`
      operationId: chat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - messages
                - brokerageId
              properties:
                messages:
                  type: array
                  description: Full conversation history, most recent message last.
                  items:
                    $ref: '#/components/schemas/Message'
                  minItems: 1
                brokerageId:
                  type: string
                  description: The brokerage ID associated with your API key.
                  example: 550e8400-e29b-41d4-a716-446655440000
                sessionId:
                  type: string
                  description: >
                    Optional session identifier for conversation memory
                    persistence.

                    If omitted, a new session ID is generated and returned in
                    the

                    stream's final metadata event. Reuse the same sessionId
                    across

                    turns to maintain context (remembered preferences, prior
                    listings, etc.).
                  example: session_abc123
            example:
              brokerageId: 550e8400-e29b-41d4-a716-446655440000
              sessionId: session_abc123
              messages:
                - role: user
                  content: Show me 3-bedroom homes under $500k in Austin
      responses:
        '200':
          description: |
            SSE stream. Content-Type is `text/event-stream`.
            Each event follows OpenAI delta format.
            Property listing data is embedded in the stream using HTML comment
            markers (`<!--PROPERTIES: ... -->`) parsed by the widget renderer.
          headers:
            Content-Type:
              schema:
                type: string
                example: text/event-stream
            X-Session-Id:
              schema:
                type: string
              description: The session ID used for this conversation turn.
        '400':
          description: Missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Monthly credit quota exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          description: The role of the message sender.
        content:
          type: string
          description: The message text content.
      example:
        role: user
        content: Show me 3-bedroom homes under $500k in Austin
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
          example: brokerageId is required
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-ARIS-API-Key

````