# SEE2AI 视频场景切分

> Split one video into scenes and produce scene, character, prop, and shot manifests through an asynchronous submit-and-poll workflow. Equal-duration segmentation is temporarily unsupported; set the minimum duration below the maximum, for example 4.0 and 10.0 seconds.

## 📖 接入指引

**Endpoint**: `POST /api/v1/actions/see2ai_video_scene_segmentation_v1`

**认证方式**: Bearer Token (租户 API Key)

### Endpoints

| Method | Path | Purpose |
| --- | --- | --- |
| `POST` | `/api/v1/actions/see2ai_video_scene_segmentation_v1` | Submit the standard action request. |

> **⚠️ 重要提示**
> 
> 本 API 是 SEE2AI 平台标准化封装后的接口，**参数格式与任何上游 API 不同**。
> 请直接使用下方 Schema 中定义的参数，无需参考其他文档。
> 
> *例如：*
> *- 文本模型参数可能是 `query` 而不是 `messages` 数组*
> *- 视频模型参数可能是 `brief` (创意简报) 而不是复杂的配置项*

## 📥 输入参数 (Input Schema)

```json
{
  "description": "One bounded scene-segmentation request.",
  "properties": {
    "video_url": {
      "description": "Public HTTP(S) video URL that remains available while the task runs.",
      "title": "Video Url",
      "type": "string"
    },
    "min_segment_duration": {
      "default": 4.0,
      "description": "Minimum scene duration in seconds (1.0 to 100.0), strictly below max_segment_duration. Equal-duration segmentation is temporarily unsupported.",
      "maximum": 100.0,
      "minimum": 1.0,
      "title": "Min Segment Duration",
      "type": "number"
    },
    "max_segment_duration": {
      "default": 10.0,
      "description": "Maximum scene duration in seconds (1.0 to 100.0), strictly above min_segment_duration. For example, use minimum 4.0 and maximum 10.0.",
      "maximum": 100.0,
      "minimum": 1.0,
      "title": "Max Segment Duration",
      "type": "number"
    },
    "seg_mode": {
      "default": "precise",
      "description": "Scene split mode: precise or rough.",
      "enum": [
        "precise",
        "rough"
      ],
      "title": "Seg Mode",
      "type": "string"
    }
  },
  "required": [
    "video_url"
  ],
  "title": "ActionInput",
  "type": "object"
}
```

### 参数说明

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `video_url` | string | ✅ 是 | `-` | Public HTTP(S) video URL that remains available while the task runs. |
| `min_segment_duration` | number | ❌ 否 | `4.0` | Minimum scene duration in seconds (1.0 to 100.0), strictly below max_segment_duration. Equal-duration segmentation is temporarily unsupported. |
| `max_segment_duration` | number | ❌ 否 | `10.0` | Maximum scene duration in seconds (1.0 to 100.0), strictly above min_segment_duration. For example, use minimum 4.0 and maximum 10.0. |
| `seg_mode` | string enum | ❌ 否 | `precise` | Scene split mode: precise or rough. |

## 📤 输出结果 (Output Schema)

```json
{
  "properties": {
    "input_tokens": {
      "default": 0,
      "description": "输入消耗的词元数量",
      "title": "Input Tokens",
      "type": "integer"
    },
    "output_tokens": {
      "default": 0,
      "description": "输出消耗的词元数量",
      "title": "Output Tokens",
      "type": "integer"
    },
    "total_tokens": {
      "default": 0,
      "description": "总消耗的词元数量",
      "title": "Total Tokens",
      "type": "integer"
    },
    "model": {
      "default": "",
      "description": "实际使用的 SEE2AI 化身模型名称（由各 action 显式填写）",
      "title": "Model",
      "type": "string"
    },
    "source": {
      "default": "see2ai",
      "description": "服务来源（统一 `see2ai`；真实路由仅平台内部可见）",
      "title": "Source",
      "type": "string"
    },
    "cost_points": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算）",
      "title": "Cost Points"
    },
    "task_id": {
      "description": "Opaque task ID used for status polling.",
      "title": "Task Id",
      "type": "string"
    },
    "status": {
      "description": "Current normalized task status.",
      "enum": [
        "running",
        "success",
        "failed"
      ],
      "title": "Status",
      "type": "string"
    },
    "result_urls": {
      "description": "TOS result references populated on terminal success.",
      "items": {
        "type": "string"
      },
      "title": "Result Urls",
      "type": "array"
    },
    "segments_tos_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "TOS reference for the scene segments manifest.",
      "title": "Segments Tos Url"
    },
    "characters_registry_tos_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "TOS reference for the character registry.",
      "title": "Characters Registry Tos Url"
    },
    "prop_registry_tos_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "TOS reference for the prop registry.",
      "title": "Prop Registry Tos Url"
    },
    "scene_registry_tos_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "TOS reference for the scene registry.",
      "title": "Scene Registry Tos Url"
    },
    "shot_registry_tos_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "TOS reference for the shot registry.",
      "title": "Shot Registry Tos Url"
    },
    "video_duration_seconds": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Supplier-reported input-video duration in seconds.",
      "title": "Video Duration Seconds"
    },
    "segment_count": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Segment Count"
    },
    "character_count": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Character Count"
    },
    "retryable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether a nonterminal query should be retried.",
      "title": "Retryable"
    },
    "retry_after_seconds": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Retry After Seconds"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Brand-safe failure or retry guidance.",
      "title": "Error Message"
    }
  },
  "required": [
    "task_id",
    "status"
  ],
  "title": "VideoSceneSegmentationStatusOutput",
  "type": "object"
}
```

