> ## 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 self-managed session

> Retrieves the current status of a self-managed session. When the session is completed, returns additional metadata about the session.



## OpenAPI

````yaml /openapi.json get /liveai/sessions/{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/sessions/{session_id}:
    get:
      summary: Get self-managed session
      description: >-
        Retrieves the current status of a self-managed session. When the session
        is completed, returns additional metadata about the session.
      operationId: getSession
      parameters:
        - name: session_id
          in: path
          description: The ID of the session to retrieve.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Session status retrieved successfully. Returns basic status for all
            states. When completed, includes the total cost in credits.
          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.
                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
                  value:
                    session_status: COMPLETED
                    cost: 10.5
                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: Session not owned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Session does not belong to this account
        '404':
          description: Session not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                detail: Session 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.

````