# Seedance 2.0 Mini — Scenepond API

模型 ID: `bytedance/seedance-2.0-mini/text-to-video`

模型开发者: ByteDance

用途: 文生视频

原始页面: https://open.scenepond.ai/zh/models/bytedance/seedance-2.0-mini/text-to-video#api

API 地址: `https://open.scenepond.ai/v1`

每次请求使用 Authorization: Bearer 和 Scenepond API Key 认证；密钥保存在服务器。

## Scenepond 异步任务

`POST /v1/tasks`

### 请求参数

- `model` — **必填**; `string`. 使用此处显示的完整公开模型 ID。

- `parameters` — **必填**; `object`. 此模型的生成参数。

### parameters 中的字段

仅在提供 parameters 时适用；子字段必填不代表可选的父字段也必填。

- `parameters.aspect_ratio` — **可选**; `string`. 画幅
  - 默认: `"16:9"`
  - 约束: 可选值: "adaptive", "21:9", "16:9", "9:16", "4:3", "1:1", "3:4", "auto"

- `parameters.duration` — **可选**; `integer`. 时长
  - 默认: `5`
  - 约束: 最小值: 4; 最大值: 15

- `parameters.generate_audio` — **可选**; `boolean`. 生成音频
  - 默认: `true`

- `parameters.prompt` — **可选**; `string`. 提示词

- `parameters.resolution` — **可选**; `string`. 分辨率
  - 约束: 可选值: "480p", "720p"

- `parameters.auto_enhance_prompt` — **可选**; `boolean`. 生成参数
  - 约束: 同时传入 auto_enhance_prompt 和 enhance_prompt 时，两者的值须一致。

- `parameters.enhance_prompt` — **可选**; `boolean`. 生成参数
  - 约束: 同时传入 auto_enhance_prompt 和 enhance_prompt 时，两者的值须一致。

- `parameters.negative_prompt` — **可选**; `string`. 反向提示词

- `parameters.seed` — **可选**; `number`. 随机种子

- `parameters.duration_secs` — **可选**; `integer`. 生成参数
  - 约束: 最小值: 4; 最大值: 15; 同时传入 duration 和 duration_secs 时，两者的值须一致。

<details>
<summary>兼容参数</summary>

- `parameters.audio` — **可选**; `boolean`. 生成音频

- `parameters.seconds` — **可选**; `string | integer`. 时长
  - 约束: 最小值: 4; 最大值: 15

- `parameters.size` — **可选**; `string`. 图片尺寸
  - 约束: 可选值: "auto", "480p", "720p", "1280x720", "720x1280"

- `parameters.input` — **可选**; `array<JSON value> | string`. 生成参数

- `parameters.metadata` — **可选**; `object`. 生成参数

### parameters.metadata 中的字段

仅在提供 parameters.metadata 时适用；子字段必填不代表可选的父字段也必填。

- `parameters.metadata.aspect_ratio` — **可选**; `JSON value`. 画幅

- `parameters.metadata.duration` — **可选**; `JSON value`. 时长

- `parameters.metadata.prompt` — **可选**; `JSON value`. 提示词


</details>


- `callback_url` — **可选**; `string`. 可选的任务完成回调。请使用不超过 2048 字节的公网 HTTPS 地址，不能包含身份凭证或片段标识。

### 请求头

- `headers.Authorization` — **必填**; `string`. Bearer 后接你的 Scenepond API Key。

- `headers.Content-Type` — **必填**; `string`. 提交任务时使用 application/json。

- `headers.X-Scenepond-Max-Reservation` — **可选**; `string`. 可选的初始预留额度上限，以配额单位计。最终用量结算可能不同。若所需预留额度超过此上限，将在发送给供应商前以 reservation_changed 拒绝请求。
  - 约束: 整数值 = 0..2147483647

### 最小调用

#### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true
  }
}
JSON
```

#### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"generate_audio\": true\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

#### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

### 可选参数示例

#### 包含可选参数的请求 1

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "aspect_ratio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "auto_enhance_prompt": true,
    "enhance_prompt": true,
    "seed": -1
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"generate_audio\": true,\n    \"aspect_ratio\": \"16:9\",\n    \"duration\": 5,\n    \"resolution\": \"720p\",\n    \"auto_enhance_prompt\": true,\n    \"enhance_prompt\": true,\n    \"seed\": -1\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "aspect_ratio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "auto_enhance_prompt": true,
    "enhance_prompt": true,
    "seed": -1
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

<details>
<summary>兼容参数示例</summary>

#### 包含可选参数的请求 1

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "audio": true,
    "duration_secs": 4
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"audio\": true,\n    \"duration_secs\": 4\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "audio": true,
    "duration_secs": 4
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 包含可选参数的请求 2

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "seconds": 4
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"generate_audio\": true,\n    \"seconds\": 4\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "seconds": 4
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 包含可选参数的请求 3

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "size": "auto"
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"generate_audio\": true,\n    \"size\": \"auto\"\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "generate_audio": true,
    "size": "auto"
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 包含可选参数的请求 4

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "generate_audio": true,
    "input": "A quiet lakeside at sunrise, soft light and a clear subject."
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"generate_audio\": true,\n    \"input\": \"A quiet lakeside at sunrise, soft light and a clear subject.\"\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "generate_audio": true,
    "input": "A quiet lakeside at sunrise, soft light and a clear subject."
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 包含可选参数的请求 5

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "metadata": {
      "prompt": "A quiet lakeside at sunrise, soft light and a clear subject."
    }
  }
}
JSON
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

payload = json.loads("{\n  \"model\": \"bytedance/seedance-2.0-mini/text-to-video\",\n  \"parameters\": {\n    \"metadata\": {\n      \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\"\n    }\n  }\n}")

request = Request(
    "https://open.scenepond.ai/v1/tasks",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode("utf-8"),
    method="POST",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "parameters": {
    "metadata": {
      "prompt": "A quiet lakeside at sunrise, soft light and a clear subject."
    }
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

</details>

### 后续请求

#### 2. 查询任务状态

每隔几秒查询一次，直到 succeeded 或 failed。

`GET /v1/tasks/{task_id}`

##### cURL

```bash
curl --fail-with-body -X GET "https://open.scenepond.ai/v1/tasks/$SCENEPOND_TASK_ID" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY"
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

request = Request(
    "https://open.scenepond.ai/v1/tasks/" + quote(os.environ["SCENEPOND_TASK_ID"], safe="") + "",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    method="GET",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
if (!process.env.SCENEPOND_TASK_ID) throw new Error("Set SCENEPOND_TASK_ID first");
const response = await fetch("https://open.scenepond.ai/v1/tasks/" + encodeURIComponent(process.env.SCENEPOND_TASK_ID) + "", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  }
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 3. 获取生成结果

任务 succeeded 后列出产物，并使用同一个 API Key 下载各个 content_url。

`GET /v1/tasks/{task_id}/artifacts`

##### cURL

```bash
curl --fail-with-body -X GET "https://open.scenepond.ai/v1/tasks/$SCENEPOND_TASK_ID/artifacts" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY"
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

request = Request(
    "https://open.scenepond.ai/v1/tasks/" + quote(os.environ["SCENEPOND_TASK_ID"], safe="") + "/artifacts",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    method="GET",
)
with urlopen(request) as response:
    result = json.load(response)
print(json.dumps(result, indent=2))
```

##### JavaScript

```javascript
if (!process.env.SCENEPOND_TASK_ID) throw new Error("Set SCENEPOND_TASK_ID first");
const response = await fetch("https://open.scenepond.ai/v1/tasks/" + encodeURIComponent(process.env.SCENEPOND_TASK_ID) + "/artifacts", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  }
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

#### 4. 到期前下载

将 SCENEPOND_TASK_ID 设为 task_id，将 SCENEPOND_ARTIFACT_KEY 设为 artifacts[].key。请在 expires_at 到期前下载二进制文件。内容接口支持 GET、HEAD 和 Range 请求；仅保存 content_url 无法保留媒体文件。

`GET /v1/tasks/{task_id}/artifacts/{artifact_key}/content`

##### cURL

```bash
curl --fail-with-body --output output.bin -X GET "https://open.scenepond.ai/v1/tasks/$SCENEPOND_TASK_ID/artifacts/$SCENEPOND_ARTIFACT_KEY/content" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY"
```

##### Python

```python
import os
import json
from urllib.parse import quote
from urllib.request import Request, urlopen

request = Request(
    "https://open.scenepond.ai/v1/tasks/" + quote(os.environ["SCENEPOND_TASK_ID"], safe="") + "/artifacts/" + quote(os.environ["SCENEPOND_ARTIFACT_KEY"], safe="") + "/content",
    headers={
        "Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"],
        "Content-Type": "application/json",
    },
    method="GET",
)
with urlopen(request) as response:
    with open("output.bin", "wb") as output:
        output.write(response.read())
