> ## 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.

# Create a named chat session

> Creates a titled agent session. Setup may occur on the first prompt. Idempotent via the `Idempotency-Key` header — a duplicate submit by the same authenticated caller within the 24-hour idempotency window returns the already-created session instead of a second one.



## OpenAPI

````yaml /api-reference/mobilerun-va-chat.yaml post /assistant/chat/sessions
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/sessions:
    post:
      tags:
        - Chat
      summary: Create a named chat session
      description: >-
        Creates a titled agent session. Setup may occur on the first prompt.
        Idempotent via the `Idempotency-Key` header — a duplicate submit by the
        same authenticated caller within the 24-hour idempotency window returns
        the already-created session instead of a second one.
      operationId: chatSessionsCreate
      parameters:
        - description: >-
            Optional client key. Reusing the same key with the same request body
            by the same authenticated caller within 24 hours returns the
            already-created session instead of a second one.
          in: header
          name: Idempotency-Key
          required: false
          schema:
            description: >-
              Optional client key. Reusing the same key with the same request
              body by the same authenticated caller within 24 hours returns the
              already-created session instead of a second one.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                agent:
                  maxLength: 64
                  minLength: 1
                  type: string
                description:
                  maxLength: 280
                  type: string
                title:
                  maxLength: 120
                  minLength: 1
                  type: string
              required:
                - title
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  session:
                    properties:
                      agent:
                        type:
                          - string
                          - 'null'
                      basePromptTokens:
                        type:
                          - number
                          - 'null'
                      contextExhaustedAt:
                        type:
                          - string
                          - 'null'
                      costCents:
                        type: number
                      costUsd:
                        type: number
                      createdAt:
                        type: string
                      createdBy:
                        type:
                          - string
                          - 'null'
                      description:
                        type:
                          - string
                          - 'null'
                      id:
                        type: string
                      lastActiveAt:
                        type: string
                      peakPromptTokens:
                        type:
                          - number
                          - 'null'
                      pinned:
                        type: boolean
                      promptStatus:
                        enum:
                          - ready
                          - machine_replaced
                        type: string
                      status:
                        type: string
                      title:
                        type: string
                      turnActive:
                        type: boolean
                      turnStartedAt:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - title
                      - description
                      - agent
                      - status
                      - createdAt
                      - lastActiveAt
                      - turnActive
                      - turnStartedAt
                      - pinned
                      - costCents
                      - costUsd
                      - peakPromptTokens
                      - basePromptTokens
                      - contextExhaustedAt
                      - promptStatus
                    type: object
                required:
                  - session
                type: object
          description: Created session
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      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 conversation = await client.assistant.conversations.create({
            title: 'x' });


            console.log(conversation.session);
        - 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
            )
            conversation = client.assistant.conversations.create(
                title="x",
            )
            print(conversation.session)
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````