# 镜头生成

> Generate a video shot from text and optional images, or create a new shot from a source video.

## 📖 接入指引

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

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

### Endpoints

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

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

## 📥 输入参数 (Input Schema)

```json
{
  "additionalProperties": false,
  "examples": [
    {
      "aspect_ratio": "9:16",
      "duration": 5,
      "generate_audio": true,
      "image_urls": [],
      "mode": "generate",
      "prompt": "A slow close-up of a cup on a table.",
      "quality": "standard",
      "resolution": "720p"
    }
  ],
  "properties": {
    "mode": {
      "enum": [
        "generate",
        "fission"
      ],
      "title": "Mode",
      "type": "string"
    },
    "prompt": {
      "title": "Prompt",
      "type": "string"
    },
    "image_urls": {
      "items": {
        "type": "string"
      },
      "maxItems": 9,
      "title": "Image Urls",
      "type": "array"
    },
    "video_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Video Url"
    },
    "quality": {
      "default": "standard",
      "enum": [
        "standard",
        "fast"
      ],
      "title": "Quality",
      "type": "string"
    },
    "resolution": {
      "default": "720p",
      "enum": [
        "480p",
        "720p",
        "1080p"
      ],
      "title": "Resolution",
      "type": "string"
    },
    "aspect_ratio": {
      "default": "adaptive",
      "enum": [
        "adaptive",
        "16:9",
        "4:3",
        "1:1",
        "3:4",
        "9:16",
        "21:9"
      ],
      "title": "Aspect Ratio",
      "type": "string"
    },
    "duration": {
      "anyOf": [
        {
          "maximum": 15,
          "minimum": 4,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whole seconds from 4 to 15; required except for seedance-2.5 fission, which keeps the source length.",
      "title": "Duration"
    },
    "generate_audio": {
      "default": true,
      "description": "Whether to generate audio with the result; omitted means true.",
      "title": "Generate Audio",
      "type": "boolean"
    },
    "model": {
      "anyOf": [
        {
          "enum": [
            "seedance-2.0",
            "seedance-2.5"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional video model; omit it to keep seedance-2.0. seedance-2.5 supports standard quality at 480p or 720p; its fission keeps the source video's length, so omit duration.",
      "title": "Model"
    },
    "provider_route": {
      "anyOf": [
        {
          "const": "general",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional general-account route; omit to preserve the existing tenant policy.",
      "title": "Provider Route"
    }
  },
  "required": [
    "mode",
    "prompt"
  ],
  "title": "ActionInput",
  "type": "object"
}
```

### 参数说明

| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|--------|------|------|--------|------|
| `mode` | string enum | ✅ 是 | `-` |  |
| `prompt` | string | ✅ 是 | `-` |  |
| `image_urls` | array | ❌ 否 | `-` |  |
| `video_url` | string / null | ❌ 否 | `-` |  |
| `quality` | string enum | ❌ 否 | `standard` |  |
| `resolution` | string enum | ❌ 否 | `720p` |  |
| `aspect_ratio` | string enum | ❌ 否 | `adaptive` |  |
| `duration` | integer / null | ❌ 否 | `-` | Whole seconds from 4 to 15; required except for seedance-2.5 fission, which keeps the source length. |
| `generate_audio` | boolean | ❌ 否 | `True` | Whether to generate audio with the result; omitted means true. |
| `model` | string enum / null | ❌ 否 | `-` | Optional video model; omit it to keep seedance-2.0. seedance-2.5 supports standard quality at 480p or 720p; its fission keeps the source video's length, so omit duration. |
| `provider_route` | string / null | ❌ 否 | `-` | Optional general-account route; omit to preserve the existing tenant policy. |

## 📤 输出结果 (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": {
      "const": "see2ai-video-shot-generation-v1",
      "default": "see2ai-video-shot-generation-v1",
      "title": "Model",
      "type": "string"
    },
    "source": {
      "const": "see2ai",
      "default": "see2ai",
      "title": "Source",
      "type": "string"
    },
    "cost_points": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算）",
      "title": "Cost Points"
    },
    "task_id": {
      "title": "Task Id",
      "type": "string"
    },
    "status": {
      "enum": [
        "running",
        "success",
        "failed"
      ],
      "title": "Status",
      "type": "string"
    },
    "result_urls": {
      "items": {
        "type": "string"
      },
      "title": "Result Urls",
      "type": "array"
    },
    "video_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Video Url"
    },
    "retryable": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Retryable"
    },
    "retry_after_seconds": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Retry After Seconds"
    },
    "error_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error Code"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error Message"
    },
    "reason_category": {
      "anyOf": [
        {
          "const": "content_safety",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Reason Category"
    },
    "warnings": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Warnings"
    }
  },
  "required": [
    "task_id",
    "status"
  ],
  "title": "VideoShotGenerationStatusOutput",
  "type": "object"
}
```

### 输出字段说明

| 字段名 | 类型 | 说明 |
|--------|------|------|
| `input_tokens` | integer | 输入消耗的词元数量 |
| `output_tokens` | integer | 输出消耗的词元数量 |
| `total_tokens` | integer | 总消耗的词元数量 |
| `model` | string |  |
| `source` | string |  |
| `cost_points` | integer / null | 预先计算的扣费词元（如果插件内部已经计算好费用，则直接使用此值，忽略基于词元的计算） |
| `task_id` | string |  |
| `status` | string enum |  |
| `result_urls` | array |  |
| `video_url` | string / null |  |
| `retryable` | boolean / null |  |
| `retry_after_seconds` | integer / null |  |
| `error_code` | string / null |  |
| `error_message` | string / null |  |
| `reason_category` | string / null |  |
| `warnings` | array / null |  |

## 💡 调用示例

### cURL 示例

```bash
curl -X POST "https://see2ai.com/api/v1/actions/see2ai_video_shot_generation_v1" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-your-tenant-api-key" \
     -d '{
  "aspect_ratio": "9:16",
  "duration": 5,
  "generate_audio": true,
  "image_urls": [],
  "mode": "generate",
  "prompt": "A slow close-up of a cup on a table.",
  "quality": "standard",
  "resolution": "720p"
}'
```

### Python 示例

```python
import requests

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

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

payload = {
  "aspect_ratio": "9:16",
  "duration": 5,
  "generate_audio": true,
  "image_urls": [],
  "mode": "generate",
  "prompt": "A slow close-up of a cup on a table.",
  "quality": "standard",
  "resolution": "720p"
}

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

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

## 💰 计费说明

> Measured list price by mode, resolution and duration; maximum CNY 95.5374.

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

## ⚠️ 常见错误码

| HTTP 状态码 | 错误原因 | 解决方案 |
| --- | --- | --- |
| `400` | Invalid shot media or parameters | 请稍后重试 |
| `402` | Insufficient balance for the task ceiling | 请稍后重试 |
| `503` | Shot submission or settlement is temporarily unavailable | 请稍后重试 |

## 📞 技术支持

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

---

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