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

# Video Watermark Remover API：去除单个视频中的水印

> APIXO 视频水印去除 API 用于单视频清理：去除覆盖物和徽标，同时保持原始运动质量。

## 概览

Video Watermark Remover 是异步视频到视频 API，用于从一个源视频中删除水印。计费基于计费视频时长。

| 功能 | 值 |
| - | - |
| 模型 ID | `video-watermark-remover` |
| 模式 | `video-to-video` |
| 输入视频 | 恰好 1 个公开视频 URL |
| 最低计费时长 | 5秒 |
| 计费 | 每秒 |

## 接口与身份验证

API 基础地址：

```text theme={null}
https://api.apixo.ai/api/v1
```

| 方法 | 端点 | 用途 |
| - | - | - |
| `POST` | `/generateTask/video-watermark-remover` | 提交去水印任务 |
| `GET` | `/statusTask/video-watermark-remover?taskId={taskId}` | 查询任务状态并获取结果 |

每个请求都必须携带 APIXO API 密钥：

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

提交任务时，还需要设置以下请求头：

```http theme={null}
Content-Type: application/json
```

## 异步请求示例

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/video-watermark-remover" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "video-to-video",
      "video_urls": [
        "https://example.com/input.mp4"
      ]
    }
  }'
```

成功响应：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

保存 `taskId`，后续轮询结果时需要用到它。

## 轮询结果

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/video-watermark-remover?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

成功响应：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/clean-video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

等 `state` 变为 `success` 后，再解析 `resultJson`：

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;
```

## 请求体

```json theme={null}
{
  "request_type": "async",
  "callback_url": "https://your-server.com/webhooks/apixo",
  "input": {
    "mode": "video-to-video",
    "video_urls": [
      "https://example.com/input.mp4"
    ]
  }
}
```

## 参数

**request\_type** `string` *required* (default: async)

结果获取方式。选择 `async` 时，通过 `statusTask` 轮询结果；选择 `callback` 时，通过 Webhook 接收结果。

**callback\_url** `string`

当`request_type`为`callback`时需要。必须是可以接收最终任务负载的回调URL。请参阅 [Webhooks](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

**input** `object` *required*

Video Watermark Remover 的输入参数。

**属性**

**mode** `string` (default: video-to-video)

水印去除模式。唯一支持的值为 `video-to-video`。如果省略，则后端默认为 `video-to-video`。

**video\_urls** `string[]` *required*

源视频 URL。必须恰好包含 1 个非空公共 MP4、MOV 或 WEBM 视频 URL。输入视频不得超过 600 秒。

## 响应格式

### 提交任务时的响应

任务受理后，`POST /generateTask/video-watermark-remover` 会返回任务 ID：

**code** `integer`

API 状态码。`200` 表示任务已受理。

**message** `string`

状态说明。

**data.taskId** `string`

任务的唯一 ID，用于查询任务状态。

### 状态响应字段

**taskId** `string`

任务的唯一标识符。

**state** `string`

当前任务状态，可能的值为 `pending`、`processing`、`success`、`failed`。

**resultJson** `string`

JSON 字符串中包含清理后视频的 URL，位于 `resultUrls` 字段中，当 `state` 为 `success` 时出现。

**failCode** `string`

供程序处理的错误码，仅在 `state` 为 `failed` 时返回。

**failMsg** `string`

失败原因说明，仅在 `state` 为 `failed` 时返回。

**createTime** `integer`

任务创建时的 Unix 时间戳，单位为毫秒。

**completeTime** `integer`

任务完成时的 Unix 时间戳，单位为毫秒。任务完成后返回。

**costTime** `integer`

处理耗时，以毫秒为单位。有计时数据时返回。

## Webhook 回调模式

如果希望服务端自动收到最终结果，可以使用回调模式，无需轮询。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/video-watermark-remover" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "video-to-video",
      "video_urls": [
        "https://example.com/input.mp4"
      ]
    }
  }'
