# see2ai_video_generation_premium_v1

> SEE2AI 高精度视频生成服务，支持文生视频、图生视频、首尾帧控制以及多镜头生成，适合对画面质量和镜头控制要求更高的场景。

## 📖 接入指引

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

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

### Endpoints

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

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

## 📥 输入参数 (Input Schema)

```json
{
  "description": "AI视频生成输入参数模型",
  "properties": {
    "prompt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "描述想要生成的视频的文本提示词。当 multi_shots 为 false 时生效。",
      "title": "Prompt"
    },
    "image_urls": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "maxItems": 2,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": [],
      "description": "输入的参考图片 URL 列表（支持首尾帧，图生视频必填）。注意：只接受公网 URL。如果长度为1，则作为首帧；长度为2，则作为首尾帧。",
      "title": "Image Urls"
    },
    "sound": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "是否开启音效。",
      "title": "Sound"
    },
    "duration": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "5",
      "description": "生成视频的时长（秒），支持 3 到 15。",
      "examples": [
        "5",
        "10",
        "15"
      ],
      "title": "Duration"
    },
    "aspect_ratio": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "16:9",
      "description": "生成视频的宽高比。提供 image_urls 时可选，系统将自动适配。",
      "examples": [
        "16:9",
        "9:16",
        "1:1"
      ],
      "title": "Aspect Ratio"
    },
    "mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "pro",
      "description": "生成模式，std（标准分辨率）或 pro（高分辨率）。",
      "examples": [
        "std",
        "pro"
      ],
      "title": "Mode"
    },
    "multi_shots": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": false,
      "description": "是否启用多镜头模式。",
      "title": "Multi Shots"
    },
    "multi_prompt": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": [],
      "description": "多镜头模式下的分镜提示词数组，每个元素包含 prompt 和 duration。",
      "title": "Multi Prompt"
    },
    "reference_elements": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": [],
      "description": "Reusable reference elements. Each element can include name, description, and element_input_urls (2-4 public image URLs). Reference them in the prompt with tags such as @element_dog.",
      "title": "Reference Elements"
    },
    "callBackUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "可选的回调 URL，用于在生成任务完成时接收包含生成结果的 POST 请求。",
      "title": "Callbackurl"
    }
  },
  "title": "VideoGenerationInput",
  "type": "object"
}
```

### 参数说明

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `prompt` | string / null | ❌ 否 | `-` | 描述想要生成的视频的文本提示词。当 multi_shots 为 false 时生效。 |
| `image_urls` | array / null | ❌ 否 | `[]` | 输入的参考图片 URL 列表（支持首尾帧，图生视频必填）。注意：只接受公网 URL。如果长度为1，则作为首帧；长度为2，则作为首尾帧。 |
| `sound` | boolean / null | ❌ 否 | `False` | 是否开启音效。 |
| `duration` | string / null | ❌ 否 | `5` | 生成视频的时长（秒），支持 3 到 15。 |
| `aspect_ratio` | string / null | ❌ 否 | `16:9` | 生成视频的宽高比。提供 image_urls 时可选，系统将自动适配。 |
| `mode` | string / null | ❌ 否 | `pro` | 生成模式，std（标准分辨率）或 pro（高分辨率）。 |
| `multi_shots` | boolean / null | ❌ 否 | `False` | 是否启用多镜头模式。 |
| `multi_prompt` | array / null | ❌ 否 | `[]` | 多镜头模式下的分镜提示词数组，每个元素包含 prompt 和 duration。 |
| `reference_elements` | array / null | ❌ 否 | `[]` | Reusable reference elements. Each element can include name, description, and element_input_urls (2-4 public image URLs). Reference them in the prompt with tags such as @element_dog. |
| `callBackUrl` | string / null | ❌ 否 | `-` | 可选的回调 URL，用于在生成任务完成时接收包含生成结果的 POST 请求。 |

## 📤 输出结果 (Output Schema)

```json
{
  "description": "AI视频生成输出参数模型",
  "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"
    },
    "result_urls": {
      "default": [],
      "description": "生成的视频 URL 列表",
      "items": {
        "type": "string"
      },
      "title": "Result Urls",
      "type": "array"
    },
    "task_id": {
      "description": "生成任务的 ID",
      "title": "Task Id",
      "type": "string"
    },
    "cost_time": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "生成耗时（毫秒）",
      "title": "Cost Time"
    },
    "state": {
      "description": "任务最终状态",
      "title": "State",
      "type": "string"
    },
    "provider_config_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "内部配置 ID（用于追溯）",
      "title": "Provider Config Id"
    }
  },
  "required": [
    "task_id",
    "state"
  ],
  "title": "VideoGenerationOutput",
  "type": "object"
}
```

### 输出字段说明

| 字段名 | 类型 | 说明 |
|--------|------|------|
| `input_tokens` | integer | 输入消耗的词元数量 |
| `output_tokens` | integer | 输出消耗的词元数量 |
| `total_tokens` | integer | 总消耗的词元数量 |
| `model` | string | 实际使用的 SEE2AI 化身模型名称（由各 action 显式填写） |
| `source` | string | 服务来源（统一 `see2ai`；真实路由仅平台内部可见） |
| `cost_points` | integer / null | 预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算） |
| `result_urls` | array | 生成的视频 URL 列表 |
| `task_id` | string | 生成任务的 ID |
| `cost_time` | integer / null | 生成耗时（毫秒） |
| `state` | string | 任务最终状态 |
| `provider_config_id` | integer / null | 内部配置 ID（用于追溯） |

## 💡 调用示例

### cURL 示例

```bash
curl -X POST "https://see2ai.com/api/v1/actions/see2ai_video_generation_premium_v1" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-your-tenant-api-key" \
     -d '{
  "prompt": "Create a clean product visual with clear composition.",
  "image_urls": [],
  "sound": false,
  "duration": "5",
  "aspect_ratio": "16:9",
  "mode": "pro",
  "multi_shots": false,
  "multi_prompt": [],
  "reference_elements": []
}'
```

### Python 示例

```python
import requests

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

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

payload = {
  "prompt": "Create a clean product visual with clear composition.",
  "image_urls": [],
  "sound": false,
  "duration": "5",
  "aspect_ratio": "16:9",
  "mode": "pro",
  "multi_shots": false,
  "multi_prompt": [],
  "reference_elements": []
}

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

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

## 💰 计费说明

> 按生成时长、模式（std/pro）和是否带音频动态计费

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

## ⚠️ 常见错误码

| HTTP 状态码 | 错误原因 | 解决方案 |
| --- | --- | --- |
| `400` | 参数错误，如缺失 prompt 或无效的时长 | 请稍后重试 |
| `401` | API Key 无效或未授权 | 检查 API Key 是否正确，或联系管理员充值 |
| `402` | 账号余额不足 | 请稍后重试 |
| `429` | 请求超限，达到速率限制 | 降低请求频率，或联系管理员调整限流配置 |
| `500` | SEE2AI 视频生成服务内部错误或生成失败 | 稍后重试，如持续失败请联系技术支持 |
| `504` | 任务轮询超时（例如任务处理超过指定时间限制） | 请稍后重试 |

## 📞 技术支持

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

---

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