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

# Send a single user message

> Send a single user message. The response format follows the Accept header: `text/event-stream` for SSE, `application/json` for a buffered assistant reply. `sessionId` targets a concrete active chat. The resolved chat session ID is returned as `chatSessionId` in the JSON body and as the `X-Chat-Session-Id` response header on the SSE response.



## OpenAPI

````yaml /api-reference/mobilerun-va-chat.yaml post /assistant/chat/message
openapi: 3.1.0
info:
  title: Mobilerun VA Chat
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /assistant/chat/message:
    post:
      tags:
        - Chat
      summary: Send a single user message
      description: >-
        Send a single user message. The response format follows the Accept
        header: `text/event-stream` for SSE, `application/json` for a buffered
        assistant reply. `sessionId` targets a concrete active chat. The
        resolved chat session ID is returned as `chatSessionId` in the JSON body
        and as the `X-Chat-Session-Id` response header on the SSE response.
      operationId: chatMessage
      requestBody:
        content:
          application/json:
            schema:
              properties:
                agent:
                  type: string
                message:
                  minLength: 1
                  type: string
                sessionId:
                  format: uuid
                  type: string
              required:
                - message
                - sessionId
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  assistantText:
                    type: string
                  chatSessionId:
                    format: uuid
                    type: string
                  errorText:
                    type: string
                required:
                  - assistantText
                  - chatSessionId
                type: object
            text/event-stream:
              schema:
                type: string
          description: >-
            Streamed events (SSE) or buffered assistant reply (JSON), selected
            by Accept.
          headers:
            X-Chat-Session-Id:
              description: Resolved chat session ID for this turn (SSE response).
              schema:
                type: string
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '402':
          content:
            application/json:
              schema:
                properties:
                  code:
                    enum:
                      - insufficient_credits
                    type: string
                  errorText:
                    type: string
                  remaining:
                    type: number
                required:
                  - errorText
                  - code
                  - remaining
                type: object
          description: Insufficient credits — caller must top up before retrying
        '404':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Unknown or archived sessionId
        '409':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Another prompt is already in-flight for this user
        '410':
          content:
            application/json:
              schema:
                properties:
                  code:
                    enum:
                      - session_machine_replaced
                    type: string
                  message:
                    type: string
                  recovery:
                    enum:
                      - handoff
                    type: string
                required:
                  - code
                  - message
                  - recovery
                type: object
          description: >-
            The session can no longer accept messages because its agent
            environment is no longer active.
        '413':
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                required:
                  - message
                type: object
          description: Request body exceeds the 256 KB limit.
        '500':
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                properties:
                  code:
                    enum:
                      - billing_unavailable
                    type: string
                  errorText:
                    type: string
                required:
                  - errorText
                  - code
                type: object
          description: >-
            Billing service temporarily unavailable; response includes a
            `Retry-After` header (seconds) indicating when to retry.
        '504':
          content:
            application/json:
              schema:
                properties:
                  assistantText:
                    type: string
                  chatSessionId:
                    format: uuid
                    type: string
                  errorText:
                    type: string
                required:
                  - assistantText
                  - chatSessionId
                type: object
          description: >-
            JSON response timed out after 110s; partial assistantText is
            returned.
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.assistant.conversations.send({
              message: 'x',
              sessionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });

            console.log(response.assistantText);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.assistant.conversations.send(
                message="x",
                session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.assistant_text)
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````