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

# Get hosted session

> Retrieves the current status of a hosted session. Includes additional metadata when the session is completed.



## OpenAPI

````yaml /openapi.json get /liveai/rooms/{session_id}
openapi: 3.1.0
info:
  title: LemonSlice
  description: An API that gives access to a LemonSlice agent via a Daily room.
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://lemonslice.com/api
security:
  - apiKeyAuth: []
paths:
  /liveai/rooms/{session_id}:
    get:
      summary: Get hosted session
      description: >-
        Retrieves the current status of a hosted session. Includes additional
        metadata when the session is completed.
      operationId: getRoomStatus
      parameters:
        - name: session_id
          in: path
          description: The session identifier returned upon creation.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Returns basic status of session. When completed, includes additional
            metadata such as cost, timestamps, end reason, and conversation
            messages.
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_status:
                    type: string
                    enum:
                      - QUEUED
                      - ACTIVE
                      - COMPLETED
                      - TIMED_OUT
                      - FAILED
                    description: >-
                      Current status of the session:


                      - **QUEUED**: session is waiting for a GPU container.
                      Typically completes in seconds when warm containers are
                      available. If all warm containers are in use, a cold start
                      is required which may take up to 2.5 minutes.

                      - **ACTIVE**: agent is live.

                      - **COMPLETED**: session ended successfully.

                      - **TIMED_OUT**: GPU container timed out.

                      - **FAILED**: session ended with an error.
                  cost:
                    type: number
                    description: >-
                      Number of credits used for this session. Only returned
                      when session_status is COMPLETED.
                  llm_ended_reason:
                    type: string
                    description: >-
                      Reason the LLM session ended. Only returned when
                      session_status is COMPLETED.
                  llm_started_at:
                    type: integer
                    description: >-
                      Unix timestamp when the LLM session started. Only returned
                      when session_status is COMPLETED.
                  llm_ended_at:
                    type: integer
                    description: >-
                      Unix timestamp when the LLM session ended. Only returned
                      when session_status is COMPLETED.
                  messages:
                    type: array
                    description: >-
                      Array of messages exchanged during the session. Only
                      returned when session_status is COMPLETED.
                    items:
                      type: object
                      properties:
                        role:
                          type: string
                          enum:
                            - user
                            - agent
                          description: Role of the message sender.
                        message:
                          type: string
                          description: Content of the message.
                        seconds_from_start:
                          type: integer
                          description: >-
                            Number of seconds from the start of the session when
                            this message was sent.
                      required:
                        - role
                        - message
                        - seconds_from_start
                required:
                  - session_status
              examples:
                queued:
                  summary: Session is queued
                  value:
                    session_status: QUEUED
                active:
                  summary: Session is active
                  value:
                    session_status: ACTIVE
                completed:
                  summary: Session completed with full details
                  value:
                    session_status: COMPLETED
                    cost: 10.5
                    llm_ended_reason: 'Client disconnected: 1000'
                    llm_started_at: 1772746376
                    llm_ended_at: 1772746535
                    messages:
                      - role: user
                        message: hello
                        seconds_from_start: 0
                      - role: agent
                        message: Hello! How can I assist you today?
                        seconds_from_start: 10
                timed_out:
                  summary: Session timed out
                  value:
                    session_status: TIMED_OUT
                failed:
                  summary: Session failed
                  value:
                    session_status: FAILED
        '401':
          description: Authentication denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Invalid API key
        '403':
          description: Room does not belong to this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Room does not belong to this account
        '404':
          description: Room not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Room not found
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
              example:
                detail: Internal server error
components:
  schemas:
    Error:
      type: object
      properties:
        detail:
          type: string
          example: Agent not found
    ServerError:
      type: object
      properties:
        detail:
          type: string
          example: Internal server error
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your LemonSlice API token.

````