### 输出字段说明

| 字段名 | 类型 | 说明 |
|--------|------|------|
| `input_tokens` | integer | 输入消耗的词元数量 |
| `output_tokens` | integer | 输出消耗的词元数量 |
| `total_tokens` | integer | 总消耗的词元数量 |
| `model` | string | 实际使用的 SEE2AI 化身模型名称（由各 action 显式填写） |
| `source` | string | 服务来源（统一 `see2ai`；真实路由仅平台内部可见） |
| `cost_points` | integer / null | 预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算） |
| `task_id` | string | Opaque task ID used for status polling. |
| `status` | string enum | Current normalized task status. |
| `result_urls` | array | TOS result references populated on terminal success. |
| `segments_tos_url` | string / null | TOS reference for the scene segments manifest. |
| `characters_registry_tos_url` | string / null | TOS reference for the character registry. |
| `prop_registry_tos_url` | string / null | TOS reference for the prop registry. |
| `scene_registry_tos_url` | string / null | TOS reference for the scene registry. |
| `shot_registry_tos_url` | string / null | TOS reference for the shot registry. |
| `video_duration_seconds` | number / null | Supplier-reported input-video duration in seconds. |
| `segment_count` | integer / null |  |
| `character_count` | integer / null |  |
| `retryable` | boolean / null | Whether a nonterminal query should be retried. |
| `retry_after_seconds` | integer / null |  |
| `error_message` | string / null | Brand-safe failure or retry guidance. |

## 💡 调用示例

### cURL 示例

```bash
curl -X POST "https://see2ai.com/api/v1/actions/see2ai_video_scene_segmentation_v1" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-your-tenant-api-key" \
     -d '{
  "video_url": "https://example.com/video.mp4",
  "min_segment_duration": 4.0,
  "max_segment_duration": 10.0,
  "seg_mode": "precise"
}'
```

### Python 示例

```python
import requests

API_KEY = "sk-your-tenant-api-key"
ENDPOINT = "https://see2ai.com/api/v1/actions/see2ai_video_scene_segmentation_v1"

headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {API_KEY}"
}

payload = {
  "video_url": "https://example.com/video.mp4",
  "min_segment_duration": 4.0,
  "max_segment_duration": 10.0,
  "seg_mode": "precise"
}

response = requests.post(ENDPOINT, json=payload, headers=headers)
result = response.json()

print(f"结果：{result}")
```

## 💰 计费说明

> CNY 1.5 per input-video minute; up to CNY 90.0 for one hour.

**注意**: 所有费用都以词元为单位，系统会自动从租户余额中扣除。

## ⚠️ 常见错误码

| HTTP 状态码 | 错误原因 | 解决方案 |
| --- | --- | --- |
| `400` | Invalid video URL or segmentation parameters | 请稍后重试 |
| `402` | Insufficient balance for the maximum task charge | 请稍后重试 |
| `503` | Task submission or settlement is temporarily unavailable | 请稍后重试 |

## 📞 技术支持

- **文档问题**: 查看 [SEE2AI 官方文档](https://see2ai.com/docs)
- **API 状态**: 访问 [服务状态页面](https://see2ai.com/status)
- **问题反馈**: 联系技术支持团队

---

**API 版本**: see2ai_video_scene_segmentation_v1
**最后更新**: 2026-03-23
