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

# 停止实时会话

> 主动结束语音Agent对话会话，释放服务资源。建议在用户结束对话时及时调用此接口。



## OpenAPI

````yaml POST /v1/realtime/leave
openapi: 3.1.0
info:
  title: SenseAudio Open Platform API
  description: >-
    SenseAudio 开放平台
    API，覆盖语音合成、语音识别、音色能力、音乐生成、图片生成、视频生成、智能体与大语言模型等能力。未显式说明的字段为依据素材文档推断。
  version: 1.0.0
servers:
  - url: https://api.senseaudio.cn
    description: 生产环境
security:
  - bearerAuth: []
paths:
  /v1/realtime/leave:
    post:
      tags:
        - Realtime
      summary: 停止对话式 Agent
      description: 主动结束语音Agent对话会话，释放服务资源。建议在用户结束对话时及时调用此接口。
      operationId: leaveRealtimeAgent
      parameters:
        - name: Content-Type
          in: header
          required: true
          description: 内容类型。固定为 application/json
          schema:
            type: string
            default: application/json
            example: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RealtimeLeaveRequest'
            example:
              room_id: lO81loRAfmUMFIwY
      responses:
        '200':
          description: 成功响应，返回空 JSON 对象
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeLeaveResponse'
              example: {}
        '401':
          description: 鉴权失败
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFilled:
                  summary: 未填写API KEY
                  value:
                    code: authentication_error
                    message: invalid authorization
                apiKeyFailed:
                  summary: API KEY 错误
                  value:
                    code: authentication_error
                    message: incorrect API key provided
        '404':
          description: 房间不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: notfound
                message: 资源未找到
                ref_code: 404000
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: internal
                message: 服务繁忙，请稍后再试
                ref_code: 500000
      security:
        - bearerAuth: []
components:
  schemas:
    RealtimeLeaveRequest:
      type: object
      properties:
        room_id:
          type: string
          description: 房间 ID，从「创建对话式 Agent」接口返回值中获取
          example: lO81loRAfmUMFIwY
      required:
        - room_id
    RealtimeLeaveResponse:
      type: object
      description: 成功时返回空 JSON 对象
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: 格式：`Bearer <API_KEY>`

````