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

# Stop Agora session

> Terminates an active LemonSlice Agora session. Agora's Conversational AI Engine calls this when the agent leaves the channel.

<Warning>
  **Do not call this endpoint directly from your app.** Stop the Agora Conversational AI agent with Agora's `/leave` API; Agora tears down the LemonSlice session. See the [Agora integration](/docs/agora).
</Warning>


## OpenAPI

````yaml /openapi.json delete /liveai/agora/session/stop
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/agora/session/stop:
    delete:
      summary: Stop Agora session
      description: >-
        Terminates an active LemonSlice Agora session. Agora's Conversational AI
        Engine calls this when the agent leaves the channel.
      operationId: stopAgoraSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgoraSessionStopInput'
            example:
              session_id: 3f7c2b91-9e1f-4a6a-8e9d-2c7c3e7d9b5a
              session_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      responses:
        '200':
          description: Session terminated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraSessionStopResponse'
              example:
                status: success
                message: Session terminated successfully
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraError'
              example:
                error: Invalid request
                message: 'Missing required field: session_id'
                code: VALIDATION_ERROR
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraError'
              example:
                error: Unauthorized
                message: Invalid API key
                code: INVALID_API_KEY
        '403':
          description: Missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraError'
              example:
                error: Forbidden
                message: API key header missing
                code: MISSING_API_KEY
        '404':
          description: Session not found or already terminated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraError'
              example:
                error: Not found
                message: Session not found or already terminated
                code: SESSION_NOT_FOUND
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgoraError'
              example:
                error: Internal server error
                message: Internal server error
                code: INTERNAL_ERROR
components:
  schemas:
    AgoraSessionStopInput:
      type: object
      required:
        - session_id
      properties:
        session_id:
          type: string
          description: The session ID returned by `/liveai/agora/session/start`.
        session_token:
          type: string
          description: The session token returned by `/liveai/agora/session/start`.
    AgoraSessionStopResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          const: success
          description: Termination status.
        message:
          type: string
          description: Human-readable confirmation message.
    AgoraError:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your LemonSlice API token.

````