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

# Chat with conversation memory

> Send a message in a conversation with memory persistence



## OpenAPI

````yaml openapi.json post /api/v1/ai/conversations/chat
openapi: 3.0.0
info:
  description: Dualship backend API for workflow automation and API management.
  title: Dualship API
  termsOfService: https://dualship.run/terms
  contact:
    name: Dualship Support
    url: https://dualship.run/support
    email: support@dualship.run
  version: '1.0'
servers:
  - url: https://api.dualship.run
security: []
paths:
  /api/v1/ai/conversations/chat:
    post:
      tags:
        - ai
      summary: Chat with conversation memory
      description: Send a message in a conversation with memory persistence
      parameters:
        - description: Workspace ID
          name: X-Workspace-Id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_dualship_dualship-be_internal_api_rules.ConversationChatRequest
        description: Chat request
        required: true
      responses:
        '200':
          description: Chat response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ConversationChatResponse
        '400':
          description: Invalid request or no providers configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.BadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.UnauthorizedError'
        '500':
          description: Chat failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.InternalServerError'
        '503':
          description: AI service not configured or all providers failed
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ServiceUnavailableError
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_dualship_dualship-be_internal_api_rules.ConversationChatRequest:
      type: object
      required:
        - conversation_id
        - message
        - workspace_id
      properties:
        conversation_id:
          type: string
          maxLength: 100
          minLength: 1
        document_ids:
          type: array
          maxItems: 10
          items:
            type: string
        max_history:
          type: integer
          maximum: 100
          minimum: 1
        max_tokens:
          type: integer
          maximum: 16384
          minimum: 1
        message:
          type: string
          minLength: 1
        model:
          type: string
        system_prompt:
          type: string
          maxLength: 10000
        temperature:
          type: number
          maximum: 2
          minimum: 0
        workspace_id:
          type: string
    internal_api_handler.ConversationChatResponse:
      description: Conversation chat response
      type: object
      properties:
        content:
          type: string
          example: Here is my response...
        conversation_id:
          type: string
          example: conv_abc123
        input_tokens:
          type: integer
          example: 150
        model:
          type: string
          example: gpt-4
        output_tokens:
          type: integer
          example: 200
    internal_api_handler.BadRequestError:
      description: Bad request error
      type: object
      properties:
        code:
          type: string
          example: BAD_REQUEST
        error:
          type: string
          example: invalid request parameters
    internal_api_handler.UnauthorizedError:
      description: Unauthorized error
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
        error:
          type: string
          example: unauthorized
    internal_api_handler.InternalServerError:
      description: Internal server error
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_ERROR
        error:
          type: string
          example: internal server error
    internal_api_handler.ServiceUnavailableError:
      description: Service unavailable error
      type: object
      properties:
        code:
          type: string
          example: SERVICE_UNAVAILABLE
        error:
          type: string
          example: service unavailable
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token authentication

````