print("Saved output.bin")
```

##### JavaScript

```javascript
import { writeFile } from "node:fs/promises";
if (!process.env.SCENEPOND_TASK_ID) throw new Error("Set SCENEPOND_TASK_ID first");
if (!process.env.SCENEPOND_ARTIFACT_KEY) throw new Error("Set SCENEPOND_ARTIFACT_KEY first");
const response = await fetch("https://open.scenepond.ai/v1/tasks/" + encodeURIComponent(process.env.SCENEPOND_TASK_ID) + "/artifacts/" + encodeURIComponent(process.env.SCENEPOND_ARTIFACT_KEY) + "/content", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  }
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
await writeFile("output.bin", Buffer.from(await response.arrayBuffer()));
console.log("Saved output.bin");
```

### 响应示例

响应示例仅展示结构；ID、URL 和数值为占位内容。

#### 提交响应

```json
{
  "task_id": "task_EXAMPLE",
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "status": "queued",
  "progress": 0,
  "created_at": 1700000000,
  "finished_at": 0,
  "error": null,
  "links": {
    "self": "/v1/tasks/task_EXAMPLE",
    "artifacts": "/v1/tasks/task_EXAMPLE/artifacts"
  }
}
```

#### 已完成任务的状态

```json
{
  "task_id": "task_EXAMPLE",
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "status": "succeeded",
  "progress": 100,
  "created_at": 1700000000,
  "finished_at": 1700000060,
  "error": null,
  "links": {
    "self": "/v1/tasks/task_EXAMPLE",
    "artifacts": "/v1/tasks/task_EXAMPLE/artifacts"
  }
}
```

#### 失败任务状态（HTTP 200）

```json
{
  "task_id": "task_EXAMPLE",
  "model": "bytedance/seedance-2.0-mini/text-to-video",
  "status": "failed",
  "progress": 0,
  "created_at": 1700000000,
  "finished_at": 1700000060,
  "error": {
    "code": "input_media_unavailable",
    "message": "Reference media could not be downloaded or its format is unsupported / 参考素材无法下载或格式不支持",
    "retryable": false,
    "charged": false
  },
  "links": {
    "self": "/v1/tasks/task_EXAMPLE",
    "artifacts": "/v1/tasks/task_EXAMPLE/artifacts"
  }
}
```

#### 提交被拒绝（HTTP 400）

```json
{
  "error": {
    "code": "invalid_parameters",
    "message": "Invalid generation parameters / 生成参数无效",
    "retryable": false,
    "submission": "not_submitted"
  }
}
```

#### 生成文件列表

```json
{
  "task_id": "task_EXAMPLE",
  "artifacts": [
    {
      "key": "video",
      "type": "video",
      "mime_type": "video/mp4",
      "content_url": "https://open.scenepond.ai/v1/tasks/task_EXAMPLE/artifacts/video/content",
      "expires_at": 1701209660
    }
  ]
}
```

#### 结果过期响应（API Key 鉴权）

```json
{
  "error": {
    "message": "Artifact content has expired or is no longer available",
    "type": "artifact_expired",
    "code": "artifact_expired"
  }
}
```

### 响应字段

- `response.task_id` — **必填**; `string`. 任务标识符，请原样保存；拼接 URL 路径时进行 URL 编码。

- `response.model` — **必填**; `string`. 此任务使用的公开模型 ID。

- `response.status` — **必填**; `string`. 任务状态：queued、processing、succeeded 或 failed。

- `response.progress` — **必填**; `integer`. 进度范围为 0–100；仅 succeeded 状态保证为 100。

- `response.created_at` — **必填**; `integer`. 创建时间，单位为 Unix 秒。

- `response.finished_at` — **必填**; `integer`. 完成时间，单位为 Unix 秒；任务进入终态前为 0。

- `response.error` — **必填**; `object | null`. 终态失败处理完成前为 null。

### response.error 中的字段

仅在提供 response.error 时适用；子字段必填不代表可选的父字段也必填。

- `response.error.code` — **必填**; `string`. 公开的任务失败分类。

- `response.error.message` — **必填**; `string`. 可公开的安全失败说明。

- `response.error.retryable` — **必填**; `boolean`. 重试是否可能成功；重新提交前请检查现有任务及扣费情况。

- `response.error.charged` — **必填**; `boolean`. 失败任务是否仍有扣费，仅在返回此字段时据此判断。


- `response.links` — **必填**; `object`. 查询此任务和获取产物列表的相对路径。

### response.links 中的字段

仅在提供 response.links 时适用；子字段必填不代表可选的父字段也必填。

- `response.links.self` — **必填**; `string`. 任务状态查询路径。

- `response.links.artifacts` — **必填**; `string`. 产物列表路径。


- `response.attention` — **可选**; `object`. 可选的非终态查询提示。等待时间较长的任务保持 queued 或 processing，此提示不代表生成失败。

### response.attention 中的字段

仅在提供 response.attention 时适用；子字段必填不代表可选的父字段也必填。

- `response.attention.code` — **必填**; `string`. generation_delayed、provider_query_retrying 或 provider_query_paused。

- `response.attention.message` — **必填**; `string`. 可公开的安全查询提示。

- `response.attention.required_action` — **必填**; `string`. generation_delayed 时请等待并继续查询原任务。任务查询暂停时请联系支持；此字段不代表可以重新生成或退款。


### 调用注意事项

- 请求顶层只接受 model、parameters 和 callback_url。生成设置必须放在 parameters 内。
- 图片和视频使用同一套 Scenepond 任务接口。选择模型并设置生成参数即可。
- 每次请求使用 Authorization: Bearer 和 Scenepond API Key 认证；密钥保存在服务器。
- 提交一次并保存 task_id，轮询至 succeeded 或 failed，再通过结果接口下载。
- 请求受理后返回任务 ID；部分任务可能在返回 ID 时已完成。
- 首次提交被接受后返回 HTTP 202，并带有 Location: /v1/tasks/{task_id}。特定服务的提交恢复机制并非已公开的通用幂等接口。
- 生成产物保存 14 天。请在 expires_at 前下载；过期后无法恢复。
- POST 超时后请勿自动重提，任务可能已创建并产生费用。
- GET 任务状态接口没有公开的筛选或分页参数。此契约不包含公开的任务列表或取消任务路由。
- 任务提交错误使用 error.code、error.message 和 error.retryable；提交前被拒绝时，error.submission 可能为 not_submitted。提交错误不保证返回 charged 信息。认证或路由失败可能采用不同的错误结构，请同时检查 HTTP 状态码。
- 当前任务失败码为 content_policy_violation、invalid_parameters、reservation_changed、input_media_unavailable、generation_timeout、upstream_unavailable、artifact_storage_failed 和 generation_failed。排障中的旧别名仅为兼容说明，不是新增的当前任务失败码。
- 任务失败时，状态查询仍返回 HTTP 200，并包含 error.retryable 和 error.charged。retryable 不代表可以安全地自动提交另一个可能计费的任务。
- 可选的 attention 提示出现时，任务保持非终态，error 为 null。generation_delayed 表示原任务等待时间较长，保持 queued 或 processing，不代表已确认排队位置或实际生成进度。provider_query_retrying 表示正在重试查询；provider_query_paused 表示需要人工处理。此处不承诺公开的恢复、提交核对或人工操作接口。
- 可选的 callback_url 必须为非 null 字符串，使用不超过 2048 个 UTF-8 字节的公网 HTTPS URL，不能含凭据、片段或空白字符。公网 DNS 和目标地址由服务端检查。
- 完成回调会在扣费结算完成后，以 POST 发送终态任务 JSON。请验证 Scenepond-Signature: t=<unix_seconds>,v1=<hex_hmac> 和 Scenepond-Event-ID；HMAC-SHA256 签名原文为 timestamp + "." + event_id + "." + 完整的原始请求体。
- 使用账户完整的 whsec_ 签名密钥（包括前缀）作为 UTF-8 HMAC 密钥；它与 API Key 不同。获取和轮换密钥需要已登录账户的安全流程及重新认证。此处未公开可凭 API Key 获取该密钥的接口；启用回调前请联系支持安排验签。
- 请使用恒定时间比较验证签名，并限制可接受的时间戳窗口。按 Scenepond-Event-ID 去重，及时返回 2xx，并持久化处理事件。同一事件 ID 和请求体可能重复投递；每次尝试都会使用新的签名时间戳。
- 回调投递超时为 5 秒，不跟随重定向，仅将 2xx 视为成功。最多尝试 6 次，失败后的重试间隔依次为 10、20、40、80 和 160 秒。投递失败时仍可轮询任务状态。
- 生成的图片和视频只保存 14 天，请在到期前下载并保存到本地。
- 已存储的结果包含 expires_at，表示该文件到期时间的 Unix 时间戳（秒）。请逐个文件使用此字段，不要按任务创建时间推算。
- 部分历史结果可能没有 expires_at，这不代表永久保存，请尽快下载。
- 到期后，使用 API Key 鉴权且不带 access 查询参数的内容请求返回 HTTP 410，错误码为 artifact_expired。私有访问链接在内容不可用时可能返回 404。过期文件无法继续下载或恢复。
- 请勿公开 content_url。保存链接不等于保存文件，请在 expires_at 到期前将文件内容下载到自己的存储。
- 视频费用按公布的每秒参考价估算。

### 模型参数（JSON）

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "adaptive",
            "21:9",
            "16:9",
            "9:16",
            "4:3",
            "1:1",
            "3:4"
          ],
          "default": "16:9"
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "const": 1
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "duration": {
          "default": 5,
          "allOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "number",
              "maximum": 3600,
              "exclusiveMinimum": 0
            }
          ]
        },
        "generate_audio": {
          "type": "boolean",
          "const": true,
          "default": true
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "pattern": "\\S"
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "720p"
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    },
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "string-length",
            "path": "/prompt",
            "maximum": 30000,
            "unit": "utf16-code-units"
          },
          {
            "kind": "matching-aliases",
            "path": "/count",
            "otherPath": "/n"
          },
          {
            "kind": "matching-aliases",
            "path": "/generate_audio",
            "otherPath": "/audio"
          },
          {
            "kind": "matching-aliases",
            "path": "/auto_enhance_prompt",
            "otherPath": "/enhance_prompt"
          }
        ]
      },
      "type": "object",
      "properties": {
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "16:9",
            "4:3",
            "1:1",
            "3:4",
            "9:16",
            "21:9",
            "adaptive",
            "auto"
          ],
          "default": "16:9"
        },
        "audio": {
          "type": "boolean"
        },
        "auto_enhance_prompt": {
          "type": "boolean"
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "const": 1
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "duration": {
          "default": 5,
          "allOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "anyOf": [
                {
                  "const": -1
                },
                {
                  "type": "number",
                  "maximum": 3600,
                  "exclusiveMinimum": 0
                }
              ]
            }
          ]
        },
        "enhance_prompt": {
          "type": "boolean"
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "n": {
          "type": "integer",
          "const": 1
        },
        "negative_prompt": {
          "type": "string",
          "pattern": "^\\s*$"
        },
        "prompt": {
          "type": "string",
          "maxLength": 30000,
          "default": ""
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "720p"
        },
        "seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "string",
              "pattern": "^0*(?:4|5|6|7|8|9|10|11|12|13|14|15)$"
            }
          ]
        },
        "seed": {
          "type": "number",
          "default": -1
        },
        "size": {
          "type": "string",
          "enum": [
            "auto",
            "480p",
            "720p",
            "1280x720",
            "720x1280"
          ]
        }
      },
      "required": [],
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "required": [
              "duration",
              "seconds"
            ],
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 4
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 4
                        },
                        {
                          "type": "string",
                          "pattern": "^0*4$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 5
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 5
                        },
                        {
                          "type": "string",
                          "pattern": "^0*5$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 6
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 6
                        },
                        {
                          "type": "string",
                          "pattern": "^0*6$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 7
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 7
                        },
                        {
                          "type": "string",
                          "pattern": "^0*7$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 8
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 8
                        },
                        {
                          "type": "string",
                          "pattern": "^0*8$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 9
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 9
                        },
                        {
                          "type": "string",
                          "pattern": "^0*9$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 10
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 10
                        },
                        {
                          "type": "string",
                          "pattern": "^0*10$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 11
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 11
                        },
                        {
                          "type": "string",
                          "pattern": "^0*11$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 12
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 12
                        },
                        {
                          "type": "string",
                          "pattern": "^0*12$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 13
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 13
                        },
                        {
                          "type": "string",
                          "pattern": "^0*13$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 14
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 14
                        },
                        {
                          "type": "string",
                          "pattern": "^0*14$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 15
                        },
                        {
                          "anyOf": [
                            {
                              "const": -1
                            },
                            {
                              "type": "number",
                              "maximum": 3600,
                              "exclusiveMinimum": 0
                            }
                          ]
                        }
                      ]
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 15
                        },
                        {
                          "type": "string",
                          "pattern": "^0*15$"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "480p"
                }
              },
              "size": {
                "const": "480p"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "720p"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "1280x720"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "aspect_ratio": {
                "not": {
                  "const": "16:9"
                }
              },
              "size": {
                "const": "1280x720"
              }
            },
            "required": [
              "size",
              "aspect_ratio"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "720x1280"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "aspect_ratio": {
                "not": {
                  "const": "9:16"
                }
              },
              "size": {
                "const": "720x1280"
              }
            },
            "required": [
              "size",
              "aspect_ratio"
            ]
          }
        }
      ]
    },
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "matching-aliases",
            "path": "/count",
            "otherPath": "/n"
          },
          {
            "kind": "matching-aliases",
            "path": "/generate_audio",
            "otherPath": "/audio"
          },
          {
            "kind": "matching-aliases",
            "path": "/duration",
            "otherPath": "/duration_secs"
          }
        ]
      },
      "type": "object",
      "properties": {
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "auto",
            "21:9",
            "16:9",
            "4:3",
            "1:1",
            "3:4",
            "9:16"
          ],
          "default": "16:9"
        },
        "audio": {
          "type": "boolean"
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "const": 1
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "duration": {
          "default": 5,
          "allOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "number",
              "maximum": 3600,
              "exclusiveMinimum": 0
            }
          ]
        },
        "duration_secs": {
          "type": "integer",
          "minimum": 4,
          "maximum": 15
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "n": {
          "type": "integer",
          "const": 1
        },
        "negative_prompt": {
          "type": "string",
          "pattern": "^\\s*$"
        },
        "prompt": {
          "type": "string",
          "default": ""
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "720p"
        },
        "seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "string",
              "pattern": "^0*(?:4|5|6|7|8|9|10|11|12|13|14|15)$"
            }
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "auto",
            "480p",
            "720p",
            "1280x720",
            "720x1280"
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "required": [
              "seconds"
            ],
            "not": {
              "anyOf": [
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 4
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 4
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 4
                        },
                        {
                          "type": "string",
                          "pattern": "^0*4$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 5
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 5
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 5
                        },
                        {
                          "type": "string",
                          "pattern": "^0*5$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 6
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 6
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 6
                        },
                        {
                          "type": "string",
                          "pattern": "^0*6$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 7
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 7
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 7
                        },
                        {
                          "type": "string",
                          "pattern": "^0*7$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 8
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 8
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 8
                        },
                        {
                          "type": "string",
                          "pattern": "^0*8$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 9
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 9
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 9
                        },
                        {
                          "type": "string",
                          "pattern": "^0*9$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 10
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 10
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 10
                        },
                        {
                          "type": "string",
                          "pattern": "^0*10$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 11
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 11
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 11
                        },
                        {
                          "type": "string",
                          "pattern": "^0*11$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 12
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 12
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 12
                        },
                        {
                          "type": "string",
                          "pattern": "^0*12$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 13
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 13
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 13
                        },
                        {
                          "type": "string",
                          "pattern": "^0*13$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 14
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 14
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 14
                        },
                        {
                          "type": "string",
                          "pattern": "^0*14$"
                        }
                      ]
                    }
                  }
                },
                {
                  "properties": {
                    "duration": {
                      "allOf": [
                        {
                          "const": 15
                        },
                        {
                          "type": "number",
                          "maximum": 3600,
                          "exclusiveMinimum": 0
                        }
                      ]
                    },
                    "duration_secs": {
                      "const": 15
                    },
                    "seconds": {
                      "anyOf": [
                        {
                          "const": 15
                        },
                        {
                          "type": "string",
                          "pattern": "^0*15$"
                        }
                      ]
                    }
                  }
                }
              ]
            },
            "anyOf": [
              {
                "required": [
                  "duration"
                ]
              },
              {
                "required": [
                  "duration_secs"
                ]
              }
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "1280x720"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "aspect_ratio": {
                "not": {
                  "const": "16:9"
                }
              },
              "size": {
                "const": "1280x720"
              }
            },
            "required": [
              "size",
              "aspect_ratio"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "720x1280"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "aspect_ratio": {
                "not": {
                  "const": "9:16"
                }
              },
              "size": {
                "const": "720x1280"
              }
            },
            "required": [
              "size",
              "aspect_ratio"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "480p"
                }
              },
              "size": {
                "const": "480p"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        },
        {
          "not": {
            "properties": {
              "resolution": {
                "not": {
                  "const": "720p"
                }
              },
              "size": {
                "const": "720p"
              }
            },
            "required": [
              "size",
              "resolution"
            ]
          }
        }
      ]
    },
    {
      "type": "object",
      "properties": {
        "aspect_ratio": {
          "type": "string",
          "enum": [
            "auto",
            "adaptive",
            "21:9",
            "16:9",
            "4:3",
            "1:1",
            "3:4",
            "9:16"
          ],
          "default": "16:9"
        },
        "audio": {
          "type": "boolean"
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "const": 1
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "duration": {
          "default": 5,
          "allOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "number",
              "maximum": 3600,
              "exclusiveMinimum": 0
            }
          ]
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "n": {
          "type": "integer",
          "const": 1
        },
        "prompt": {
          "type": "string",
          "minLength": 1
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "480p"
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false
    },
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "generation-input-aliases",
            "normalizationVersion": 1,
            "nativeSchemaRef": "#/$defs/nativeParameters",
            "nativeFields": [
              "prompt",
              "resolution",
              "generate_audio",
              "duration",
              "aspect_ratio",
              "output_format"
            ],
            "imageMode": "none",
            "allowSeconds": true,
            "sizeResolutionPolicy": "equal",
            "imageArrayPolicy": "exclusive",
            "allowStartImageAlias": false,
            "allowAudioAlias": false,
            "ignoredFields": [
              "model",
              "stream",
              "background"
            ],
            "rejectedFields": [
              "count",
              "response_format"
            ],
            "sizePresets": {
              "1024x1024": {
                "resolution": "1k",
                "aspect_ratio": "1:1"
              },
              "1080x1920": {
                "resolution": "1080p",
                "aspect_ratio": "9:16"
              },
              "1280x720": {
                "resolution": "720p",
                "aspect_ratio": "16:9"
              },
              "1920x1080": {
                "resolution": "1080p",
                "aspect_ratio": "16:9"
              },
              "2048x2048": {
                "resolution": "2k",
                "aspect_ratio": "1:1"
              },
              "2160x3840": {
                "resolution": "4k",
                "aspect_ratio": "9:16"
              },
              "3840x2160": {
                "resolution": "4k",
                "aspect_ratio": "16:9"
              },
              "4096x4096": {
                "resolution": "4k",
                "aspect_ratio": "1:1"
              },
              "720x1280": {
                "resolution": "720p",
                "aspect_ratio": "9:16"
              }
            }
          },
          {
            "kind": "parameter-effect",
            "path": "/model",
            "behavior": "pinned-model"
          },
          {
            "kind": "parameter-effect",
            "path": "/metadata/model",
            "behavior": "pinned-model"
          },
          {
            "kind": "parameter-effect",
            "path": "/stream",
            "behavior": "validated-but-not-forwarded"
          },
          {
            "kind": "parameter-effect",
            "path": "/background",
            "behavior": "validated-but-not-forwarded"
          },
          {
            "kind": "parameter-effect",
            "path": "/n",
            "behavior": "validated-but-not-forwarded"
          }
        ]
      },
      "type": "object",
      "properties": {
        "aspect_ratio": {
          "enum": [
            "16:9",
            "4:3",
            "1:1",
            "3:4",
            "9:16",
            "21:9"
          ],
          "default": "16:9"
        },
        "background": true,
        "duration": {
          "default": 5,
          "allOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "number",
              "maximum": 3600,
              "exclusiveMinimum": 0
            }
          ]
        },
        "generate_audio": {
          "type": "boolean",
          "const": true,
          "default": true
        },
        "input": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": true
            }
          ]
        },
        "metadata": {
          "type": "object",
          "properties": {
            "aspect_ratio": true,
            "duration": true,
            "generate_audio": true,
            "model": true,
            "output_format": true,
            "prompt": true,
            "resolution": true
          },
          "additionalProperties": false
        },
        "model": true,
        "n": {
          "const": 1
        },
        "output_format": {
          "type": "string",
          "enum": [
            "mp4"
          ],
          "const": "mp4",
          "default": "mp4"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4000,
          "pattern": "\\S",
          "not": {
            "pattern": "\\x00|\\{\\{\\s*(?:[nN][oO][dD][eE]|[rR][eE][sS]|[uU][rR][iI]|[vV][iI][dD])\\s*:"
          }
        },
        "resolution": {
          "enum": [
            "720p"
          ],
          "default": "720p"
        },
        "seconds": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 4,
              "maximum": 15
            },
            {
              "type": "string",
              "pattern": "^0*(?:4|5|6|7|8|9|10|11|12|13|14|15)$"
            }
          ]
        },
        "size": {
          "type": "string",
          "enum": [
            "auto",
            "720p",
            "1280x720",
            "720x1280"
          ]
        },
        "stream": true
      },
      "$defs": {
        "nativeParameters": {
          "x-scenepond-constraints": {
            "version": 1,
            "rules": [
              {
                "kind": "string-length",
                "path": "/prompt",
                "maximum": 4000,
                "unit": "utf16-code-units"
              }
            ]
          },
          "type": "object",
          "properties": {
            "aspect_ratio": {
              "enum": [
                "16:9",
                "4:3",
                "1:1",
                "3:4",
                "9:16",
                "21:9"
              ],
              "default": "16:9"
            },
            "duration": {
              "default": 5,
              "allOf": [
                {
                  "type": "integer",
                  "minimum": 4,
                  "maximum": 15
                },
                {
                  "type": "number",
                  "maximum": 3600,
                  "exclusiveMinimum": 0
                }
              ]
            },
            "generate_audio": {
              "type": "boolean",
              "const": true,
              "default": true
            },
            "output_format": {
              "type": "string",
              "enum": [
                "mp4"
              ],
              "const": "mp4",
              "default": "mp4"
            },
            "prompt": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4000,
              "pattern": "\\S",
              "not": {
                "pattern": "\\x00|\\{\\{\\s*(?:[nN][oO][dD][eE]|[rR][eE][sS]|[uU][rR][iI]|[vV][iI][dD])\\s*:"
              }
            },
            "resolution": {
              "enum": [
                "720p"
              ],
              "default": "720p"
            }
          },
          "required": [
            "prompt"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  ]
}
```
