{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "聆溪智译开放 API",
    "version": "1.0.0",
    "summary": "单视频人声分离、字幕识别、字幕翻译、AI 配音和自动译制 API",
    "description": "聆溪智译开放 API V1 只暴露业务资源，不暴露内部项目、剧集、分集、\n通用任务、音色目录或视频导出资源。\n\nAPI 密钥功能仅在当前工作区所有者的账户已开通有效企业版时开放。\n套餐属于账户，并通过所有者的工作区向受邀用户共享。企业版当前媒体\n任务并发额度为 15，由该工作区的全部 API Key 共享。\n\n所有业务创建接口都是异步接口，返回 HTTP 202。创建成功只表示任务已经\n持久化并进入处理流程；最终结果通过同业务资源的 GET 接口或终态 Webhook 获取。\n\n请求必须同时携带 X-Lingxi-Key、X-Lingxi-Timestamp、X-Lingxi-Nonce 和\nX-Lingxi-Signature。签名算法、幂等、Webhook 和计费语义见同目录 contract.md。\n\n自动译制成功时只返回最终 MP4；单能力只返回该能力的结果。API 不返回质量报告。\n",
    "contact": {
      "name": "聆溪智译 API 支持",
      "url": "https://lynsey.cn/api"
    },
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    },
    "x-audience": "external",
    "x-docs-url": "https://lynsey.cn/api/docs"
  },
  "externalDocs": {
    "description": "聆溪智译 API 开发文档",
    "url": "https://lynsey.cn/api/docs"
  },
  "servers": [
    {
      "url": "https://{api_host}/v1",
      "description": "将 api_host 替换为聆溪随 API 凭证提供的主机名",
      "variables": {
        "api_host": {
          "default": "api.example.invalid",
          "description": "API Host；不要把示例值用于实际请求"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Credits",
      "description": "积分余额、密钥月额度与消费流水"
    },
    {
      "name": "Uploads",
      "description": "预签名素材直传"
    },
    {
      "name": "Audio Separations",
      "description": "人声与背景声双轨分离"
    },
    {
      "name": "Subtitle Recognitions",
      "description": "从视频人声识别字幕"
    },
    {
      "name": "Subtitle Translations",
      "description": "翻译已有字幕"
    },
    {
      "name": "Dubbings",
      "description": "根据目标语言字幕生成配音音轨"
    },
    {
      "name": "Auto Localizations",
      "description": "从原视频直接生成目标语言 MP4"
    }
  ],
  "security": [
    {
      "LingxiApiKey": [],
      "LingxiTimestamp": [],
      "LingxiNonce": [],
      "LingxiSignature": []
    }
  ],
  "paths": {
    "/credits": {
      "get": {
        "operationId": "getCredits",
        "tags": [
          "Credits"
        ],
        "summary": "查询积分与密钥额度",
        "description": "返回当前工作区使用的账户积分及当前密钥的月额度，不创建独立 API 钱包。\navailable_credits 扣除预占并排除过期积分；可能小于 balance_credits 减 reserved_credits。\n月用量包含本月创建业务已扣费和仍占用额度的预占（含待确认项），释放后不计入。\n月份按 Asia/Shanghai 自然月计算；limit_credits 和 remaining_credits 为 null 表示未单独限制密钥额度，不代表账户积分无限。\n本接口不接受查询参数，不返回账户身份或其他密钥信息。\n",
        "responses": {
          "200": {
            "description": "积分余额及密钥额度",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditBalance"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/credit-transactions": {
      "get": {
        "operationId": "listCreditTransactions",
        "tags": [
          "Credits"
        ],
        "summary": "查询 API 消费流水",
        "description": "只返回当前密钥创建且仍有能力权限的业务所关联的已入账积分流水。\n不返回整个账户的充值、网站消费或其他密钥记录。amount 为有符号积分变动，负数表示扣减。\n预占释放不是已扣费退款，不生成虚拟退款流水；预占和结算状态通过业务详情的 billing 查询。\n按流水入账时间倒序分页，时间范围左闭右开。未入账的消费不会提前显示。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          }
        ],
        "responses": {
          "200": {
            "description": "分页消费流水",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditTransactionList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/uploads": {
      "get": {
        "operationId": "listUploads",
        "tags": [
          "Uploads"
        ],
        "summary": "查询上传文件列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "waiting_for_upload",
                "validating",
                "ready",
                "failed",
                "expired"
              ]
            }
          },
          {
            "name": "purpose",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "source_video",
                "subtitle_file"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createUpload",
        "tags": [
          "Uploads"
        ],
        "summary": "申请预签名上传",
        "description": "创建上传预约并返回直传地址。客户端完成对象存储直传后，必须调用\n`/uploads/{upload_id}/completions`；申请成功不表示素材已经可用于业务任务。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "上传预约已创建",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                },
                "description": "新上传资源的相对地址"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/uploads/{upload_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/UploadId"
        }
      ],
      "get": {
        "operationId": "getUpload",
        "tags": [
          "Uploads"
        ],
        "summary": "查询上传和素材准备状态",
        "description": "只有 `status=ready` 的上传资源可以作为业务请求输入。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "上传资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/uploads/{upload_id}/completions": {
      "parameters": [
        {
          "$ref": "#/components/parameters/UploadId"
        }
      ],
      "post": {
        "operationId": "completeUpload",
        "tags": [
          "Uploads"
        ],
        "summary": "确认直传完成",
        "description": "提交对象 ETag 并开始服务端媒体校验。该操作不会创建业务任务。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteUploadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "素材此前已通过校验，可直接作为业务请求输入",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "202": {
            "description": "已接受素材校验",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/audio-separations": {
      "get": {
        "operationId": "listAudioSeparations",
        "tags": [
          "Audio Separations"
        ],
        "summary": "查询人声分离列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessJobList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createAudioSeparation",
        "tags": [
          "Audio Separations"
        ],
        "summary": "创建人声分离",
        "description": "把一个视频分离为人声音轨和背景声音轨，不返回处理后视频。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAudioSeparationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "人声分离已受理",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioSeparation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/audio-separations/{audio_separation_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AudioSeparationId"
        }
      ],
      "get": {
        "operationId": "getAudioSeparation",
        "tags": [
          "Audio Separations"
        ],
        "summary": "查询人声分离",
        "description": "成功时读取 `result.vocal_audio` 和 `result.background_audio`。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "人声分离资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioSeparation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "cancelAudioSeparation",
        "tags": [
          "Audio Separations"
        ],
        "summary": "取消人声分离",
        "description": "只允许取消 `queued` 或 `processing` 资源；记录不会被物理删除。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "202": {
            "description": "已接受取消请求",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioSeparation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/subtitle-recognitions": {
      "get": {
        "operationId": "listSubtitleRecognitions",
        "tags": [
          "Subtitle Recognitions"
        ],
        "summary": "查询字幕识别列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessJobList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createSubtitleRecognition",
        "tags": [
          "Subtitle Recognitions"
        ],
        "summary": "创建字幕识别",
        "description": "从一个视频的人声识别字幕；不生成视频或配音。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubtitleRecognitionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "字幕识别已受理",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleRecognition"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/subtitle-recognitions/{subtitle_recognition_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SubtitleRecognitionId"
        }
      ],
      "get": {
        "operationId": "getSubtitleRecognition",
        "tags": [
          "Subtitle Recognitions"
        ],
        "summary": "查询字幕识别",
        "description": "成功时返回 UTF-8 SRT 和同一份字幕的结构化行数据。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "字幕识别资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleRecognition"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "cancelSubtitleRecognition",
        "tags": [
          "Subtitle Recognitions"
        ],
        "summary": "取消字幕识别",
        "description": "只允许取消 `queued` 或 `processing` 资源；记录不会被物理删除。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "202": {
            "description": "已接受取消请求",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleRecognition"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/subtitle-translations": {
      "get": {
        "operationId": "listSubtitleTranslations",
        "tags": [
          "Subtitle Translations"
        ],
        "summary": "查询字幕翻译列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessJobList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createSubtitleTranslation",
        "tags": [
          "Subtitle Translations"
        ],
        "summary": "创建字幕翻译",
        "description": "翻译已有字幕；不创建视频、配音、质量报告或术语报告。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubtitleTranslationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "字幕翻译已受理",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleTranslation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/subtitle-translations/{subtitle_translation_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/SubtitleTranslationId"
        }
      ],
      "get": {
        "operationId": "getSubtitleTranslation",
        "tags": [
          "Subtitle Translations"
        ],
        "summary": "查询字幕翻译",
        "description": "成功时返回译后 SRT 和结构化字幕行。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "字幕翻译资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleTranslation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "cancelSubtitleTranslation",
        "tags": [
          "Subtitle Translations"
        ],
        "summary": "取消字幕翻译",
        "description": "只允许取消 `queued` 或 `processing` 资源；记录不会被物理删除。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "202": {
            "description": "已接受取消请求",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubtitleTranslation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/dubbings": {
      "get": {
        "operationId": "listDubbings",
        "tags": [
          "Dubbings"
        ],
        "summary": "查询 AI 配音列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessJobList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createDubbing",
        "tags": [
          "Dubbings"
        ],
        "summary": "创建 AI 配音",
        "description": "根据目标语言字幕自动分配音色并生成一条对齐时间轴的 WAV 音轨。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDubbingRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "AI 配音已受理",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dubbing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/dubbings/{dubbing_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/DubbingId"
        }
      ],
      "get": {
        "operationId": "getDubbing",
        "tags": [
          "Dubbings"
        ],
        "summary": "查询 AI 配音",
        "description": "成功时只返回配音 WAV 音轨。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "AI 配音资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dubbing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "cancelDubbing",
        "tags": [
          "Dubbings"
        ],
        "summary": "取消 AI 配音",
        "description": "只允许取消 `queued` 或 `processing` 资源；记录不会被物理删除。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "202": {
            "description": "已接受取消请求",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dubbing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/auto-localizations": {
      "get": {
        "operationId": "listAutoLocalizations",
        "tags": [
          "Auto Localizations"
        ],
        "summary": "查询自动译制列表",
        "description": "返回当前密钥创建的记录，不包含其他密钥或网站中创建的内容。按创建时间倒序排列。\n列表返回摘要；通过 detail_url 查询单条资源及其结果。下载地址仍受有效期限制。\n时间筛选为 created_after（包含）至 created_before（不包含）；下一页须保留原筛选条件。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/ListLimit"
          },
          {
            "$ref": "#/components/parameters/ListCursor"
          },
          {
            "$ref": "#/components/parameters/CreatedAfter"
          },
          {
            "$ref": "#/components/parameters/CreatedBefore"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/JobStatus"
            }
          },
          {
            "name": "client_reference",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "分页列表（没有记录时 data 为空数组）",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessJobList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "createAutoLocalization",
        "tags": [
          "Auto Localizations"
        ],
        "summary": "创建自动译制",
        "description": "执行人声分离、字幕识别、翻译、配音和内部视频导出，最终只返回 MP4。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAutoLocalizationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "自动译制已受理",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoLocalization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/auto-localizations/{auto_localization_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/AutoLocalizationId"
        }
      ],
      "get": {
        "operationId": "getAutoLocalization",
        "tags": [
          "Auto Localizations"
        ],
        "summary": "查询自动译制",
        "description": "成功时只返回最终 MP4，不返回中间字幕、音频或质量报告。",
        "parameters": [
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "200": {
            "description": "自动译制资源",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoLocalization"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "cancelAutoLocalization",
        "tags": [
          "Auto Localizations"
        ],
        "summary": "取消自动译制",
        "description": "停止启动新的内部阶段；已经安全持久化的内部成果不会被清空。",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/ClientRequestId"
          }
        ],
        "responses": {
          "202": {
            "description": "已接受取消请求",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotency-Replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoLocalization"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "webhooks": {
    "businessJobTerminal": {
      "post": {
        "operationId": "receiveBusinessJobTerminalWebhook",
        "summary": "接收业务资源终态通知",
        "description": "聆溪向创建请求中的 callback_url 发送此请求。接收方必须使用独立的\nwebhook_secret 对原始请求体验签，并按 event_id 幂等处理。\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookEventId"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "已接收；任意 2xx 都视为成功"
          },
          "400": {
            "description": "请求无法处理，聆溪将按策略重试"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "LingxiApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Lingxi-Key",
        "description": "开发者中心创建的 API Key；Secret 不随请求发送。"
      },
      "LingxiTimestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Lingxi-Timestamp",
        "description": "Unix 秒时间戳，允许与服务器时间相差最多 300 秒。"
      },
      "LingxiNonce": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Lingxi-Nonce",
        "description": "单次随机 Nonce，同一 API Key 下 10 分钟内不得重复。"
      },
      "LingxiSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Lingxi-Signature",
        "description": "规范请求使用 API Secret 计算的 HMAC-SHA256 小写十六进制签名。"
      }
    },
    "parameters": {
      "ListLimit": {
        "name": "limit",
        "in": "query",
        "description": "每页条数，默认 20，最大 50。未知参数、重复参数和无效参数会返回 400。",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 20
        }
      },
      "ListCursor": {
        "name": "cursor",
        "in": "query",
        "description": "上一页 next_cursor。原样传回并保留相同筛选条件；不要解析、修改或跨密钥使用。列表为实时查询，不冻结状态快照。",
        "schema": {
          "type": "string",
          "maxLength": 1024
        }
      },
      "CreatedAfter": {
        "name": "created_after",
        "in": "query",
        "description": "创建时间下界（包含），必须带时区，且早于 created_before。",
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "example": "2026-09-01T00:00:00+08:00"
      },
      "CreatedBefore": {
        "name": "created_before",
        "in": "query",
        "description": "创建时间上界（不包含），必须带时区。",
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "example": "2026-10-01T00:00:00+08:00"
      },
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "一次业务意图及其所有重试共用的幂等键。",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "pattern": "^[A-Za-z0-9._:-]+$"
        },
        "example": "550e8400-e29b-41d4-a716-446655440000"
      },
      "ClientRequestId": {
        "name": "X-Client-Request-ID",
        "in": "header",
        "required": false,
        "description": "调用方生成的追踪 ID；不提供幂等保证。",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "example": "client-req-1001"
      },
      "UploadId": {
        "name": "upload_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/UploadId"
        }
      },
      "AudioSeparationId": {
        "name": "audio_separation_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/AudioSeparationId"
        }
      },
      "SubtitleRecognitionId": {
        "name": "subtitle_recognition_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/SubtitleRecognitionId"
        }
      },
      "SubtitleTranslationId": {
        "name": "subtitle_translation_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/SubtitleTranslationId"
        }
      },
      "DubbingId": {
        "name": "dubbing_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/DubbingId"
        }
      },
      "AutoLocalizationId": {
        "name": "auto_localization_id",
        "in": "path",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/AutoLocalizationId"
        }
      },
      "WebhookTimestamp": {
        "name": "X-Lingxi-Webhook-Timestamp",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{10}$"
        }
      },
      "WebhookEventId": {
        "name": "X-Lingxi-Webhook-Id",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^evt_[A-Za-z0-9_-]{16,80}$"
        }
      },
      "WebhookSignature": {
        "name": "X-Lingxi-Webhook-Signature",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "服务端生成的请求追踪 ID。",
        "schema": {
          "type": "string",
          "pattern": "^req_[A-Za-z0-9_-]+$"
        }
      },
      "IdempotencyReplayed": {
        "description": "`true` 表示返回的是同一幂等请求第一次创建的资源。",
        "schema": {
          "type": "boolean"
        }
      },
      "RateLimitLimit": {
        "description": "当前套餐在本窗口内的请求上限。",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimitRemaining": {
        "description": "当前窗口剩余请求数。",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RateLimitReset": {
        "description": "当前窗口重置时间，Unix 秒。",
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "schemas": {
      "ListEnvelope": {
        "type": "object",
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {}
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "无下一页时为 null"
          }
        }
      },
      "BusinessJobListItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "object",
          "status",
          "progress",
          "client_reference",
          "created_at",
          "updated_at",
          "detail_url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "enum": [
              "audio_separation",
              "subtitle_recognition",
              "subtitle_translation",
              "dubbing",
              "auto_localization"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "client_reference": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "detail_url": {
            "type": "string",
            "description": "同 API Host 下的相对资源路径，携带相同鉴权头查询结果"
          }
        }
      },
      "UploadListItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "object",
          "purpose",
          "file_name",
          "content_type",
          "size_bytes",
          "status",
          "created_at",
          "updated_at",
          "expires_at",
          "detail_url"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UploadId"
          },
          "object": {
            "type": "string",
            "const": "upload"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "source_video",
              "subtitle_file"
            ]
          },
          "file_name": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting_for_upload",
              "validating",
              "ready",
              "failed",
              "expired"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "detail_url": {
            "type": "string"
          }
        }
      },
      "BusinessJobList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessJobListItem"
                }
              }
            }
          }
        ]
      },
      "UploadList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UploadListItem"
                }
              }
            }
          }
        ]
      },
      "CreditBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "object",
          "balance_credits",
          "reserved_credits",
          "available_credits",
          "key_quota"
        ],
        "properties": {
          "object": {
            "type": "string",
            "const": "credit_balance"
          },
          "balance_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "账面积分余额"
          },
          "reserved_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "账户当前预占积分，包含非当前密钥的任务"
          },
          "available_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "排除过期积分并扣除预占后的可用积分"
          },
          "key_quota": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "limit_credits",
              "used_credits",
              "remaining_credits",
              "period_start",
              "period_end",
              "timezone"
            ],
            "properties": {
              "limit_credits": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "used_credits": {
                "type": "integer",
                "minimum": 0,
                "description": "本月创建业务的已扣费与尚占用的预占之和"
              },
              "remaining_credits": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "period_start": {
                "type": "string",
                "format": "date-time"
              },
              "period_end": {
                "type": "string",
                "format": "date-time"
              },
              "timezone": {
                "type": "string",
                "const": "Asia/Shanghai"
              }
            }
          }
        }
      },
      "CreditTransaction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "object",
          "type",
          "amount",
          "resource_id",
          "resource_type",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ctx_[a-f0-9]{32}$"
          },
          "object": {
            "type": "string",
            "const": "credit_transaction"
          },
          "type": {
            "type": "string",
            "description": "账本变动类型，consumption 表示消费，adjustment 表示调整"
          },
          "amount": {
            "type": "integer",
            "description": "有符号积分变动，负数表示扣减"
          },
          "resource_id": {
            "type": "string",
            "description": "关联的公开业务资源 ID"
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "audio_separation",
              "subtitle_recognition",
              "subtitle_translation",
              "dubbing",
              "auto_localization"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreditTransactionList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ListEnvelope"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CreditTransaction"
                }
              }
            }
          }
        ]
      },
      "UploadId": {
        "type": "string",
        "pattern": "^upl_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "upl_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "AudioSeparationId": {
        "type": "string",
        "pattern": "^asep_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "asep_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "SubtitleRecognitionId": {
        "type": "string",
        "pattern": "^asr_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "asr_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "SubtitleTranslationId": {
        "type": "string",
        "pattern": "^trn_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "trn_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "DubbingId": {
        "type": "string",
        "pattern": "^dub_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "dub_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "AutoLocalizationId": {
        "type": "string",
        "pattern": "^loc_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "loc_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "EventId": {
        "type": "string",
        "pattern": "^evt_[A-Za-z0-9_-]{16,80}$",
        "examples": [
          "evt_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
        ]
      },
      "LanguageCode": {
        "type": "string",
        "description": "BCP 47 风格语言代码。实际可用语言和语向由 API 凭证对应的能力矩阵决定；\n格式校验通过不代表该能力支持该语言组合。\n",
        "pattern": "^[a-z]{2,3}(?:-[A-Z]{2})?$",
        "maxLength": 16,
        "examples": [
          "zh-CN",
          "en-US"
        ]
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "queued",
          "processing",
          "succeeded",
          "failed",
          "cancelled"
        ]
      },
      "BillingState": {
        "type": "string",
        "enum": [
          "reserved",
          "settlement_pending",
          "settled",
          "released",
          "unknown"
        ]
      },
      "ClientMetadata": {
        "type": "object",
        "description": "调用方自定义元数据；用于关联请求，不参与处理，也不会在业务资源响应中返回。",
        "maxProperties": 20,
        "propertyNames": {
          "minLength": 1,
          "maxLength": 80
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 255
        },
        "examples": [
          {
            "campaign": "autumn-launch",
            "tenant_order": "order-1001"
          }
        ]
      },
      "CallbackUrl": {
        "type": "string",
        "format": "uri",
        "pattern": "^https://",
        "maxLength": 2048,
        "description": "可选终态 Webhook 地址；必须是通过 SSRF 校验的公网 HTTPS URL。"
      },
      "ClientReference": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[^\\u0000-\\u001F\\u007F]+$",
        "description": "调用方业务单号；不提供唯一性或幂等保证。"
      },
      "MediaSource": {
        "description": "公网 HTTPS 视频 URL 或已准备完成的上传资源，二选一。",
        "oneOf": [
          {
            "$ref": "#/components/schemas/UrlMediaSource"
          },
          {
            "$ref": "#/components/schemas/UploadMediaSource"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "url": "#/components/schemas/UrlMediaSource",
            "upload": "#/components/schemas/UploadMediaSource"
          }
        }
      },
      "UrlMediaSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "url"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 2048,
            "description": "无需登录即可直接读取素材字节的公网 HTTPS 地址。"
          }
        }
      },
      "UploadMediaSource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "upload_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "upload"
          },
          "upload_id": {
            "$ref": "#/components/schemas/UploadId"
          }
        }
      },
      "SubtitleInput": {
        "description": "SRT URL、字幕上传资源或结构化原字幕行，三选一。",
        "oneOf": [
          {
            "$ref": "#/components/schemas/UrlSubtitleInput"
          },
          {
            "$ref": "#/components/schemas/UploadSubtitleInput"
          },
          {
            "$ref": "#/components/schemas/InlineTranslationSubtitleInput"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "url": "#/components/schemas/UrlSubtitleInput",
            "upload": "#/components/schemas/UploadSubtitleInput",
            "inline": "#/components/schemas/InlineTranslationSubtitleInput"
          }
        }
      },
      "DubbingSubtitleInput": {
        "description": "SRT URL、字幕上传资源或结构化目标字幕行，三选一。",
        "oneOf": [
          {
            "$ref": "#/components/schemas/UrlSubtitleInput"
          },
          {
            "$ref": "#/components/schemas/UploadSubtitleInput"
          },
          {
            "$ref": "#/components/schemas/InlineDubbingSubtitleInput"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "url": "#/components/schemas/UrlSubtitleInput",
            "upload": "#/components/schemas/UploadSubtitleInput",
            "inline": "#/components/schemas/InlineDubbingSubtitleInput"
          }
        }
      },
      "UrlSubtitleInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "format",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "url"
          },
          "format": {
            "type": "string",
            "const": "srt"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 2048
          }
        }
      },
      "UploadSubtitleInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "format",
          "upload_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "upload"
          },
          "format": {
            "type": "string",
            "const": "srt"
          },
          "upload_id": {
            "$ref": "#/components/schemas/UploadId"
          }
        }
      },
      "InlineTranslationSubtitleInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "segments"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "inline"
          },
          "segments": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10000,
            "items": {
              "$ref": "#/components/schemas/SourceSubtitleSegment"
            }
          }
        }
      },
      "InlineDubbingSubtitleInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "segments"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "inline"
          },
          "segments": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10000,
            "items": {
              "$ref": "#/components/schemas/DubbingSubtitleSegment"
            }
          }
        }
      },
      "SourceSubtitleSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start_ms",
          "end_ms",
          "text"
        ],
        "properties": {
          "start_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "end_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "speaker": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      },
      "DubbingSubtitleSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start_ms",
          "end_ms",
          "text"
        ],
        "properties": {
          "start_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "end_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000,
            "description": "目标语言配音文本。"
          },
          "speaker": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      },
      "CreateUploadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "purpose",
          "file_name",
          "content_type",
          "size_bytes"
        ],
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "source_video",
              "subtitle_file"
            ]
          },
          "file_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[^/\\\\\\u0000-\\u001F\\u007F]+$",
            "description": "仅接受文件名，不得包含路径分隔符或控制字符。"
          },
          "content_type": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/quicktime",
              "video/x-msvideo",
              "video/mpeg",
              "application/x-subrip",
              "text/plain"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "exclusiveMaximum": 1073741824,
            "description": "视频必须小于 1 GiB；字幕文件另限制为小于 10 MiB。"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "可选文件 SHA-256；完成上传后服务端会校验。"
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "purpose": {
                  "const": "source_video"
                }
              }
            },
            "then": {
              "properties": {
                "content_type": {
                  "enum": [
                    "video/mp4",
                    "video/quicktime",
                    "video/x-msvideo",
                    "video/mpeg"
                  ]
                },
                "size_bytes": {
                  "maximum": 1073741823
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "purpose": {
                  "const": "subtitle_file"
                }
              }
            },
            "then": {
              "properties": {
                "content_type": {
                  "enum": [
                    "application/x-subrip",
                    "text/plain"
                  ]
                },
                "size_bytes": {
                  "maximum": 10485759
                }
              }
            }
          }
        ],
        "examples": [
          {
            "purpose": "source_video",
            "file_name": "episode-01.mp4",
            "content_type": "video/mp4",
            "size_bytes": 104857600,
            "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          }
        ]
      },
      "CompleteUploadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "etag"
        ],
        "properties": {
          "etag": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "examples": [
          {
            "etag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
            "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          }
        ]
      },
      "UploadStatus": {
        "type": "string",
        "enum": [
          "waiting_for_upload",
          "validating",
          "ready",
          "failed",
          "expired"
        ]
      },
      "UploadInstructions": {
        "type": "object",
        "required": [
          "method",
          "url",
          "headers",
          "expires_at"
        ],
        "properties": {
          "method": {
            "type": "string",
            "const": "PUT"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PreparedMedia": {
        "type": "object",
        "required": [
          "content_type",
          "size_bytes",
          "sha256"
        ],
        "properties": {
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "Upload": {
        "type": "object",
        "required": [
          "id",
          "object",
          "purpose",
          "file_name",
          "content_type",
          "size_bytes",
          "status",
          "created_at",
          "updated_at",
          "expires_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UploadId"
          },
          "object": {
            "type": "string",
            "const": "upload"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "source_video",
              "subtitle_file"
            ]
          },
          "file_name": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/UploadStatus"
          },
          "upload": {
            "$ref": "#/components/schemas/UploadInstructions"
          },
          "media": {
            "$ref": "#/components/schemas/PreparedMedia"
          },
          "error": {
            "$ref": "#/components/schemas/UploadFailure"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateAudioSeparationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/MediaSource"
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "metadata": {
            "$ref": "#/components/schemas/ClientMetadata"
          }
        },
        "examples": [
          {
            "source": {
              "type": "url",
              "url": "https://cdn.example.com/episode-01.mp4"
            },
            "callback_url": "https://client.example.com/webhooks/lingxi",
            "client_reference": "order-1001"
          }
        ]
      },
      "CreateSubtitleRecognitionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "source_language"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/MediaSource"
          },
          "source_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "speaker_detection": {
            "type": "boolean",
            "default": true
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "metadata": {
            "$ref": "#/components/schemas/ClientMetadata"
          }
        },
        "examples": [
          {
            "source": {
              "type": "upload",
              "upload_id": "upl_01J9Z8Q4D2Y3V6K8N0M1P2R3S4"
            },
            "source_language": "zh-CN",
            "speaker_detection": true,
            "client_reference": "order-1002"
          }
        ]
      },
      "CreateSubtitleTranslationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subtitles",
          "source_language",
          "target_language"
        ],
        "properties": {
          "subtitles": {
            "$ref": "#/components/schemas/SubtitleInput"
          },
          "source_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "target_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "mode": {
            "type": "string",
            "enum": [
              "fast",
              "full"
            ],
            "default": "fast"
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "metadata": {
            "$ref": "#/components/schemas/ClientMetadata"
          }
        },
        "examples": [
          {
            "subtitles": {
              "type": "inline",
              "segments": [
                {
                  "start_ms": 0,
                  "end_ms": 1800,
                  "text": "你终于来了。",
                  "speaker": "林夏"
                }
              ]
            },
            "source_language": "zh-CN",
            "target_language": "en-US",
            "mode": "full",
            "client_reference": "order-1003"
          }
        ]
      },
      "CreateDubbingRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subtitles",
          "target_language"
        ],
        "properties": {
          "subtitles": {
            "$ref": "#/components/schemas/DubbingSubtitleInput"
          },
          "target_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "voice_mode": {
            "type": "string",
            "const": "auto",
            "default": "auto",
            "description": "V1 只支持服务端自动音色策略，不接受内部音色 ID。"
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "metadata": {
            "$ref": "#/components/schemas/ClientMetadata"
          }
        },
        "examples": [
          {
            "subtitles": {
              "type": "inline",
              "segments": [
                {
                  "start_ms": 0,
                  "end_ms": 1800,
                  "text": "You finally came.",
                  "speaker": "Lin Xia"
                }
              ]
            },
            "target_language": "en-US",
            "voice_mode": "auto",
            "client_reference": "order-1004"
          }
        ]
      },
      "CreateAutoLocalizationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "source_language",
          "target_language"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/MediaSource"
          },
          "source_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "target_language": {
            "$ref": "#/components/schemas/LanguageCode"
          },
          "mode": {
            "type": "string",
            "enum": [
              "fast",
              "full"
            ],
            "default": "full"
          },
          "voice_mode": {
            "type": "string",
            "const": "auto",
            "default": "auto"
          },
          "subtitle_output": {
            "type": "string",
            "enum": [
              "burned",
              "none"
            ],
            "default": "burned"
          },
          "original_audio": {
            "type": "string",
            "enum": [
              "preserve",
              "remove_music",
              "mute_original"
            ],
            "default": "preserve"
          },
          "resolution": {
            "type": "string",
            "enum": [
              "original",
              "1080p",
              "720p"
            ],
            "default": "original"
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "metadata": {
            "$ref": "#/components/schemas/ClientMetadata"
          }
        },
        "examples": [
          {
            "source": {
              "type": "url",
              "url": "https://cdn.example.com/episode-01.mp4"
            },
            "source_language": "zh-CN",
            "target_language": "en-US",
            "mode": "full",
            "voice_mode": "auto",
            "subtitle_output": "burned",
            "original_audio": "preserve",
            "resolution": "original",
            "callback_url": "https://client.example.com/webhooks/lingxi",
            "client_reference": "order-1005"
          }
        ]
      },
      "Billing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "rate_card_version",
          "reserved_credits",
          "charged_credits"
        ],
        "properties": {
          "state": {
            "$ref": "#/components/schemas/BillingState"
          },
          "rate_card_version": {
            "type": "string",
            "description": "创建任务时冻结的对外价目版本。"
          },
          "reserved_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "已预留额度。"
          },
          "charged_credits": {
            "type": "integer",
            "minimum": 0,
            "description": "已结算额度；未结算时为 0。"
          }
        }
      },
      "UploadFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "JobFailure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "稳定业务错误码；不包含上游服务商信息。",
            "examples": [
              "INVALID_MEDIA"
            ]
          },
          "message": {
            "type": "string",
            "description": "面向调用方的中性错误说明。",
            "examples": [
              "素材无法读取，请确认文件完整后重试。"
            ]
          },
          "retryable": {
            "type": "boolean"
          }
        }
      },
      "BaseBusinessJob": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "object",
          "status",
          "progress",
          "billing",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "带资源类型前缀的业务任务 ID。"
          },
          "object": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "client_reference": {
            "$ref": "#/components/schemas/ClientReference"
          },
          "callback_url": {
            "$ref": "#/components/schemas/CallbackUrl"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          },
          "error": {
            "$ref": "#/components/schemas/JobFailure"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Artifact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "content_type",
          "file_name",
          "size_bytes",
          "expires_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "有时效的私有下载 URL。"
          },
          "content_type": {
            "type": "string",
            "examples": [
              "audio/wav"
            ]
          },
          "file_name": {
            "type": "string",
            "maxLength": 255
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RecognizedSubtitleSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start_ms",
          "end_ms",
          "text"
        ],
        "properties": {
          "start_ms": {
            "type": "integer",
            "minimum": 0
          },
          "end_ms": {
            "type": "integer",
            "minimum": 1
          },
          "text": {
            "type": "string",
            "minLength": 1
          },
          "speaker": {
            "type": "string"
          }
        }
      },
      "TranslatedSubtitleSegment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "start_ms",
          "end_ms",
          "source_text",
          "translated_text"
        ],
        "properties": {
          "start_ms": {
            "type": "integer",
            "minimum": 0
          },
          "end_ms": {
            "type": "integer",
            "minimum": 1
          },
          "source_text": {
            "type": "string",
            "minLength": 1
          },
          "translated_text": {
            "type": "string",
            "minLength": 1
          },
          "speaker": {
            "type": "string"
          }
        }
      },
      "AudioSeparationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vocal_audio",
          "background_audio"
        ],
        "properties": {
          "vocal_audio": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "人声 WAV。"
          },
          "background_audio": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "伴奏/背景声 WAV。"
          }
        }
      },
      "SubtitleRecognitionResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subtitle_file",
          "segments"
        ],
        "properties": {
          "subtitle_file": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "UTF-8 SRT 文件。"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecognizedSubtitleSegment"
            }
          }
        }
      },
      "SubtitleTranslationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subtitle_file",
          "segments"
        ],
        "properties": {
          "subtitle_file": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "UTF-8 目标语言 SRT 文件。"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TranslatedSubtitleSegment"
            }
          }
        }
      },
      "DubbingResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "audio"
        ],
        "properties": {
          "audio": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "按字幕时间轴对齐的配音 WAV。"
          }
        }
      },
      "AutoLocalizationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "video"
        ],
        "properties": {
          "video": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Artifact"
              }
            ],
            "description": "完成译制的 MP4 成片；本接口不返回内部质量报告。"
          }
        }
      },
      "AudioSeparation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseBusinessJob"
          },
          {
            "type": "object",
            "required": [
              "id",
              "object"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/AudioSeparationId"
              },
              "object": {
                "type": "string",
                "const": "audio_separation"
              },
              "result": {
                "$ref": "#/components/schemas/AudioSeparationResult"
              }
            }
          }
        ]
      },
      "SubtitleRecognition": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseBusinessJob"
          },
          {
            "type": "object",
            "required": [
              "id",
              "object"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/SubtitleRecognitionId"
              },
              "object": {
                "type": "string",
                "const": "subtitle_recognition"
              },
              "result": {
                "$ref": "#/components/schemas/SubtitleRecognitionResult"
              }
            }
          }
        ]
      },
      "SubtitleTranslation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseBusinessJob"
          },
          {
            "type": "object",
            "required": [
              "id",
              "object"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/SubtitleTranslationId"
              },
              "object": {
                "type": "string",
                "const": "subtitle_translation"
              },
              "result": {
                "$ref": "#/components/schemas/SubtitleTranslationResult"
              }
            }
          }
        ]
      },
      "Dubbing": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseBusinessJob"
          },
          {
            "type": "object",
            "required": [
              "id",
              "object"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/DubbingId"
              },
              "object": {
                "type": "string",
                "const": "dubbing"
              },
              "result": {
                "$ref": "#/components/schemas/DubbingResult"
              }
            }
          }
        ]
      },
      "AutoLocalization": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseBusinessJob"
          },
          {
            "type": "object",
            "required": [
              "id",
              "object"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/AutoLocalizationId"
              },
              "object": {
                "type": "string",
                "const": "auto_localization"
              },
              "result": {
                "$ref": "#/components/schemas/AutoLocalizationResult"
              }
            }
          }
        ]
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "audio_separation.succeeded",
          "audio_separation.failed",
          "audio_separation.cancelled",
          "subtitle_recognition.succeeded",
          "subtitle_recognition.failed",
          "subtitle_recognition.cancelled",
          "subtitle_translation.succeeded",
          "subtitle_translation.failed",
          "subtitle_translation.cancelled",
          "dubbing.succeeded",
          "dubbing.failed",
          "dubbing.cancelled",
          "auto_localization.succeeded",
          "auto_localization.failed",
          "auto_localization.cancelled"
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event_id",
          "event_type",
          "created_at",
          "data"
        ],
        "properties": {
          "event_id": {
            "$ref": "#/components/schemas/EventId"
          },
          "event_type": {
            "$ref": "#/components/schemas/WebhookEventType"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AudioSeparation"
              },
              {
                "$ref": "#/components/schemas/SubtitleRecognition"
              },
              {
                "$ref": "#/components/schemas/SubtitleTranslation"
              },
              {
                "$ref": "#/components/schemas/Dubbing"
              },
              {
                "$ref": "#/components/schemas/AutoLocalization"
              }
            ]
          }
        }
      },
      "ValidationIssue": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field",
          "code",
          "message"
        ],
        "properties": {
          "field": {
            "type": "string",
            "examples": [
              "target_language"
            ]
          },
          "code": {
            "type": "string",
            "examples": [
              "UNSUPPORTED_VALUE"
            ]
          },
          "message": {
            "type": "string",
            "examples": [
              "该目标语言尚不可用。"
            ]
          }
        }
      },
      "Problem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "request_id",
          "retryable"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "examples": [
              "https://lynsey.cn/api/docs/errors/invalid_request"
            ]
          },
          "title": {
            "type": "string",
            "examples": [
              "请求参数无效"
            ]
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599
          },
          "detail": {
            "type": "string",
            "description": "不包含上游品牌、原始响应、凭证或内部堆栈。"
          },
          "instance": {
            "type": "string",
            "description": "本次错误实例的稳定定位符。",
            "examples": [
              "/v1/auto-localizations"
            ]
          },
          "code": {
            "type": "string",
            "description": "便于程序分支的稳定错误码。",
            "examples": [
              "INVALID_REQUEST"
            ]
          },
          "request_id": {
            "type": "string",
            "examples": [
              "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "retry_after_seconds": {
            "type": "integer",
            "minimum": 0
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "请求体、查询参数或签名所需字段无效",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://lynsey.cn/api/docs/errors/invalid_request",
              "title": "请求参数无效",
              "status": 400,
              "detail": "请检查标记的字段。",
              "code": "INVALID_REQUEST",
              "request_id": "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R",
              "retryable": false
            }
          }
        }
      },
      "Unauthorized": {
        "description": "API Key 不可用、签名错误或请求已超时",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://lynsey.cn/api/docs/errors/authentication_failed",
              "title": "身份校验失败",
              "status": 401,
              "detail": "请检查请求签名和时间戳。",
              "code": "AUTHENTICATION_FAILED",
              "request_id": "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R",
              "retryable": false
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "账户可用额度不足",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://lynsey.cn/api/docs/errors/insufficient_credits",
              "title": "可用额度不足",
              "status": 402,
              "detail": "请补充额度后重新提交。",
              "code": "INSUFFICIENT_CREDITS",
              "request_id": "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R",
              "retryable": false
            }
          }
        }
      },
      "Forbidden": {
        "description": "当前工作区所有者的账户套餐未包含 API 权益（API_ACCESS_NOT_INCLUDED_IN_PLAN）、当前 API Key 无权访问该资源或能力（API_CLIENT_DISABLED），或请求来源 IP 不在白名单中（SOURCE_IP_NOT_ALLOWED）",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "资源不存在，或不属于当前调用方",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "幂等键冲突、状态冲突或当前任务已无法取消",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://lynsey.cn/api/docs/errors/idempotency_key_reused",
              "title": "幂等键冲突",
              "status": 409,
              "detail": "同一幂等键已用于不同请求。",
              "code": "IDEMPOTENCY_KEY_REUSED",
              "request_id": "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R",
              "retryable": false
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "素材、字幕或请求体超过 V1 限制",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "请求格式正确，但素材、语言或内容无法处理",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "工作区请求频率（RATE_LIMIT_EXCEEDED）、工作区并发任务数（CONCURRENCY_LIMIT_EXCEEDED）或 API Key 月度额度（CREDIT_QUOTA_EXCEEDED）超过限制",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          },
          "Retry-After": {
            "description": "建议的最小重试等待秒数。",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            },
            "example": {
              "type": "https://lynsey.cn/api/docs/errors/rate_limit_exceeded",
              "title": "请求过于频繁",
              "status": 429,
              "detail": "请稍后重试。",
              "code": "RATE_LIMIT_EXCEEDED",
              "request_id": "req_01J9ZA8F7G6H5J4K3M2N1P0Q9R",
              "retryable": true,
              "retry_after_seconds": 10
            }
          }
        }
      },
      "InternalError": {
        "description": "服务内部错误；响应不透传内部异常",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "服务暂时不可用或系统已达处理上限",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/XRequestId"
          },
          "Retry-After": {
            "description": "建议的最小重试等待秒数。",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}
