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

# Chat with conversation history

> Send a list of messages (user/assistant/system) and get the next assistant reply. Use for multi-turn conversations.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/ai/llm/chat
openapi: 3.0.0
info:
  title: Flowra API (API Key Endpoints)
  description: >-
    **Flowra** is an AI-powered platform for building agents, workflows, and
    integrations.


    ### Capabilities

    - **Tools & Toolkits** – Define and group tools for agents and workflows.

    - **Workflows** – Orchestrate steps and automate processes.

    - **Triggers** – Schedule or event-based execution.

    - **Auth & Connections** – OAuth, API keys, and connected accounts.

    - **MCP** – Model Context Protocol server integration.

    - **Knowledge / RAG** – Add files and URLs for retrieval-augmented
    generation.


    ### Authentication

    Use the **x-api-key** header with a project API key to access endpoints that
    support API Key auth. Create and manage API keys in the dashboard under your
    project settings.


    Only endpoints that support API Key authentication via the @ApiKeyEnabled()
    decorator.


    Send x-api-key (required). On multi-tenant endpoints, optionally send
    x-username to act as an external user.
  version: '1.0'
  contact:
    name: Flowra
    url: https://flowra.dev
servers:
  - url: https://flowra.dev
    description: Flowra API
security: []
tags:
  - name: Users
    description: User profile
  - name: External Users
    description: End-user identities inside a project (x-username)
  - name: Auth Configs
    description: OAuth and API key configs for toolkits
  - name: Connected Accounts
    description: OAuth connected accounts and link creation
  - name: Toolkits
    description: List and search toolkits
  - name: Tools
    description: List, execute, and manage tools
  - name: Skills
    description: Browse, create, import, and install skills
  - name: Workflow & Agent
    description: Create, run, and inspect workflows and agents
  - name: Triggers
    description: Schedule and event-based trigger instances
  - name: Chat
    description: Threads and streaming agent runs
  - name: File
    description: Upload, list, and download files
  - name: Knowledge
    description: RAG knowledge collections
  - name: Table
    description: Collections and documents
  - name: Sandbox
    description: Ephemeral and durable code sandboxes
  - name: Browser
    description: Live browser sessions and view
  - name: LLM
    description: List AI models and generate completions
  - name: MCP
    description: MCP server management
  - name: usage
    description: Credit balance and usage ledger for the project API key
paths:
  /api/v1/ai/llm/chat:
    post:
      tags:
        - LLM
      summary: Chat with conversation history
      description: >-
        Send a list of messages (user/assistant/system) and get the next
        assistant reply. Use for multi-turn conversations.
      operationId: LLMController_chat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatDto'
      responses:
        '200':
          description: Assistant reply text
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringSuccessResponse'
              example:
                success: true
                message: Operation completed successfully
                data: ''
      security:
        - x-api-key: []
components:
  schemas:
    ChatDto:
      type: object
      properties:
        messages:
          description: Conversation history
          example:
            - role: user
              content: What is Flowra?
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
        model:
          type: string
          description: Model ID
          example: openai/gpt-4o-mini
        temperature:
          type: number
          description: Temperature (0-2)
          example: 0.7
        maxTokens:
          type: number
          description: Max tokens in response
          example: 1024
        systemPrompt:
          type: string
          description: System prompt (prepended if no system message in history)
          example: Answer in one sentence.
      required:
        - messages
    StringSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
          example: true
        message:
          type: string
          description: Success message
          example: Operation completed successfully
        data:
          type: string
          description: Response data
          example: ''
      required:
        - success
        - message
        - data
    ChatMessageDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - system
          description: Message role
        content:
          type: string
          maxLength: 400000
          description: Message content
          example: Hello
      required:
        - role
        - content
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Project API key. Create and manage keys in the dashboard under Project →
        API Keys. Send as header: x-api-key: <your-key>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.