{
  "openapi": "3.0.3",
  "info": {
    "title": "Kaleo API",
    "version": "2026-10-08",
    "description": "Kaleo AI 提供了一个 Web API，用于控制您的流媒体会话、获取观众分析数据以及监控 Kaleo Connect 设备。您可以根据需要使用我们的 API 集成到您的自定义 AVL 控制和工作流程中。\n\n开始使用，请按照以下说明获取 API 密钥，查找您的教会 ID，并验证您的请求。\n\n## 获取 API 密钥\n\n1. 进入仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面。\n2. 输入名称并选择 **创建 API 密钥**。\n3. 复制密钥并妥善保存。完整密钥仅显示一次。\n\n每个密钥仅适用于一个教会。其创建者必须保持教会成员身份。\n\n## 查找您的教会 ID\n\n从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制 **教会 ID**。在 API 请求中将其用作 `churchId`。\n\n## 认证\n\n每次请求都需发送您从 [API](https://app.withkaleo.com/to/integrations/api) 页面复制的密钥，格式如下：\n\n```text\nAuthorization: Bearer YOUR_API_KEY\n```\n\n在 API 操作台中，只需输入复制的密钥。Bearer 会自动添加。"
  },
  "servers": [
    {
      "url": "https://babel.withkaleo.com",
      "description": "生产环境 API"
    }
  ],
  "tags": [
    {
      "name": "Languages",
      "description": "支持的发言语言和翻译语言。",
      "x-displayName": "语言"
    },
    {
      "name": "Devices",
      "description": "可通过 API 监控和远程控制的 Kaleo Connect 设备。",
      "x-displayName": "设备"
    },
    {
      "name": "Streaming",
      "description": "**注意：开始流媒体端点仅能用于从 Kaleo Connect 设备开始流媒体。** 该端点不能用于从网页浏览器开始流媒体。其他所有流媒体端点均可控制浏览器和 Kaleo Connect 设备。",
      "x-displayName": "流媒体"
    },
    {
      "name": "Sessions",
      "description": "会话历史和观众分析。",
      "x-displayName": "会话"
    }
  ],
  "security": [
    {
      "ApiKeyBearer": []
    }
  ],
  "paths": {
    "/v1/church/{churchId}/devices": {
      "get": {
        "operationId": "listDevices",
        "summary": "列出设备",
        "tags": [
          "Devices"
        ],
        "description": "列出 Kaleo Connect 设备及其功能准备状态。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Devices"
                },
                "example": {
                  "devices": [
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "Sanctuary Mac",
                      "status": "online",
                      "capabilities": [
                        {
                          "capability": "audio-source",
                          "status": "ready"
                        },
                        {
                          "capability": "audio-output",
                          "status": "ready"
                        },
                        {
                          "capability": "propresenter",
                          "status": "unavailable"
                        }
                      ],
                      "lastSeenAt": null
                    }
                  ]
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "DEVICES_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "List devices"
      }
    },
    "/v1/church/{churchId}/devices/{deviceId}": {
      "get": {
        "operationId": "getDevice",
        "summary": "获取设备",
        "tags": [
          "Devices"
        ],
        "description": "读取单个 Kaleo Connect 设备及其功能准备状态。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "设备 ID，来自 `GET /devices`。"
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceDetails"
                },
                "example": {
                  "device": {
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac",
                    "status": "online",
                    "capabilities": [
                      {
                        "capability": "audio-source",
                        "status": "ready"
                      },
                      {
                        "capability": "audio-output",
                        "status": "ready"
                      },
                      {
                        "capability": "propresenter",
                        "status": "unavailable"
                      }
                    ],
                    "lastSeenAt": null
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "404": {
            "description": "该设备在此教会中不存在。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "DEVICE_NOT_FOUND"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "DEVICES_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Get device"
      }
    },
    "/v1/church/{churchId}/streaming": {
      "get": {
        "operationId": "getStreaming",
        "summary": "获取流媒体状态",
        "tags": [
          "Streaming"
        ],
        "description": "读取当前会话和共享教会设置。所有字段均存在，包括空闲时。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Get streaming status"
      }
    },
    "/v1/church/{churchId}/streaming/start": {
      "post": {
        "operationId": "startStreaming",
        "summary": "开始流媒体",
        "tags": [
          "Streaming"
        ],
        "description": "使用保存的设置在 Kaleo Connect 设备上开始流媒体。可选请求体可选择 `deviceId` 并覆盖本次会话的设置。若无 `deviceId`，当有多个支持音频的设备时，Kaleo 会选择仪表板中“集成”下 [Kaleo Connect](https://app.withkaleo.com/to/integrations/connect) 页面配置的默认音频源；若仅有一个设备，则使用该设备。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "格式错误的 JSON、不支持的字段或无效值。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "403": {
            "description": "计划、语言或使用限制阻止本次开始。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "PLAN_LIMIT"
                }
              }
            }
          },
          "409": {
            "description": "活动会话冲突，缺少音频源或默认选择，或所选设备未准备好。请读取流媒体状态和设备准备状态；在仪表板中“集成”下的 [Kaleo Connect](https://app.withkaleo.com/to/integrations/connect) 页面选择默认设备，或在需要时提供 `deviceId`。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "ACTIVE_SESSION"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartStreaming"
              },
              "examples": {
                "defaultAudioSource": {
                  "summary": "使用默认音频源",
                  "value": {}
                },
                "explicitDevice": {
                  "summary": "为此会话选择设备",
                  "value": {
                    "deviceId": "00000000-0000-4000-8000-000000000002"
                  }
                }
              }
            }
          },
          "description": "省略请求体或发送 `{}` 以使用默认音频源和保存的设置。发送 `deviceId` 以为本次会话选择其他设备。"
        },
        "x-kaleo-anchor": "Start streaming"
      }
    },
    "/v1/church/{churchId}/streaming/stop": {
      "post": {
        "operationId": "stopStreaming",
        "summary": "停止流媒体",
        "tags": [
          "Streaming"
        ],
        "description": "停止当前流媒体会话。无需请求体。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": false,
                  "sessionId": null,
                  "startedAt": null,
                  "deadlineAt": null,
                  "speakerLanguage": null,
                  "targetLanguages": [],
                  "voice": "male",
                  "visible": true,
                  "publisher": null,
                  "phase": "idle",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Stop streaming"
      }
    },
    "/v1/church/{churchId}/streaming/voice": {
      "patch": {
        "operationId": "changeVoice",
        "summary": "更改翻译语音",
        "tags": [
          "Streaming"
        ],
        "description": "在空闲或流媒体时更改翻译语音。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "female",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "格式错误的 JSON、不支持的字段或无效值。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "409": {
            "description": "流媒体已更改或命令无法确认。发送新命令前请读取当前流媒体状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "SESSION_CHANGED"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeVoice"
              },
              "example": {
                "voice": "female"
              }
            }
          }
        },
        "x-kaleo-anchor": "Change translation voice"
      }
    },
    "/v1/church/{churchId}/streaming/visibility": {
      "patch": {
        "operationId": "changeVisibility",
        "summary": "更改可见性",
        "tags": [
          "Streaming"
        ],
        "description": "在空闲或流媒体时显示或隐藏字幕。隐藏字幕不会停止会话。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": false,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "格式错误的 JSON、不支持的字段或无效值。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeVisibility"
              },
              "example": {
                "visible": false
              }
            }
          }
        },
        "x-kaleo-anchor": "Change visibility"
      }
    },
    "/v1/church/{churchId}/streaming/captions/clear": {
      "post": {
        "operationId": "clearCaptions",
        "summary": "清除字幕",
        "tags": [
          "Streaming"
        ],
        "description": "清除当前字幕流。无需请求体。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Clear captions"
      }
    },
    "/v1/church/{churchId}/streaming/deadline": {
      "patch": {
        "operationId": "changeDeadline",
        "summary": "更改自动停止截止时间",
        "tags": [
          "Streaming"
        ],
        "description": "设置活动会话的自动停止时间。返回更新后的流媒体状态。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "格式错误的 JSON、不支持的字段或无效值。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "409": {
            "description": "`STREAM_OFFLINE`（空闲时）；`INVALID_DEADLINE`（截止时间超出允许范围）。发送新命令前请读取当前流媒体状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_DEADLINE"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeDeadline"
              },
              "example": {
                "deadlineAt": "2026-10-08T16:00:00Z"
              }
            }
          }
        },
        "x-kaleo-anchor": "Change auto-stop deadline"
      }
    },
    "/v1/church/{churchId}/sessions": {
      "get": {
        "operationId": "listSessions",
        "summary": "列出会话",
        "tags": [
          "Sessions"
        ],
        "description": "列出会话，最新优先，包含观众分析。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": "页码，从 1 开始。超过最后一页的值返回最后一页。"
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 14
            },
            "description": "每页会话数。超过 100 的值使用 100。"
          },
          {
            "name": "startedAfter",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "包含在此时间或之后开始的会话。包含 Z 或时区偏移。"
          },
          {
            "name": "startedBefore",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "包含在此时间或之前开始的会话。包含 Z 或时区偏移。必须在 `startedAfter` 之后或等于。"
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryPage"
                },
                "example": {
                  "sessions": [
                    {
                      "sessionId": "00000000-0000-4000-8000-000000000001",
                      "startedAt": "2026-10-04T14:00:00.000Z",
                      "endedAt": "2026-10-04T15:00:00.000Z",
                      "duration": 3600,
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "transcriptAvailable": true,
                      "publicSharingEnabled": false,
                      "analytics": {
                        "sessionId": "00000000-0000-4000-8000-000000000001",
                        "status": "finalized",
                        "viewers": 12,
                        "viewerLanguages": {
                          "en": 8,
                          "fr-FR": 6
                        }
                      }
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "pageSize": 14
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "读取响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "无效的正整数分页或无效/反向时间戳范围。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_HISTORY_RANGE"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是教会成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "历史或认证服务不可用。非空历史结果。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "SESSION_HISTORY_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "List sessions"
      }
    },
    "/v1/church/{churchId}/sessions/{sessionId}": {
      "get": {
        "operationId": "getSession",
        "summary": "获取会话",
        "tags": [
          "Sessions"
        ],
        "description": "读取单个会话及其观众分析。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "会话 ID，来自 `GET /sessions`。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetails"
                },
                "example": {
                  "session": {
                    "sessionId": "00000000-0000-4000-8000-000000000001",
                    "startedAt": "2026-10-04T14:00:00.000Z",
                    "endedAt": "2026-10-04T15:00:00.000Z",
                    "duration": 3600,
                    "speakerLanguage": "en",
                    "targetLanguages": [
                      "fr-FR"
                    ],
                    "transcriptAvailable": true,
                    "publicSharingEnabled": false,
                    "analytics": {
                      "sessionId": "00000000-0000-4000-8000-000000000001",
                      "status": "finalized",
                      "viewers": 12,
                      "viewerLanguages": {
                        "en": 8,
                        "fr-FR": 6
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "读取响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是教会成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "404": {
            "description": "缺失、已删除、无效 ID 或归属不同的会话。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "SESSION_NOT_FOUND"
                }
              }
            }
          },
          "503": {
            "description": "历史或认证服务不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "SESSION_HISTORY_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Get session"
      }
    },
    "/v1/church/{churchId}/languages/speaker": {
      "get": {
        "operationId": "listSpeakerLanguages",
        "summary": "列出发言语言",
        "tags": [
          "Languages"
        ],
        "description": "列出支持的发言语言。在 `speakerLanguage` 中使用这些代码。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Languages"
                },
                "example": {
                  "languages": [
                    {
                      "code": "en",
                      "name": "English",
                      "nativeName": "English",
                      "emoji": "🌎"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "认证服务暂时不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "AUTHENTICATION_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "List speaker languages"
      }
    },
    "/v1/church/{churchId}/languages/target": {
      "get": {
        "operationId": "listTargetLanguages",
        "summary": "列出目标语言",
        "tags": [
          "Languages"
        ],
        "description": "列出支持的翻译语言。在 `targetLanguages` 中使用这些代码。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Languages"
                },
                "example": {
                  "languages": [
                    {
                      "code": "en",
                      "name": "English",
                      "nativeName": "English",
                      "emoji": "🌎"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "503": {
            "description": "认证服务暂时不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "AUTHENTICATION_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "List target languages"
      }
    },
    "/v1/church/{churchId}/languages/{code}": {
      "get": {
        "operationId": "getLanguage",
        "summary": "获取语言",
        "tags": [
          "Languages"
        ],
        "description": "读取一个支持的语言代码的名称和表情符号。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "精确语言代码，例如 `en` 或 `zh-Hans`。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LanguageDetails"
                },
                "example": {
                  "language": {
                    "code": "fr",
                    "name": "French (General)",
                    "nativeName": "Français",
                    "emoji": "🇫🇷"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "404": {
            "description": "不支持的语言代码。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "LANGUAGE_NOT_FOUND"
                }
              }
            }
          },
          "503": {
            "description": "认证服务暂时不可用。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "AUTHENTICATION_UNAVAILABLE"
                }
              }
            }
          }
        },
        "x-kaleo-anchor": "Get language"
      }
    },
    "/v1/church/{churchId}/streaming/deadline/adjust": {
      "post": {
        "operationId": "adjustDeadline",
        "summary": "调整自动停止时间",
        "tags": [
          "Streaming"
        ],
        "description": "增加或减少自动停止时间。空闲时更改下次手动开始的持续时间；流媒体时更改当前截止时间。每个请求应用单独调整。",
        "parameters": [
          {
            "name": "churchId",
            "in": "path",
            "required": true,
            "description": "您的教会 ID。从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制。",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamingStatus"
                },
                "example": {
                  "streaming": true,
                  "sessionId": "00000000-0000-4000-8000-000000000001",
                  "startedAt": "2026-10-08T14:00:00.000Z",
                  "deadlineAt": "2026-10-08T16:00:00.000Z",
                  "speakerLanguage": "en",
                  "targetLanguages": [
                    "fr-FR"
                  ],
                  "voice": "male",
                  "visible": true,
                  "publisher": {
                    "kind": "connect",
                    "id": "00000000-0000-4000-8000-000000000002",
                    "name": "Sanctuary Mac"
                  },
                  "phase": "streaming",
                  "streamSettings": {
                    "revision": 4,
                    "settings": {
                      "speakerLanguage": "en",
                      "targetLanguages": [
                        "fr-FR"
                      ],
                      "duration": 3600
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "响应不缓存。",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "格式错误的 JSON、不支持的字段或无效值。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_REQUEST"
                }
              }
            }
          },
          "401": {
            "description": "缺失或无效的 API 密钥，包括过期、撤销、错误教会或创建者不再是成员。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "API_KEY_INVALID"
                }
              }
            }
          },
          "409": {
            "description": "`INVALID_DEADLINE`（直播截止时间超出允许范围）；`DEADLINE_NOT_SET`（会话无截止时间）；`SETTINGS_CHANGED` 或 `SESSION_ACTIVE`（空闲设置或入场同时更改）。发送新命令前请读取当前流媒体状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "INVALID_DEADLINE"
                }
              }
            }
          },
          "503": {
            "description": "临时服务或认证失败。重试控制请求前请先同步状态。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "success": false,
                  "error": "CONTROL_UNAVAILABLE"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustDeadline"
              },
              "example": {
                "deltaSeconds": 120
              }
            }
          }
        },
        "x-kaleo-anchor": "Adjust auto-stop time"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "请输入您从仪表板中“集成”下的 [API](https://app.withkaleo.com/to/integrations/api) 页面复制的 API 密钥。Bearer 会自动添加。密钥适用于一个教会，前提是其创建者仍为成员。"
      }
    },
    "schemas": {
      "Device": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "设备 ID。在请求中传递此值作为 `deviceId`。"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "offline",
              "online",
              "maintenance"
            ],
            "description": "连接状态。90 秒无联系则离线；维护中表示暂时不可用。"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeviceCapability"
            },
            "description": "该设备各功能的准备状态。"
          },
          "lastSeenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "与 Kaleo 的最后联系时间；未知时为 `null`。"
          }
        },
        "required": [
          "id",
          "name",
          "status",
          "capabilities",
          "lastSeenAt"
        ],
        "additionalProperties": false
      },
      "DeviceCapability": {
        "type": "object",
        "properties": {
          "capability": {
            "type": "string",
            "enum": [
              "audio-source",
              "audio-output",
              "propresenter"
            ],
            "description": "本地功能：音频采集、翻译语音播放或 ProPresenter 幻灯片输入。"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "unavailable",
              "offline"
            ],
            "description": "该功能是否准备就绪。"
          }
        },
        "required": [
          "capability",
          "status"
        ],
        "additionalProperties": false
      },
      "Devices": {
        "type": "object",
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Device"
            }
          }
        },
        "required": [
          "devices"
        ],
        "additionalProperties": false
      },
      "DeviceDetails": {
        "type": "object",
        "properties": {
          "device": {
            "$ref": "#/components/schemas/Device"
          }
        },
        "required": [
          "device"
        ],
        "additionalProperties": false
      },
      "ProPresenterSelection": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "default"
                ],
                "description": "使用教会默认的 ProPresenter 设备。"
              }
            },
            "required": [
              "mode"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "none"
                ],
                "description": "本次会话不使用 ProPresenter。"
              }
            },
            "required": [
              "mode"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "device"
                ],
                "description": "使用由 `deviceId` 指定的设备。"
              },
              "deviceId": {
                "type": "string",
                "description": "ProPresenter 源设备 ID，来自 `GET /devices`。可能与音频源不同。"
              }
            },
            "required": [
              "mode",
              "deviceId"
            ],
            "additionalProperties": false
          }
        ],
        "description": "为本次会话选择 ProPresenter 源。在 Connect 中配置其连接。"
      },
      "StartStreaming": {
        "type": "object",
        "properties": {
          "deviceId": {
            "type": "string",
            "description": "可选的音频源设备 ID，来自 `GET /devices`。覆盖教会默认设置，仅限本次会话。若省略，则使用保存的默认音频源或唯一支持音频的配对设备；若有多个设备且无默认，则需选择。所选设备必须处于准备就绪状态。"
          },
          "overrides": {
            "type": "object",
            "properties": {
              "speakerLanguage": {
                "type": "string",
                "description": "来自 `GET /languages/speaker` 的代码。多语言模式使用 `\"mul\"`。"
              },
              "targetLanguages": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "description": "来自 `GET /languages/target` 的代码。使用 `[\"ALL\"]` 选择所有支持的目标语言，受计划限制。"
              },
              "duration": {
                "type": "integer",
                "minimum": 60,
                "maximum": 21600,
                "description": "自动停止时间，单位为秒。"
              },
              "proPresenter": {
                "$ref": "#/components/schemas/ProPresenterSelection"
              }
            },
            "required": [],
            "additionalProperties": false,
            "description": "仅限本次会话的设置。省略字段使用保存的默认值。"
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "ChangeVoice": {
        "type": "object",
        "properties": {
          "voice": {
            "type": "string",
            "enum": [
              "male",
              "female"
            ],
            "description": "翻译语音。可在空闲或流媒体时更改。"
          }
        },
        "required": [
          "voice"
        ],
        "additionalProperties": false
      },
      "ChangeVisibility": {
        "type": "object",
        "properties": {
          "visible": {
            "type": "boolean",
            "description": "`true` 显示字幕；`false` 隐藏字幕，流媒体继续。"
          }
        },
        "required": [
          "visible"
        ],
        "additionalProperties": false
      },
      "ChangeDeadline": {
        "type": "object",
        "properties": {
          "deadlineAt": {
            "type": "string",
            "format": "date-time",
            "description": "未来自动停止时间，包含 Z 或时区偏移。不晚于 `startedAt` 后六小时。"
          }
        },
        "required": [
          "deadlineAt"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "success",
          "error"
        ]
      },
      "Analytics": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "live",
              "pending",
              "finalized"
            ],
            "description": "`live`：临时计数；`pending`：等待最终计数；`finalized`：已保存计数。"
          },
          "viewers": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "会话的唯一观众身份，不是当前观众。不可用时为 `null`；0 表示无观众。"
          },
          "viewerLanguages": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            },
            "description": "按语言代码的观众分析。一个观众可能出现在多个语言中。不可用时为 `null`。"
          }
        },
        "required": [
          "sessionId",
          "status",
          "viewers",
          "viewerLanguages"
        ]
      },
      "HistorySession": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "会话结束时间；未完成或不可用时为 `null`。"
          },
          "duration": {
            "type": "integer",
            "nullable": true,
            "description": "记录的会话时长（秒）；未完成或不可用时为 `null`。"
          },
          "speakerLanguage": {
            "type": "string",
            "nullable": true,
            "description": "发言语言代码；未记录时为 `null`。"
          },
          "targetLanguages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "记录的翻译语言代码，或 `[\"ALL\"]`。"
          },
          "transcriptAvailable": {
            "type": "boolean",
            "description": "保存的文字稿准备好时为 `true`。不授予公开访问或下载链接。"
          },
          "publicSharingEnabled": {
            "type": "boolean",
            "description": "完成会话启用公开分享时为 `true`。"
          },
          "analytics": {
            "$ref": "#/components/schemas/Analytics"
          }
        },
        "required": [
          "sessionId",
          "startedAt",
          "endedAt",
          "duration",
          "speakerLanguage",
          "targetLanguages",
          "transcriptAvailable",
          "publicSharingEnabled",
          "analytics"
        ]
      },
      "HistoryPage": {
        "type": "object",
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistorySession"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "符合筛选条件的会话总数，跨所有页面。"
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "返回的页码；可能低于请求页码。"
          },
          "pageSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "每页最大会话数，最多 100。"
          }
        },
        "required": [
          "sessions",
          "total",
          "page",
          "pageSize"
        ]
      },
      "SessionDetails": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/HistorySession"
          }
        },
        "required": [
          "session"
        ]
      },
      "Language": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "在语言字段中使用此精确代码。"
          },
          "name": {
            "type": "string",
            "description": "英文显示名称。"
          },
          "nativeName": {
            "type": "string",
            "description": "该语言的本地名称；不可用时为英文名称。"
          },
          "emoji": {
            "type": "string",
            "description": "该语言的显示表情符号。"
          }
        },
        "required": [
          "code",
          "name",
          "nativeName",
          "emoji"
        ],
        "additionalProperties": false
      },
      "Languages": {
        "type": "object",
        "properties": {
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Language"
            }
          }
        },
        "required": [
          "languages"
        ],
        "additionalProperties": false
      },
      "LanguageDetails": {
        "type": "object",
        "properties": {
          "language": {
            "$ref": "#/components/schemas/Language"
          }
        },
        "required": [
          "language"
        ],
        "additionalProperties": false
      },
      "StreamingStatus": {
        "type": "object",
        "properties": {
          "streaming": {
            "type": "boolean",
            "description": "`true` 表示活动会话，包括启动、重连和关闭。不确认音频是否到达。"
          },
          "sessionId": {
            "type": "string",
            "nullable": true,
            "description": "当前会话 ID；空闲时为 `null`。"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "当前会话开始时间；空闲时为 `null`。"
          },
          "deadlineAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "自动停止时间；空闲时或无截止时间记录时为 `null`。"
          },
          "speakerLanguage": {
            "type": "string",
            "nullable": true,
            "description": "当前发言语言代码；空闲时为 `null`。"
          },
          "targetLanguages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "当前翻译语言代码；空闲时为空。"
          },
          "voice": {
            "type": "string",
            "enum": [
              "male",
              "female",
              null
            ],
            "nullable": false,
            "description": "翻译语音，包括空闲时。"
          },
          "visible": {
            "type": "boolean",
            "description": "`true` 显示字幕；`false` 隐藏字幕。空闲时同样适用。"
          },
          "publisher": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "browser",
                  "connect"
                ]
              },
              "id": {
                "type": "string",
                "description": "当 `kind` 为 `connect` 时为设备 ID；当 `kind` 为 `browser` 时为浏览器发布者 ID。"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "id",
              "name"
            ],
            "additionalProperties": false,
            "nullable": true,
            "description": "发送音频的 Kaleo Connect 设备或浏览器；空闲时为 `null`。"
          },
          "phase": {
            "type": "string",
            "enum": [
              "idle",
              "starting",
              "streaming",
              "reconnecting",
              "ending"
            ],
            "description": "会话阶段；空闲表示无活动会话。"
          },
          "streamSettings": {
            "type": "object",
            "description": "下次手动开始的教会默认设置。活动会话的覆盖不改变这些值。",
            "required": [
              "revision",
              "settings"
            ],
            "properties": {
              "revision": {
                "type": "integer",
                "minimum": 0,
                "description": "当这些默认设置更改时递增。"
              },
              "settings": {
                "type": "object",
                "required": [
                  "speakerLanguage",
                  "targetLanguages",
                  "duration"
                ],
                "properties": {
                  "speakerLanguage": {
                    "type": "string",
                    "description": "默认发言语言代码。"
                  },
                  "targetLanguages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "默认翻译语言代码；`[\"ALL\"]` 选择所有支持的目标语言。"
                  },
                  "duration": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 21600,
                    "description": "自动停止时间，单位为秒。"
                  }
                }
              }
            }
          }
        },
        "required": [
          "streaming",
          "phase",
          "sessionId",
          "startedAt",
          "deadlineAt",
          "speakerLanguage",
          "targetLanguages",
          "voice",
          "visible",
          "publisher",
          "streamSettings"
        ],
        "additionalProperties": false,
        "description": "当前会话和共享教会设置。所有字段均存在，包括空闲时。"
      },
      "AdjustDeadline": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deltaSeconds"
        ],
        "properties": {
          "deltaSeconds": {
            "type": "integer",
            "minimum": -21600,
            "maximum": 21600,
            "description": "增加或减少空闲持续时间或当前截止时间的秒数；负值表示减少。不能为 0。空闲持续时间：60–21600 秒。直播截止时间：未来，且在 `startedAt` 后六小时内。",
            "not": {
              "enum": [
                0
              ]
            }
          }
        }
      }
    }
  }
}
