# SnipHunter API 调用指南 生产业务入口为 `https://api.sniphunter.com`,所有业务接口使用 `/api/v1` 前缀。文档和 OpenAPI 文件可公开读取,具体接口的鉴权要求见 OpenAPI 中的 `security` 字段。 ## 服务能力 | 接口前缀 | 功能 | | --- | --- | | `/api/v1/audio` | 音频剪辑、转换、混音、ASR、语音合成、克隆、音色设计、变声、人声分离 | | `/api/v1/video` | 视频剪辑、压缩、转码、抽帧、镜头提取、字幕、水印、增强、超分、抠像 | | `/api/v1/image` | 图片处理、OCR、去水印、AI 生图 | | `/api/v1/document`、`/api/v1/web` | 文档转文本或 Markdown、网页正文提取 | | `/api/v1/resolve`、`/api/v1/download`、`/api/v1/extraction` | 链接解析、下载、内容提取 | | `/api/v1/copywriting`、`/api/v1/studio` | 文案生成、创作工具 | | `/api/v1/agent`、`/api/v1/project` | Agent 任务、事件流、项目管理 | | `/api/v1/upload`、`/api/v1/storage`、`/api/v1/tasks` | 文件上传、对象存储、异步任务 | | `/api/v1/health` | 健康和依赖就绪检查 | 接口清单按 HTTP 方法计数。请求参数、文件字段、枚举和响应结构以各服务的 OpenAPI 为准。 ## 调用凭据 受保护的业务请求携带 `Authorization: Bearer `。调用凭据由服务管理员提供,生产后端校验权限和接口限流。 ```bash curl https://api.sniphunter.com/api/v1/audio/ai/status \ -H "Authorization: Bearer $SNIPHUNTER_TOKEN" ``` ## OCR 调用示例 ```bash curl -X POST https://api.sniphunter.com/api/v1/image/ai/ocr \ -H "Authorization: Bearer $SNIPHUNTER_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"image_url":"https://sniphunter.com/logo.png","model":"pp-ocrv5","task":"text","return_layout":true}' ``` `model` 支持 `glm-ocr` 和 `pp-ocrv5`,`task` 支持 `text`、`table`、`formula`、`document`。 ## 音频与文档 语音转文字提交到 `POST /api/v1/audio/ai/transcribe`,JSON 至少包含 `audio_url`。文字转语音提交到 `POST /api/v1/audio/ai/tts`,至少包含 `text`,可通过 `engine` 选择 `qwen3` 或 `edge`。 文档解析使用 `POST /api/v1/document/parse`,请求为 `{"file_url":"https://example.com/document.pdf","output":"markdown"}`。文件上传方式见 `/api/v1/document/parse/upload` 的 multipart 定义。网页正文提取使用 `POST /api/v1/web/scrape`,至少提供 `url`,`fetch` 可选 `auto`、`http`、`browser`。 ## 异步任务和流式响应 各类任务提交接口的返回结构不同。按照该操作的响应取得 `task_id`,再使用对应的任务查询接口。业务层 `/api/v1/tasks/{task_id}` 的 ID 为整数,Media `/api/v1/tasks/{task_id}` 使用字符串 ID。 HTTP 200 后继续检查响应中的 `success`、`status`、`error` 和任务状态。只有任务完成后才读取结果 URL。任务查询可每 5 秒进行一次,网络错误重试前先查询原任务,避免重复生成和重复扣费。 SSE 接口以 `text/event-stream` 返回事件,客户端逐条读取事件。音频字节流接口需要服务端功能开关,并受引擎部署状态影响。源码与生产注册路由的差异记录在 `/deployment.json`。 ## Media 和 GPU Infer 业务客户端使用 Backend 接口。Media 承担 FFmpeg、音频 AI、图片 OCR、文档和网页解析,GPU Infer 承担视频超分和抠像。它们的 OpenAPI 同时作为服务间集成参考提供。 Media 的网关前缀为 `https://sniphunter.com/media`,Infer 的网关前缀为 `https://sniphunter.com/ai`,后接其 OpenAPI 中的 `/api/v1/...` 路径。服务间鉴权使用管理员配置的 `X-API-Key`,生效要求由实际部署决定。业务令牌和服务间密钥分别由各自服务校验。 ## 存储、错误与能力状态 工具输入输出采用临时对象存储,当前部署策略为约 24 小时有效。任务完成后及时下载结果,预签名 URL 可能有更短的有效期。 常见错误包括 401 凭据失效、403 权限不足、422 参数校验失败、429 限流或资源繁忙、503 依赖未就绪。业务错误以具体响应为准。 模型权重、依赖和引擎开关影响每个功能的可用性。调用前可查询业务 `/api/v1/audio/ai/status`、`/api/v1/image/ai/status` 及对应模型状态。上一轮运行检查发现图片去水印权重、词级对齐程序和 Resemble 依赖缺失,视频增强可降级到 FFmpeg 滤镜。状态接口中的配置标志应结合实际任务结果判断。 ## AI 读取入口 从 `https://docs.sniphunter.com/llms.txt` 获取文档索引,再按业务读取 `/agent.md`、`/audio.md`、`/image.md`、`/video.md`。各分组提供同名 `.json` OpenAPI。`/openapi.json` 汇总当前生产业务接口,`/backend-source.json` 提供源码业务定义,`/media.json` 和 `/infer.json` 提供服务间定义。 # 业务 API Base URL `https://api.sniphunter.com` 媒体工具、AI 创作、Agent、文件与任务。 # Agent ## GET /api/v1/agent/sessions List Agent Sessions List agent sessions for the current user. ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/AgentSessionSummary" }, "type": "array", "title": "Response List Agent Sessions Api V1 Agent Sessions Get" } } } } } } ``` ## DELETE /api/v1/agent/sessions/{session_id} Delete Agent Session Delete a session and clear its cached engine. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Delete Agent Session Api V1 Agent Sessions Session Id Delete" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/agent/sessions/{session_id}/messages Get Session Messages Get message history for a session. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/AgentSessionMessage" }, "title": "Response Get Session Messages Api V1 Agent Sessions Session Id Messages Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/agent/tasks Run Agent Task Submit a new agent task. Requires authentication. ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentTaskCreate" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/agent/tasks/{task_id} Get Agent Task Get the status and result of an agent task. Requires authentication. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/agent/tasks/{task_id}/cancel Cancel Agent Task Cancel a running agent task. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Cancel Agent Task Api V1 Agent Tasks Task Id Cancel Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/agent/tasks/{task_id}/confirm Confirm Tool Execution Confirm or reject a high-cost tool execution that is awaiting user authorization. The agent loop is suspended at the tool's check_permissions=ASK stage. This endpoint resolves the pending confirmation, allowing the loop to either proceed with tool execution (approved=True) or skip it (approved=False). ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolConfirmRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Confirm Tool Execution Api V1 Agent Tasks Task Id Confirm Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/agent/tasks/{task_id}/pending-confirmations Get Pending Confirmations Get all pending tool confirmations for a task. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Get Pending Confirmations Api V1 Agent Tasks Task Id Pending Confirmations Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/agent/tasks/{task_id}/stream Stream Agent Task Stream agent task updates using SSE. Supports two frame types: - **Snapshot frames** (default, no ``event:`` field): full ``AgentTaskResponse`` JSON. Sent on every task state change. - **Incremental frames** (typed with ``event:`` field): granular events like ``text_delta``, ``tool_use``, ``tool_result``, ``confirmation_request``, ``confirmation_result``, ``assistant_message``, ``terminal``. The stream stays open during ``awaiting_confirmation``; it closes on ``completed``, ``failed``, or ``cancelled``. ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Stream Agent Task Api V1 Agent Tasks Task Id Stream Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Audio ## POST /api/v1/audio/ai/align Align Audio 词级强制对齐 输入音频 URL + 已有转写文本,返回词/句时间戳列表。 可与 /transcribe 组合:先转写再对齐。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlignRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/enhance Enhance Audio 人声增强 / 音频 AI 增强 mode: enhance | denoise engine: mossformer2-se-sr(默认)| resemble ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EnhanceRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/ai/status Get Ai Status 获取 AI 服务状态 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/audio/ai/transcribe Transcribe Audio 语音转文字 (STT / ASR) 使用 Qwen3-ASR。可选 with_align=true 调用 forced-align 补词级时间戳。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscribeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/tts Text To Speech 文字转语音 (TTS) — EdgeTTS / Qwen3-TTS ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TTSRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/ai/tts/voices Get Tts Voices 获取可用的 TTS 语音列表。 category: sample(Edge 全量→Qwen3 克隆)| qwen3 | edge | all locale: 语种前缀或完整 locale(zh / zh-CN / en / en-US) q: 搜索关键字 用户克隆音色请用 GET /tts/voices/mine(需登录)。 额外返回 languages:按语种聚合的数量,便于前端国际化语言选择。 ```json { "parameters": [ { "name": "locale", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Locale" } }, { "name": "gender", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Gender" } }, { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } }, { "name": "q", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Q" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/ai/tts/voices/mine Get My Tts Voices 获取当前用户已保存的克隆音色(文字配音「我的克隆」)。 ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## DELETE /api/v1/audio/ai/tts/voices/mine/{voice_id} Delete My Tts Voice 删除我的克隆音色。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "voice_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Voice Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/vocal-separate Vocal Separate 人声/伴奏分离 使用 Demucs AI 模型分离音频中的人声和背景音乐。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VocalSeparateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/ai/voice-change/presets List Voice Change Presets 检索常用变声目标音色示例(Qwen3-TTS 合成,可试听)。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "q", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Q" } }, { "name": "gender", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Gender" } }, { "name": "locale", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Locale" } }, { "name": "ensure", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Ensure" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/ai/voice-change/presets/{preset_id} Get Voice Change Preset 单个变声预设;默认合成/返回 Qwen3 试听音。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "preset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Preset Id" } }, { "name": "ensure", "in": "query", "required": false, "schema": { "type": "boolean", "default": true, "title": "Ensure" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/voice-clone Voice Clone 音色克隆合成(Qwen3-TTS) 用参考音频即时克隆并合成 text;默认写入「我的克隆」音色库, 供文字配音通过 prompt_audio_url 复用。VIP 专属。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__audio__ai__VoiceCloneRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/voice-convert Voice Convert 音频变声(Seed-VC) 将 source 音频内容转为参考音色;可用 preset_id(Qwen3 合成示例)或自定义 reference_url。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceConvertRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/voice-design Voice Design 音色设计试听(Qwen3-TTS VoiceDesign) 用自然语言 instruct 描述音色并合成试听音频;确认后调用 POST /voice-design/save 写入「我的克隆」,供文字配音复用。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceDesignRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/ai/voice-design/save Save Voice Design 确认使用设计音色:将试听音频作为参考音写入「我的克隆」。 不额外合成;后续文字配音通过 prompt_audio_url + Base 模型克隆复用。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceDesignSaveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/basic/convert Convert Format 音频格式转换 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConvertFormatRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/basic/extract Extract Audio 从视频提取音频 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/basic/formats Get Supported Formats 获取支持的音频格式 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/audio/basic/merge Merge Audio 音频拼接 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MergeAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/basic/mix Mix Audio 混音(添加背景音乐) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MixAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/basic/split Split Audio 按时间切分音频(固定时长或等分 N 段) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SplitAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/basic/trim Trim Audio 音频裁剪 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrimAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/effects/denoise Denoise Audio AI 音频降噪:engine=resemble(默认)| mossformer2-se ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DenoiseRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/effects/effects List Voice Effects 常用变声目标音色(Seed-VC 预设;兼容旧 effects 字段名)。 ```json { "parameters": [ { "name": "q", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Q" } }, { "name": "gender", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Gender" } }, { "name": "locale", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Locale" } }, { "name": "ensure", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Ensure" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/effects/fade Fade Audio 淡入淡出 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FadeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/effects/speed Change Speed 变速 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpeedRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/effects/voice-effect Apply Voice Effect 变声效果 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceEffectRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/effects/volume Adjust Volume 调整音量 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VolumeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/tasks/enhance Create Audio Enhance Task ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AudioEnhanceTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/tasks/transcribe Create Transcribe Task 语音转写:提交时校验配额,成功后扣减 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscribeTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/tasks/vocal-separate Create Vocal Separate Task ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VocalSeparateTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/tasks/voice-convert Create Voice Convert Task 音频变声(Seed-VC):预设音色或自定义参考音。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceConvertTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/voiceover/status Get Voiceover Status 获取配音服务状态 (EdgeTTS) ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/audio/voiceover/synthesize Synthesize Voiceover 配音合成(支持多段精细配置) - 支持多段文本分别设置音色、语速、音调 - 支持段落间停顿控制 - 支持合并或分段输出 VIP 专属功能。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VoiceoverSynthesizeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/voiceover/tts Simple Tts 简单文字转语音 EdgeTTS(默认)或 Qwen3-TTS;提供 prompt_audio_url 时走克隆合成。VIP 专属。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SimpleTTSRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/voiceover/voices Get Voices 获取可用音色列表 包括系统预设音色和用户克隆的音色。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "locale", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Locale" } }, { "name": "gender", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Gender" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/voiceover/voices/clone Clone Voice 音色克隆合成(Qwen3-TTS) 用参考音频即时克隆并合成 text;默认写入「我的克隆」音色库。VIP 专属。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__audio__voiceover__VoiceCloneRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/audio/voiceover/voices/clone/upload Clone Voice Upload 上传参考音频并克隆合成。 支持 WAV、MP3、M4A,最大 10MB。需提供 text。默认写入音色库。VIP 专属。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_clone_voice_upload_api_v1_audio_voiceover_voices_clone_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/audio/voiceover/voices/my Get My Voices 获取我的克隆音色列表 ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## DELETE /api/v1/audio/voiceover/voices/{voice_id} Delete Voice 删除克隆音色(支持数字 id 或 clone_{id}) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "voice_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Voice Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Image ## POST /api/v1/image/ai/bg-remove Background Remove AI背景移除 支持自动识别前景并移除背景。 可选返回mask,支持边缘羽化。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BackgroundRemoveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BackgroundRemoveResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/bg-remove/upload Background Remove Upload AI背景移除(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_background_remove_upload_api_v1_image_ai_bg_remove_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/colorize Colorize Photo 黑白照片上色 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ColorizeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/cutout Ai Cutout AI 抠图(同步 rembg;完整异步请用 /bg-remove) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AICutoutRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/enhance Image Enhance AI图像增强 自动/人脸/通用三种增强模式。 可调节锐化、降噪、色彩增强强度。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageEnhanceRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageEnhanceResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/enhance-clarity Enhance Clarity 清晰度增强 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClarityRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/enhance/upload Image Enhance Upload AI图像增强(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_image_enhance_upload_api_v1_image_ai_enhance_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/extend Image Extend AI图像扩展 (Outpainting) 支持向上/下/左/右/全方向扩展。 可自定义扩展比例,支持内容提示词引导生成。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageExtendRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageExtendResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/extend/upload Image Extend Upload AI图像扩展(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_image_extend_upload_api_v1_image_ai_extend_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/generate Image Generate 文生图(同步) GeekAI(quality=low,size 由调用方指定且 ≤1K,按 GPT-Image-2.5 约束修正)。 模型由请求 model 指定:gpt-image-2 / gpt-image-2.5-sunburst。 需登录;按 tool_type=image_generate 扣积分。 建议客户端超时 ≥300s。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageGenerateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/ai/history Get Task History 获取当前用户的任务历史 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Task Type" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAITaskListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/lossless-zoom Lossless Zoom 无损放大 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LosslessZoomRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/object-remove Object Remove AI对象移除 (Inpainting) 通过mask标记要移除的区域,自动填充背景。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectRemoveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ObjectRemoveResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/object-remove/upload Object Remove Upload AI对象移除(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_object_remove_upload_api_v1_image_ai_object_remove_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/ocr Image Ocr Api 图片 OCR(第一推荐 GLM-OCR)。 文案工具「图片转文案」走 /copywriting/image-to-text,内部同样优先调用本能力。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageOcrRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/ai/ocr/models Image Ocr Models OCR 可选模型(业务传 model=glm-ocr|pp-ocrv5)。 ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## GET /api/v1/image/ai/ocr/status Image Ocr Status Api GLM-OCR 能力状态。 ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/image/ai/portrait-anime Portrait Animation 人像动漫化 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortraitAnimationRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/recolor Image Recolor AI图像重着色 支持指定目标颜色,多种风格。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageRecolorRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageRecolorResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/recolor/upload Image Recolor Upload AI图像重着色(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_image_recolor_upload_api_v1_image_ai_recolor_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/ai/status Get Ai Status 获取 AI 服务状态 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/image/ai/style-transfer Style Transfer 风格转换(Media 预设;后续迁 Infer 真模型) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StyleTransferRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/ai/task/{task_id} Get Task 获取任务详情(仅任务所有者) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAITaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/ai/task/{task_id}/progress Get Task Progress Sse 获取任务进度 (SSE);使用独立 DB session,避免长连接占用请求级会话。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/upscale Image Upscale AI图像放大 (Super Resolution) 支持2x/4x/8x放大,可选人脸增强。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageUpscaleRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageUpscaleResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/upscale/upload Image Upscale Upload AI图像放大(文件上传) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_image_upscale_upload_api_v1_image_ai_upscale_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageAIUploadResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/ai/watermark-remove Image Watermark Remove 图片去水印(同步兼容;Web 推荐任务接口) 推荐:POST /api/v1/image/tasks/watermark-remove + GET /api/v1/tasks/{id} - regions 优先;其次 mask_url;都为空时 auto_detect(OpenNoMark / OWLv2) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageWatermarkRemoveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/adjust Adjust Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AdjustRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/collage Collage Images ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollageRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/compress Compress Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompressRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/convert Convert Format ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConvertRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/crop Crop Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CropRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/defog Defog Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DefogRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/basic/formats Get Supported Formats ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/image/basic/mirror Mirror Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__image__basic__MirrorRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/modify-md5 Modify Md5 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__image__basic__ModifyMd5Request" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/mosaic Mosaic Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MosaicRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/resize Resize Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResizeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/rotate Rotate Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RotateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/stretch-recovery Stretch Recovery ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StretchRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/triple-cover Triple Cover ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TripleCoverRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/basic/upload Upload Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_image_api_v1_image_basic_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/effects/batch-watermark Batch Watermark ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/effects/doodle-watermark Add Doodle Watermark ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__image__effects__DoodleWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/effects/effect Effect Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EffectRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/effects/effects List Effects ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/image/effects/filter Filter Image ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FilterRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/image/effects/filters List Filters ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/image/effects/sticker-watermark Add Sticker Watermark ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__image__effects__StickerWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/effects/text-watermark Add Text Watermark ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__image__effects__TextWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/image/tasks/watermark-remove Create Image Watermark Remove Task ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImageWatermarkRemoveTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Video ## POST /api/v1/video/ai/bg-remove Video Bg Removal 视频抠图(同步兼容)。推荐:POST /video/tasks/bg-remove + GET /api/v1/tasks/{id} ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoBgRemoveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/ai/capabilities Video Generate Capabilities 文生视频能力:已配置供应商 + xbai/H3 capabilities(失败不 5xx)。 ```json { "security": [ { "HTTPBearer": [] } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/video/ai/enhance Video Enhance 视频 AI 增强(同步兼容)。推荐:POST /video/tasks/enhance + GET /api/v1/tasks/{id} ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoEnhanceRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/generate Video Generate 文生视频。geekai=Seedance;xbai=MiniMax H3 自建卡。 需登录;按 tool_type=video_ai_generate 扣积分。 xbai 立即返回本系统 task_id,用 GET /video/ai/generate/{task_id} 轮询。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoGenerateRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/ai/generate/{task_id} Video Generate Status 查询文生视频异步任务。xbai 为本系统 task_id;GeekAI 为上游 task_id。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/generate/{task_id}/cancel Video Generate Cancel 取消 xbai 生视频任务。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Task Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/subtitle-detect Subtitle Detect 自动检测字幕条带区域,返回推荐区域供前端回填。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleDetectRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/subtitle-remove Subtitle Remove 视频去字幕(同步,兼容移动端;Web/Extension 请用异步任务接口) 推荐:POST /api/v1/video/tasks/subtitle-removal + GET .../{task_id} - 区域二选一:传 region(像素)→ 去该区域;不传 → auto(底部字幕带) - mode=fast|standard|high(全部 OpenCV TELEA/NS,由 Media 按档调参) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemoveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/upscale Video Upscale 视频超分(同步兼容)。推荐:POST /video/tasks/upscale + GET /api/v1/tasks/{id} ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoUpscaleRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/ai/watermark-remove Watermark Remove AI 去水印(Infer / ProPainter 链路) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AIWatermarkRemovalRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/add-cover Add Cover 添加封面 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddCoverRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/compress Compress Video 视频压缩。预设: wechat, douyin, kuaishou, bilibili, weibo ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoCompressRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/convert Convert Format 视频格式转换 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FormatConvertRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/crop Crop Video 视频裁剪:mode=pixel|ratio|platform ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoCropRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/export-keyframe Export Keyframe 导出关键帧 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportKeyframeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/extract-frames Extract Frames 视频抽帧 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractFramesRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/extract-shots Extract Shots Compat 镜头切分(兼容路径) 推荐使用独立原子接口 POST /api/v1/video/extract-shots。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShotExtractionRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/basic/formats Get Supported Formats 获取支持的视频格式(元数据,无需鉴权) ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/video/basic/modify-md5 Modify Md5 修改视频MD5 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__basic__ModifyMd5Request" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/remove-audio Remove Original Sound 消除原声 - 移除视频音轨(ffmpeg -an) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__BaseVideoRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/stitch Stitch Videos 视频拼接 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoStitchingRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/to-audio Video To Audio 视频转音频 —— 委托 audio_extract,与 /audio/basic/extract 行为一致 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoToAudioRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/basic/trim Trim Video 视频时长裁剪 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoTrimRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/burn-subtitle Burn Subtitle 烧录硬字幕(FFmpeg) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BurnSubtitleRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/doodle-watermark Add Doodle Watermark 添加涂鸦水印 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__DoodleWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/effect Video Effect 视频特效(FFmpeg) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoEffectRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/effects/effects List Effects ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/video/effects/filter Video Filter 视频滤镜(FFmpeg) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoFilterRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/effects/filters List Filters ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/video/effects/mirror Mirror Video 对称镜像 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__MirrorRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/reverse Reverse Video 视频倒放 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__BaseVideoRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/smudge Smudge 区域打码/模糊(CPU) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SmudgeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/sticker-watermark Add Sticker Watermark 添加贴纸水印 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__StickerWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/text-watermark Add Text Watermark 添加文字水印 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/src__api__v1__endpoints__video__effects__TextWatermarkRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/effects/to-gif Video To Gif 视频转GIF(高质量 palette) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoToGifRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/extract-shots Extract Shots 视频镜头提取(独立原子能力) 检测视频中的场景切换,提取各个镜头。不属于素材提取流程。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShotExtractionRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/bg-remove Create Bg Remove Task 提交视频抠图任务 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoBgRemoveTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/enhance Create Enhance Task 提交视频 AI 增强任务 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoEnhanceTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/subtitle-removal Create Subtitle Removal Task 提交去字幕任务(统一 async_media_tasks + Celery)。 立即返回 task_id,客户端轮询 GET /subtitle-removal/{task_id}。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemovalRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemovalTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/subtitle-removal-from-file Create Subtitle Removal Task From File 上传文件并创建去字幕任务(公共仅 mode) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_create_subtitle_removal_task_from_file_api_v1_video_tasks_subtitle_removal_from_file_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemovalTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/subtitle-removal/history Get Subtitle Removal History 获取当前用户的去字幕任务历史(async_media_tasks) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 50, "minimum": 1, "default": 10, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemovalHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/subtitle-removal/{task_id} Get Subtitle Removal Task 获取去字幕任务详情(优先 async_media_tasks,兼容旧表) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "匿名任务进度访问令牌", "title": "Progress Token" }, "description": "匿名任务进度访问令牌" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubtitleRemovalTaskDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/subtitle-removal/{task_id}/progress Get Subtitle Removal Progress 获取去字幕任务进度 (SSE) — 支持 async_media_tasks ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token for EventSource", "title": "Token" }, "description": "JWT token for EventSource" }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "匿名任务进度访问令牌", "title": "Progress Token" }, "description": "匿名任务进度访问令牌" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/upscale Create Upscale Task 提交视频超分任务 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoUpscaleTaskRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/watermark-preview Watermark Preview 预览去水印效果(单帧) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkPreviewRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkPreviewResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/watermark-removal Create Watermark Removal Task 提交去水印任务(统一写入 async_media_tasks,Celery 投递)。 指定水印区域,或 auto_detect=true 自动检测,后台异步处理。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkRemovalRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkRemovalTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/video/tasks/watermark-removal-from-file Create Watermark Removal Task From File 上传文件并创建去水印任务 直接上传视频文件,后台异步处理。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_create_watermark_removal_task_from_file_api_v1_video_tasks_watermark_removal_from_file_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkRemovalTaskResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/watermark-removal/history Get Watermark Removal History 获取当前用户的去水印任务历史(async_media_tasks) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 50, "minimum": 1, "default": 10, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkRemovalHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/watermark-removal/{task_id} Get Watermark Removal Task 获取去水印任务详情(优先 async_media_tasks,兼容旧表) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "匿名任务进度访问令牌", "title": "Progress Token" }, "description": "匿名任务进度访问令牌" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WatermarkRemovalTaskDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/video/tasks/watermark-removal/{task_id}/progress Get Watermark Removal Progress 获取去水印任务进度 (SSE) — 支持 async_media_tasks ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token for EventSource authentication", "title": "Token" }, "description": "JWT token for EventSource authentication" }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "匿名任务进度访问令牌", "title": "Progress Token" }, "description": "匿名任务进度访问令牌" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Document ## GET /api/v1/document/formats Document Formats ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/document/parse Document Parse 通过文件 URL 解析文档(Word / Excel / PDF / PPT / TXT 等)。 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentParseRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/document/parse/upload Document Parse Upload 上传文档并解析。 ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_document_parse_upload_api_v1_document_parse_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Web ## POST /api/v1/web/scrape Web Scrape 抓取网页并提取降噪正文(Markdown)。 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebScrapeRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/web/status Web Status ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` # Resolve ## POST /api/v1/resolve Resolve 统一内容解析接口 - 支持抖音/快手/小红书/B站/TikTok/YouTube 返回统一格式的数据结构,包含: - 基本信息:title, type, video_url, audio_url, cover_url, platform - 作者信息:author, author_id, author_avatar - 视频属性:duration, width, height - 统计数据:view_count, like_count, comment_count, share_count, collect_count - 发布时间:release_time ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolveRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolveResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Download ## DELETE /api/v1/download/cache/clear Clear Cache 清空所有缓存 需要管理员权限(当前为演示模式) ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## GET /api/v1/download/cache/stats Get Cache Stats 获取缓存统计信息(无需认证) 返回缓存命中率、内存使用情况等统计数据 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## POST /api/v1/download/extract-audio Extract Audio From Video 从视频URL提取音频 从视频URL下载并提取音频,返回音频文件URL 返回码说明: - 200: 提取成功 - 202: 正在处理中,前端应每隔 retry_after 秒轮询本接口直至完成 - 400: 请求参数错误 - 500: 服务器内部错误 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractMediaRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/download/extract-bgm Extract Bgm 提取背景音乐 从音频URL中提取背景音乐 返回码说明: - 200: 提取成功 - 202: 正在处理中,前端应每隔 retry_after 秒轮询本接口直至完成 - 400: 请求参数错误 - 500: 服务器内部错误 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractMediaRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/download/extract-text Extract Text 提取音频文案(口播文案) 从音频URL中提取口播文案文本内容 返回码说明: - 200: 提取成功,返回文案内容 - 202: 正在处理中,前端应每隔 retry_after 秒轮询本接口直至完成 - 400: 请求参数错误 - 500: 服务器内部错误 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractMediaRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/download/media/{path} Download Media File 下载媒体文件代理端点 用于代理 MinIO 中的媒体文件,支持视频、音频等文件的下载 支持 Range 请求(视频拖动播放) Args: path: 媒体文件路径,如 videos/filename.mp4, audios/filename.mp3 download: true 时用 Content-Disposition: attachment(移动端「另存为」) ```json { "parameters": [ { "name": "path", "in": "path", "required": true, "schema": { "type": "string", "title": "Path" } }, { "name": "download", "in": "query", "required": false, "schema": { "type": "boolean", "default": false, "title": "Download" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Extraction ## POST /api/v1/extraction/analyze 分析 URL(纯素材解析,不下载不上传) 分析 URL 并解析素材元数据与直链。 **仅数据提取**:返回平台 video/audio/cover 直链与标题等元数据。 **不会**下载媒体文件、**不会**上传到对象存储、**不会**做 BGM/ASR。 需要落盘/转存、口播文案、人声分离请走独立原子能力。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractionAnalyzeRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractionResultResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/extraction/history 获取提取历史 获取用户的提取历史 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "platform", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "平台过滤", "title": "Platform" }, "description": "平台过滤" }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "状态过滤", "title": "Status" }, "description": "状态过滤" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractionListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/extraction/upload 登记本地上传文件(仅登记元数据,不做二次下载/转码) 登记用户上传的媒体文件为一条素材提取记录。 仅保存用户提交的文件到存储并登记元数据(文件本身由客户端提交), **不做**平台下载、BGM 分离、ASR 或二次转码。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_file_extraction_api_v1_extraction_upload_post" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractionResultResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/extraction/{extraction_id} 获取提取结果 获取提取结果详情 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "extraction_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Extraction Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExtractionResultResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/extraction/{extraction_id}/download/{resource_type} 跳转到资源直链 按资源类型 302 跳转到解析得到的直链(服务端不二次拉取/转存)。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "extraction_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Extraction Id" } }, { "name": "resource_type", "in": "path", "required": true, "schema": { "type": "string", "title": "Resource Type" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/extraction/{extraction_id}/progress 获取提取进度 (SSE) 获取提取进度(Server-Sent Events) 注意: 由于 EventSource 不支持自定义 headers, token 通过 query 参数传递。 资源隔离:鉴权用短会话;SSE 轮询每轮独立开/关 session, 禁止在长连接期间持有 Depends(get_db) 连接。 ```json { "parameters": [ { "name": "extraction_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Extraction Id" } }, { "name": "token", "in": "query", "required": true, "schema": { "type": "string", "description": "JWT token for SSE authentication", "title": "Token" }, "description": "JWT token for SSE authentication" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/extraction/{extraction_id}/save-to-assets 保存到资源库(已下线) 云素材库已下线;请使用各端「我的空间」本地记录。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "extraction_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Extraction Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SaveToAssetsRequest" } } } }, "responses": { "410": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SaveToAssetsResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Copywriting ## POST /api/v1/copywriting/audio-to-text Audio To Text 音频转文案 将上传的音频文件转录为文字。使用远程 AI 推理服务进行语音识别。 注意: 需要配置 AI 推理服务 (SH_INFER_ENABLED=true) ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_audio_to_text_api_v1_copywriting_audio_to_text_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/detect-forbidden Detect Forbidden Words 违禁词检测 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForbiddenWordRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/extract-link Extract Link 从链接提取口播文案 短视频链接流水线:解析视频 → 分离音频 → ASR 识别 → 返回文案。 普通网页仍走 HTML 抓取。 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkExtractionRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/image-to-text Image To Text 图片转文案:经 Backend 调 Media OCR(model=auto|glm-ocr|pp-ocrv5)。 ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_image_to_text_api_v1_copywriting_image_to_text_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/marketing Generate Marketing 生成营销文案 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketingRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/product-review Generate Product Review 生成产品测评 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductReviewRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/smart-original Smart Original 智能原创 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SmartOriginalRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/video-script Generate Video Script 生成视频脚本 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VideoScriptRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/webpage-scrape Webpage Scrape 网页解析转文案(Backend → Media web scrape) ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebpageScrapeCopyRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/word-to-text Word To Text 文档转文案(Backend → Media anydoc) ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_word_to_text_api_v1_copywriting_word_to_text_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/copywriting/xiaohongshu Generate Xiaohongshu 生成小红书风格文案 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/XiaohongshuRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Studio ## GET /api/v1/studio/jobs/{job_id} Get Job ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "job_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Job Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudioJobResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/studio/projects List Projects 列出当前用户的 Studio 项目 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response List Projects Api V1 Studio Projects Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/studio/projects/quick-render Quick Render ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudioQuickRenderRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuickRenderResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/studio/projects/{project_id} Get Project ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudioProjectResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/studio/projects/{project_id}/run Run Project ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudioRunRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuickRenderResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## PUT /api/v1/studio/projects/{project_id}/shots/{shot_id} Patch Shot ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } }, { "name": "shot_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Shot Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShotPatch" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Patch Shot Api V1 Studio Projects Project Id Shots Shot Id Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/studio/projects/{project_id}/visual-assets Upsert Visual Asset ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VisualAssetUpsert" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "title": "Response Upsert Visual Asset Api V1 Studio Projects Project Id Visual Assets Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Project ## POST /api/v1/project/projects 创建项目 创建新的项目 (支持 generic, image, video, tool) ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectCreate" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/project/projects 获取项目列表 获取当前用户的项目列表 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "项目类型过滤", "title": "Project Type" }, "description": "项目类型过滤" }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "状态过滤", "title": "Status" }, "description": "状态过滤" }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页数量", "default": 20, "title": "Page Size" }, "description": "每页数量" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/project/projects/{project_id} 获取项目详情 获取项目详情(含消息历史和业务数据) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## PUT /api/v1/project/projects/{project_id} 更新项目 更新项目基本信息和配置 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectUpdate" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/project/projects/{project_id} 删除项目 删除项目 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/project/projects/{project_id}/assets 获取项目资产列表 获取项目的资产列表 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MediaAssetResponse" }, "title": "Response Get Project Assets Api V1 Project Projects Project Id Assets Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/project/projects/{project_id}/assets 添加资产 向项目添加资产 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddAssetRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MediaAssetResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/project/projects/{project_id}/assets/{asset_id} 删除资产 从项目删除资产 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } }, { "name": "asset_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Asset Id" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/project/projects/{project_id}/chat 发送聊天消息 与 Agent 进行对话 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentChatRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentChatResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/project/projects/{project_id}/export 导出项目 导出项目 (支持视频导出、图片导出等) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectExportRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectExportResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/project/projects/{project_id}/generate 生成内容 触发内容生成 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentGenerateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentGenerateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/project/projects/{project_id}/scripts 获取脚本列表 获取项目的脚本列表 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ScriptSegmentResponse" }, "title": "Response Get Project Scripts Api V1 Project Projects Project Id Scripts Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## PUT /api/v1/project/projects/{project_id}/scripts 更新脚本列表 更新项目的脚本列表 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateScriptsRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ScriptSegmentResponse" }, "title": "Response Update Project Scripts Api V1 Project Projects Project Id Scripts Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/project/projects/{project_id}/timeline 获取时间线 获取项目的时间线 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TimelineResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## PUT /api/v1/project/projects/{project_id}/timeline 更新时间线 更新项目的时间线 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "project_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Project Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateTimelineRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TimelineResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Upload ## POST /api/v1/upload/minio Upload To Minio 代理上传到对象存储(默认 TOS),返回可下载 URL。 路径名 `/minio` 为历史兼容;直传失败时 Web 会降级到此接口。 ```json { "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_to_minio_api_v1_upload_minio_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/upload/presign Presign Upload 签发对象存储直传凭证。 - mode=put:返回 upload_url,客户端 PUT 原始 body - mode=proxy:本地盘或不支持时,客户端应走 /upload/minio 允许匿名(与 /minio 一致,供工具输入)。 ```json { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PresignRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Storage ## GET /api/v1/storage List Files And Folders ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Category" } }, { "name": "asset_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Asset Type" } }, { "name": "parent_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Parent Id" } }, { "name": "is_favorite", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Is Favorite" } }, { "name": "search", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Search" } }, { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "default": 20, "title": "Page Size" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/storage/batch-move Batch Move Assets ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchMoveRequest" } } }, "required": true }, "responses": { "410": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "boolean", "title": "Response Batch Move Assets Api V1 Storage Batch Move Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/storage/files/{path} Get File 获取本地存储的文件,支持 Range 请求和 CORS(工具处理产物,非用户云盘) ```json { "parameters": [ { "name": "path", "in": "path", "required": true, "schema": { "type": "string", "title": "Path" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/storage/upload Upload Tool File 工具侧文件上传(鉴权)。 不创建 user_assets、不占用用户云存储配额。 返回 URL 供后续工具处理;兼容旧客户端对 asset.file_url 的解析。 匿名工具上传请走 /api/v1/upload/minio。 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_tool_file_api_v1_storage_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/storage/{asset_id} Delete Asset ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "asset_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Asset Id" } } ], "responses": { "410": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Tasks ## GET /api/v1/tasks/history Get Async Task History Endpoint ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 1, "title": "Page" } }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 50, "minimum": 1, "default": 10, "title": "Page Size" } }, { "name": "job_type", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Job Type" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/tasks/{task_id} Get Async Task Endpoint ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Progress Token" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AsyncTaskDetail" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/tasks/{task_id}/progress Get Async Task Progress Endpoint ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "task_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "Task Id" } }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Token" } }, { "name": "progress_token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Progress Token" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Tools ## GET /api/v1/tools Get Tools 获取工具列表 返回所有可用的工具信息 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## GET /api/v1/tools/{tool_id} Get Tool By Id 根据ID获取工具信息 ```json { "parameters": [ { "name": "tool_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Tool Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Tool History ## POST /api/v1/tool-history 创建工具使用历史记录 记录用户使用工具的历史 ```json { "security": [ { "HTTPBearer": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryCreate" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/tool-history 获取工具使用历史记录列表 分页获取当前用户的工具使用历史记录 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "page", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "description": "页码", "default": 1, "title": "Page" }, "description": "页码" }, { "name": "page_size", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 100, "minimum": 1, "description": "每页数量", "default": 20, "title": "Page Size" }, "description": "每页数量" }, { "name": "tool_category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "工具分类筛选", "title": "Tool Category" }, "description": "工具分类筛选" }, { "name": "tool_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "工具ID筛选", "title": "Tool Id" }, "description": "工具ID筛选" }, { "name": "status_filter", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "状态筛选", "title": "Status Filter" }, "description": "状态筛选" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/tool-history/ 批量删除工具使用历史记录 根据条件批量删除工具使用历史记录 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "tool_category", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "工具分类筛选", "title": "Tool Category" }, "description": "工具分类筛选" }, { "name": "tool_id", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "工具ID筛选", "title": "Tool Id" }, "description": "工具ID筛选" }, { "name": "status_filter", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "状态筛选", "title": "Status Filter" }, "description": "状态筛选" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryDeleteResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/tool-history/{history_id} 获取单个工具使用历史记录 根据ID获取工具使用历史记录详情 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "history_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "History Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/tool-history/{history_id} 删除工具使用历史记录 根据ID删除工具使用历史记录 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "history_id", "in": "path", "required": true, "schema": { "type": "integer", "title": "History Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolHistoryDeleteResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` # Chat ## POST /api/v1/chat Chat 发送聊天消息 (基于 QueryEngine) - 自动创建或使用已有会话 - 支持工具调用 - 支持上下文记忆 示例: ``` POST /api/v1/chat { "message": "帮我提取这个视频的素材 https://...", "stream": false } ``` ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/chat/health Health Check 健康检查 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` ## GET /api/v1/chat/sessions List Sessions 列出会话(基于 QueryEngine 进程内缓存) ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "string" }, "title": "Response List Sessions Api V1 Chat Sessions Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/chat/sessions/{session_key} Get Session 获取会话信息 ```json { "parameters": [ { "name": "session_key", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionInfo" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## DELETE /api/v1/chat/sessions/{session_key} Delete Session 删除会话 ```json { "parameters": [ { "name": "session_key", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Key" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/chat/sessions/{session_key}/messages Get Session Messages 获取会话消息历史 ```json { "parameters": [ { "name": "session_key", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Key" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "description": "返回消息数量", "default": 50, "title": "Limit" }, "description": "返回消息数量" }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "description": "偏移量", "default": 0, "title": "Offset" }, "description": "偏移量" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MessageInfo" }, "title": "Response Get Session Messages Api V1 Chat Sessions Session Key Messages Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## POST /api/v1/chat/stream Chat Stream 流式聊天 (基于 QueryEngine,SSE) 返回 Server-Sent Events 格式: ``` data: {"type": "session", "data": {"session_key": "..."}} data: {"type": "stream_request_start", "data": {"turn": 1}} data: {"type": "text_delta", "data": {"text": "Hello"}} data: {"type": "tool_use", "data": {"name": "video_extraction", ...}} data: {"type": "confirmation_request", "data": {"tool_call_id": "...", ...}} data: {"type": "tool_result", "data": {"success": true, ...}} data: {"type": "done", "data": {"status": "completed", ...}} ``` ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/chat/tools List Tools 获取可用工具列表 ```json { "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } ``` # Proxy ## GET /api/v1/proxy/download Proxy Download Proxy download a file with proper headers to bypass anti-hotlinking. Returns the file with Content-Disposition header for download. 鉴权: - Authorization: Bearer (fetch/XHR) - ?token=(浏览器 原生下载无法带 Authorization) 安全措施: - 强制登录 + 配额 - 禁止访问私有 IP 地址 - 禁止访问云服务元数据端点 - DNS 解析检查防止 DNS 重绑定攻击 资源隔离:鉴权/配额短会话;下载流期间不持有 DB 连接。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "description": "Target URL to download", "title": "Url" }, "description": "Target URL to download" }, { "name": "filename", "in": "query", "required": false, "schema": { "type": "string", "description": "Suggested filename for download", "title": "Filename" }, "description": "Suggested filename for download" }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token fallback when Authorization header is unavailable", "title": "Token" }, "description": "JWT token fallback when Authorization header is unavailable" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/proxy/stream Proxy Stream Proxy stream a URL to bypass CORS / anti-hotlink. This routes the traffic through the backend with proper platform-specific headers. 鉴权: - Authorization: Bearer (fetch/XHR) - ?token=(原生 video/audio 标签无法自定义请求头) 安全措施: - 强制登录 - 禁止访问私有 IP 地址 (10.x.x.x, 192.168.x.x, 127.0.0.1 等) - 禁止访问云服务元数据端点 - DNS 解析检查防止 DNS 重绑定攻击 资源隔离:鉴权/配额短会话;流式传输期间不持有 DB 连接。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "description": "Target URL to stream", "title": "Url" }, "description": "Target URL to stream" }, { "name": "platform", "in": "query", "required": false, "schema": { "type": "string", "description": "Platform hint for setting correct Referer", "title": "Platform" }, "description": "Platform hint for setting correct Referer" }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token for 原生下载无法带 Authorization) 安全措施: - 强制登录 + 配额 - 禁止访问私有 IP 地址 - 禁止访问云服务元数据端点 - DNS 解析检查防止 DNS 重绑定攻击 资源隔离:鉴权/配额短会话;下载流期间不持有 DB 连接。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "description": "Target URL to download", "title": "Url" }, "description": "Target URL to download" }, { "name": "filename", "in": "query", "required": false, "schema": { "type": "string", "description": "Suggested filename for download", "title": "Filename" }, "description": "Suggested filename for download" }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token fallback when Authorization header is unavailable", "title": "Token" }, "description": "JWT token fallback when Authorization header is unavailable" } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } ``` ## GET /api/v1/proxy/stream Proxy Stream Proxy stream a URL to bypass CORS / anti-hotlink. This routes the traffic through the backend with proper platform-specific headers. 鉴权: - Authorization: Bearer (fetch/XHR) - ?token=(原生 video/audio 标签无法自定义请求头) 安全措施: - 强制登录 - 禁止访问私有 IP 地址 (10.x.x.x, 192.168.x.x, 127.0.0.1 等) - 禁止访问云服务元数据端点 - DNS 解析检查防止 DNS 重绑定攻击 资源隔离:鉴权/配额短会话;流式传输期间不持有 DB 连接。 ```json { "security": [ { "HTTPBearer": [] } ], "parameters": [ { "name": "url", "in": "query", "required": true, "schema": { "type": "string", "description": "Target URL to stream", "title": "Url" }, "description": "Target URL to stream" }, { "name": "platform", "in": "query", "required": false, "schema": { "type": "string", "description": "Platform hint for setting correct Referer", "title": "Platform" }, "description": "Platform hint for setting correct Referer" }, { "name": "token", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "JWT token for