```

Webhook 接收要求和重试规则见 [Webhook 文档](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

## 计费

新提交的非 LLM 请求按 **1 积分 = `$0.001`** 计费。先按用量和附加项目计算总额，再应用账号折扣，最后将请求总额向上取整到整数积分。如果约定了固定单价，则按该单价的原始精度计算，不再使用标准价或另行打折；最终积分仍向上取整。详见[积分换算与取整](https://apixo.ai/docs/zh/pricing.md#credit-conversion-and-rounding)。

Video Watermark Remover 按计费秒计费。计费持续时间为 `max(5 seconds, actual input video duration)`。

| 计费维度 | 值 |
| - | - |
| 单位 | `PER_SECOND` |
| APIXO 价格 | `$0.010 / second` |
| 最低计费时长 | `5`秒 |

计费行为：

```text theme={null}
billable_seconds = max(5, actual_video_seconds)
precharge = billable_seconds * 0.010
```

最新的美元费率见 [API 价目表](https://apixo.ai/pricing/api)。

## 延迟与轮询

Video Watermark Remover 任务为异步处理。实际延迟受源视频时长、文件下载速度及队列负载影响。

| 使用案例 | 建议首次查询时间 | 轮询间隔 |
| - | - | - |
| 短视频 | 任务创建 30 秒后 | 10s-20s |
| 长时或生产级工作负载 | 优先使用回调模式 | 如果轮询，请使用 20s 或更长时间 |

> [!TIP]
>
> 对于制作队列或较长的视频，请使用回调模式以避免频繁轮询。

请求频率和并发上限因账号、API 密钥和路由而异。收到 `429` 时，请降低请求频率，逐步延长重试间隔。账号级限制见[系统 API](https://apixo.ai/docs/zh/api-reference/system.md)。

## 错误与排查

### HTTP 错误

| 代码 | 含义 | 处理方式 |
| - | - | - |
| `400` | 请求体、模式或视频 URL 结构无效 | 在重试前修复请求 |
| `401` | 缺少 API 密钥，或密钥无效 | 检查 `Authorization` 请求头 |
| `402` | 余额或配额不足 | 充值或更换账号或API密钥 |
| `403` | 密钥或路由无权访问该模型 | 检查权限和路由策略 |
| `404` | 未找到任务 | 验证 `taskId` 和模型 ID |
| `429` | 已达到速率或并发限制 | 按指数退避策略重试 |
| `500` | 服务器错误或未知任务失败 | 逐步延长间隔后重试 |
| `502` | 模型服务错误 | 逐步延长间隔后重试 |
| `504` | 模型服务超时 | 重试；耗时较长的任务可改用回调模式 |

### 请求验证

| 条件 | 后端行为 |
| - | - |
| 缺少 `input` | 返回`The required parameter {{input}} is missing.` |
| `mode` 无效 | 返回`Invalid mode type. Supported: video-to-video` |
| 缺少 `video_urls` | 返回`The required parameter {{video_urls}} is missing.` |
| `video_urls` 不是数组 | 返回`The parameter {{video_urls}} must be Array type.` |
| `video_urls`长度不是1 | 返回`The parameter {{video_urls}} must contain exactly 1 video.` |
| `video_urls[0]` 不是字符串 | 返回`The parameter {{video_urls}} Array elements must be String type.` |
| `video_urls[0]` 为空 | 返回`The parameter {{video_urls}} cannot contain empty string.` |

完整列表见[错误码](https://apixo.ai/docs/zh/api-reference/errors.md)。

## MCP 集成

[完整模型 Schema](https://apixo.ai/docs/models/schemas/video/video-watermark-remover.json) 中的 `mcp.result` 指定了结果的解析方式，`mcp.attachments` 列出支持绑定文件的字段。这些元数据供客户端集成使用，无需作为生成参数提交。附件字段为 `video_urls`。请保留用户指定的文件顺序。API 负责校验模型参数。

## 相关链接

* [生成 API 概览](https://apixo.ai/docs/zh/models.md)
* [视频模型](https://apixo.ai/docs/zh/models/video)
* [提交生成任务](https://apixo.ai/docs/zh/api-reference/generate-task.md)
* [查询任务状态](https://apixo.ai/docs/zh/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/zh/api-reference/webhooks.md)
* [错误码](https://apixo.ai/docs/zh/api-reference/errors.md)
* [参数规范](https://apixo.ai/docs/zh/api-reference/parameters.md)
* [API定价](https://apixo.ai/pricing/api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.