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

# Get real-time chat history

> Retrieves the real-time chat history from Redis cache. Use this endpoint to poll for results when using async mode. Returns status indicating if processing is still in progress.



## OpenAPI

````yaml GET /v1/assistants/{identifier}/chats/{chatUid}/realtime
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Environments
    description: >-
      The machine an agent works on and everything it may reach: sandbox,
      snapshot, knowledge, tools and encrypted variables
  - name: Sandboxes
    description: >-
      Start a real Linux machine on an environment, run commands and files on
      it, and save its snapshot
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
  - name: Integrations
    description: Connect third-party apps and turn them into tools
  - name: Triggers
    description: Start an agent or an assistant from an app event
  - name: Tenant Integrations
    description: Apps that each end user connects for themselves
  - name: Memory
    description: What an assistant remembers between conversations
  - name: Skills
    description: Reusable instruction packs for agents and assistants
  - name: Speech to Text
    description: Audio transcription
  - name: Tenants
    description: Tenants, subtenants and their usage
  - name: MCP Gateway
    description: One MCP endpoint over many servers, with visibility per user
  - name: Tenant Sessions
    description: Tokens that prove which end user is calling
paths:
  /v1/assistants/{identifier}/chats/{chatUid}/realtime:
    get:
      tags:
        - Assistants
      summary: Get real-time chat history
      description: >-
        Retrieves the real-time chat history from Redis cache. Use this endpoint
        to poll for results when using async mode. Returns status indicating if
        processing is still in progress.
      operationId: getRealtimeChatHistory
      parameters:
        - name: identifier
          required: true
          in: path
          description: The unique identifier of the assistant specialization
          schema:
            type: string
        - name: chatUid
          required: true
          in: path
          description: The unique identifier of the chat conversation
          schema:
            type: string
      responses:
        '200':
          description: Real-time chat history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeChatHistoryDto'
        '400':
          description: Bad request — invalid or inconsistent payload
        '401':
          description: Unauthorized — missing or invalid API key
        '403':
          description: Forbidden — not reachable with this credential
        '404':
          description: Chat history not found
      security:
        - bearerAuth: []
components:
  schemas:
    RealtimeChatHistoryDto:
      type: object
      properties:
        chatUID:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        clientUID:
          type: string
          example: client-123
        chatHistory:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
        status:
          type: string
          enum:
            - processing
            - completed
            - error
            - handed_off
            - buffering
            - waiting_for_tool_response
            - limit_exceeded
          example: processing
        lastUpdatedAt:
          type: number
          example: 1706000000000
        queuedMessages:
          type: number
          example: 0
        pendingUserMessages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessageDto'
        pendingToolCalls:
          description: Pending tool calls awaiting client-side execution
          type: array
          items:
            $ref: '#/components/schemas/ToolCallDto'
        handedOffSubThreadId:
          type: string
          description: Subagent thread ID (when status is handed_off)
          example: 64f5a5b8c123456789abcdef
        stopReason:
          type: string
          description: System stop reason (e.g. max_chat_messages_reached, error)
          example: max_chat_messages_reached
        recalledMemories:
          description: >-
            Memory-recall events of the in-flight run (source, query,
            facts/entities surfaced)
          type: array
          items:
            type: string
        limitExceeded:
          type: object
          description: Usage-limit details (when status is limit_exceeded)
      required:
        - chatUID
        - clientUID
        - chatHistory
        - status
        - lastUpdatedAt
    ChatMessageDto:
      type: object
      description: A single message of a conversation, as the platform stored it.
      properties:
        uid:
          type: string
          description: Unique message id
          example: 75ecbcfc-a3be-43ba-8da6-b3e16e8d7280
        chatUid:
          type: string
          description: Conversation this message belongs to
          example: 550e8400-e29b-41d4-a716-446655440000
        role:
          type: string
          enum:
            - user
            - assistant
            - developer
            - tool
          description: >-
            Who the message is from. `developer` messages are the ones the
            platform injects (current date, injected context) and can be ignored
            by most clients.
        content:
          type: object
          description: Body of the message.
          properties:
            message:
              type: string
              description: The text. This is the field to render.
              example: I would recommend a 450 W monocrystalline panel.
            data:
              type: object
              additionalProperties: true
              description: >-
                Structured payload, when the assistant is configured with a
                structured output.
            files:
              type: array
              description: >-
                Files carried by the message, echoed in the same shape they were
                sent in.
              items:
                type: object
                properties:
                  name:
                    type: string
                    example: invoice.pdf
                  donwloadUrl:
                    type: string
                    example: https://files.devic.ai/uploads/invoice.pdf
                  fileType:
                    type: string
                    enum:
                      - IMAGE
                      - DOCUMENT
                      - VIDEO
                      - AUDIO
                      - ELECTRICITY_BILL
                      - OTHER
                    example: DOCUMENT
        timestamp:
          type: number
          description: Unix timestamp in milliseconds
          example: 1706000000000
        userUID:
          type: string
          description: Identity the message was written under
          example: api-key:42
        summary:
          type: string
          description: >-
            Short AI-generated summary of the message, unless summarisation was
            skipped
          example: The user asks which panels to install on a 60 m2 roof.
        contentSource:
          type: string
          description: >-
            Where `content.message` came from when the model did not write it.
            `finish_tool` means the reply was taken from the finish tool's
            `message` argument, so it can be read without parsing tool calls.
            Absent on messages the model wrote itself.
          example: finish_tool
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCallDto'
          description: Tool calls the assistant made on this message
        tool_call_id:
          type: string
          description: On `tool` messages, the call this message answers
          example: call_abc123
        latencyMs:
          type: number
          description: How long the model or the tool took, in milliseconds
          example: 1045
        messageTokenUsage:
          type: object
          description: Tokens this message accounted for
          properties:
            inputTokens:
              type: number
            outputTokens:
              type: number
            inputCachedTokens:
              type: number
            inputCacheWriteTokens:
              type: number
            outputCachedTokens:
              type: number
            reasoningOutputTokens:
              type: number
            totalTokens:
              type: number
            provider:
              type: string
            model:
              type: string
            reasoningEffort:
              type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
                - max
              description: Reasoning effort recorded for this model response.
        messageCost:
          type: object
          description: What this message cost, at the pricing in force when it ran
          properties:
            inputCost:
              type: number
            outputCost:
              type: number
            inputCachedCost:
              type: number
            inputCacheWriteCost:
              type: number
            outputCachedCost:
              type: number
            reasoningOutputCost:
              type: number
            totalCost:
              type: number
            currency:
              type: string
              example: USD
            calculatedAt:
              type: number
    ToolCallDto:
      type: object
      properties:
        id:
          type: string
          example: call_abc123
          description: Unique tool call ID
        type:
          type: string
          example: function
          description: Tool call type
        function:
          type: object
          description: Function call details
          example:
            name: get_user_location
            arguments: '{}'
      required:
        - id
        - type
        - function
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API key from your Devic console, sent as `Authorization: Bearer
        <key>`. An embedded front end sends a tenant-session token instead, so
        no API key reaches the browser, and an OAuth integration sends its
        access token. Missing, invalid or expired credentials get a `401`. See
        [Authentication](/api-reference/introduction#authentication).

````

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