# Seedance 2.0 Mini — Scenepond API

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

模型开发者: ByteDance

用途: 图生视频

原始页面: https://open.scenepond.ai/zh/models/bytedance/seedance-2.0-mini/image-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.image_url` — **条件必填**; `string`. 参考图
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - 约束: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。

- `parameters.prompt` — **条件必填**; `string`. 提示词
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.

- `parameters.reference_assets` — **条件必填**; `array<JSON value>`. 生成参数
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - 约束: 最少项数: 1; 最多项数: 2; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。

### parameters.reference_assets 中的字段

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

- `parameters.reference_assets[].role` — **可选**; `string`. 生成参数
  - 约束: 可选值: "first_frame", "last_frame"

- `parameters.reference_assets[].url` — **可选**; `string`. 生成参数
  - 约束: 最多字符数: 65536; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。


- `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.end_image_url` — **可选**; `string | null`. 尾帧
  - 约束: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。

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

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

- `parameters.last_frame_url` — **可选**; `string | null`. 尾帧
  - 约束: 最多字符数: 65536

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

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

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

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

- `parameters.start_image_url` — **条件必填**; `string`. 首帧
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - 约束: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。

- `parameters.first_frame_url` — **条件必填**; `string`. 首帧
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - 约束: 最多字符数: 65536

- `parameters.image_urls` — **条件必填**; `array<JSON value>`. 参考图
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - 约束: 最少项数: 1; 最多项数: 2; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。; image_url, start_image_url, end_image_url, image_urls[] 也可使用你本人上传且尚未过期的 scenepond-input:// 图片引用。

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

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

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

- `parameters.image` — **可选**; `object | string`. 生成参数

### parameters.image 中的字段

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

- `parameters.image.url` — **可选**; `string`. 生成参数


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

- `parameters.input_reference` — **可选**; `object | string`. 生成参数

### parameters.input_reference 中的字段

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

- `parameters.input_reference.url` — **可选**; `string`. 生成参数


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

### parameters.metadata 中的字段

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

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

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

- `parameters.metadata.end_image_url` — **可选**; `JSON value`. 尾帧

- `parameters.metadata.image_url` — **可选**; `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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "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/image-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"reference_assets\": [\n      {\n        \"media_type\": \"image\",\n        \"role\": \"first_frame\",\n        \"url\": \"https://example.com/reference.png\"\n      }\n    ],\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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "generate_audio": true,
    "aspect_ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }
}
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/image-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"reference_assets\": [\n      {\n        \"media_type\": \"image\",\n        \"role\": \"first_frame\",\n        \"url\": \"https://example.com/reference.png\"\n      }\n    ],\n    \"generate_audio\": true,\n    \"aspect_ratio\": \"16:9\",\n    \"duration\": 5,\n    \"resolution\": \"720p\"\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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "generate_audio": true,
    "aspect_ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }
})
});
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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_url": "https://example.com/reference.png",
    "count": 1,
    "generate_audio": true,
    "end_image_url": "https://example.com/reference.png",
    "last_frame_url": "https://example.com/reference.png",
    "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/image-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_url\": \"https://example.com/reference.png\",\n    \"count\": 1,\n    \"generate_audio\": true,\n    \"end_image_url\": \"https://example.com/reference.png\",\n    \"last_frame_url\": \"https://example.com/reference.png\",\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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_url": "https://example.com/reference.png",
    "count": 1,
    "generate_audio": true,
    "end_image_url": "https://example.com/reference.png",
    "last_frame_url": "https://example.com/reference.png",
    "seed": -1
  }
})
});
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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_url": "https://example.com/reference.png",
    "count": 1,
    "generate_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/image-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_url\": \"https://example.com/reference.png\",\n    \"count\": 1,\n    \"generate_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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_url": "https://example.com/reference.png",
    "count": 1,
    "generate_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);
```

<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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "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/image-to-video\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"reference_assets\": [\n      {\n        \"media_type\": \"image\",\n        \"role\": \"first_frame\",\n        \"url\": \"https://example.com/reference.png\"\n      }\n    ],\n    \"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/image-to-video",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "reference_assets": [
      {
        "media_type": "image",
        "role": "first_frame",
        "url": "https://example.com/reference.png"
      }
    ],
    "audio": true
  }
})
});
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/image-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/image-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/image-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 时请等待并继续查询原任务。任务查询暂停时请联系支持；此字段不代表可以重新生成或退款。


### 相关接口

#### 上传参考图片

`POST /v1/media/images`

使用 API Key 上传，然后将 data.reference 填入明确支持上传引用的图片字段。

- `file` — **必填**; `binary file`. 必须且只能包含一个名为 file、带文件名的 multipart 文件部分。服务端根据上传内容验证 PNG、JPEG 和 WebP 格式。
  - 约束: 最大值: 52428800 bytes (50 MiB); 宽高均为 1–8192 像素

- 使用相同的 Authorization: Bearer API Key 认证。将 SCENEPOND_IMAGE_PATH 设置为本地图片路径。Python 示例需要 requests 包；JavaScript 示例使用 Node.js 的 FormData 和 Blob。
- 使用 multipart/form-data，且只包含一个文件部分，不添加其他部分。由 HTTP 客户端自动生成 Content-Type 及 boundary，不要手动设置 boundary。
- 上传成功返回 HTTP 201，success 为 true，回执位于 data 中。data.id 以 img_ 开头；data.reference 为 scenepond-input:// 后接规范的小写 UUID。
- data.reference 仅可用于明确支持的图片 URL 字段，不能用于视频或音频字段。服务端检查归属和 expires_at、解析引用后，再执行所选模型更严格的媒体要求。
- 上传回执包含 content_type、以字节计的 size、width、height、sha256，以及以 Unix 秒计的 expires_at。上传不等于提交生成，也不保证所有模型均接受该图片。
- 账户预览字段仅供登录后的控制台使用，不属于 API Key 下载接口契约。此处未公开图片列表、删除图片、任务列表或取消任务接口。
- 上传校验错误返回 success: false、message 和 code：invalid_image（400）、image_too_large（413）、unsupported_image_format（415）、image_upload_interrupted（408）或 image_storage_unavailable（503）。不存在或已过期的引用会在使用时被拒绝。

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/media/images" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  --form "file=@$SCENEPOND_IMAGE_PATH"
```

##### Python

```python
import os
import requests

with open(os.environ["SCENEPOND_IMAGE_PATH"], "rb") as image:
    response = requests.post(
        "https://open.scenepond.ai/v1/media/images",
        headers={"Authorization": "Bearer " + os.environ["SCENEPOND_API_KEY"]},
        files={"file": image},
        timeout=60,
    )
response.raise_for_status()
print(response.json())
```

##### JavaScript

```javascript
import { readFile } from "node:fs/promises";
import { basename } from "node:path";

if (!process.env.SCENEPOND_IMAGE_PATH) throw new Error("Set SCENEPOND_IMAGE_PATH first");
const form = new FormData();
form.append("file", new Blob([await readFile(process.env.SCENEPOND_IMAGE_PATH)]), basename(process.env.SCENEPOND_IMAGE_PATH));
const response = await fetch("https://open.scenepond.ai/v1/media/images", {
  method: "POST",
  headers: { "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}` },
  body: form
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
console.log(await response.json());
```

##### 图片上传响应（HTTP 201）

```json
{
  "success": true,
  "data": {
    "id": "img_123e4567-e89b-42d3-a456-426614174000",
    "reference": "scenepond-input://123e4567-e89b-42d3-a456-426614174000",
    "content_type": "image/png",
    "size": 1024,
    "width": 512,
    "height": 512,
    "sha256": "0000000000000000000000000000000000000000000000000000000000000000",
    "expires_at": 1701209600
  }
}
```

##### 图片上传错误（HTTP 413）

```json
{
  "success": false,
  "message": "Invalid request",
  "code": "image_too_large"
}
```

### 调用注意事项

- 请求顶层只接受 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",
  "x-scenepond-constraints": {
    "version": 1,
    "rules": [
      {
        "kind": "reference-image-input",
        "paths": [
          "/image_url",
          "/start_image_url",
          "/end_image_url",
          "/image_urls/*",
          "/reference_assets/*/url"
        ],
        "scheme": "scenepond-input"
      }
    ]
  },
  "anyOf": [
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "public-http-url",
            "paths": [
              "/reference_assets/*/url",
              "/image_url",
              "/start_image_url",
              "/end_image_url"
            ],
            "allowCredentials": false,
            "allowWhitespace": false
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/start_image_url"
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/image_url",
              "/start_image_url",
              "/end_image_url",
              "/reference_assets/*/url"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "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
            }
          ]
        },
        "end_image_url": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "generate_audio": {
          "type": "boolean",
          "const": true,
          "default": true
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5000,
          "pattern": "\\S"
        },
        "reference_assets": {
          "allOf": [
            {
              "type": "array",
              "minItems": 1,
              "maxItems": 12,
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "media_type": {
                        "const": "image"
                      },
                      "role": {
                        "enum": [
                          "reference",
                          "first_frame",
                          "last_frame"
                        ]
                      },
                      "uri": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096,
                        "allOf": [
                          {
                            "not": {
                              "pattern": "^[\\s/]|\\s$|[\\r\\n\\x00\\\\]"
                            }
                          },
                          {
                            "anyOf": [
                              {
                                "pattern": "^[tT][oO][sS]:"
                              },
                              {
                                "not": {
                                  "pattern": "^[^/?#]*:"
                                }
                              }
                            ]
                          },
                          {
                            "not": {
                              "pattern": "%(?:[^0-9a-fA-F]|$)|%[0-9a-fA-F](?:[^0-9a-fA-F]|$)"
                            }
                          }
                        ]
                      }
                    },
                    "required": [
                      "role",
                      "media_type",
                      "uri"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "media_type": {
                        "const": "audio"
                      },
                      "role": {
                        "const": "reference"
                      },
                      "vid": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512,
                        "pattern": "^[^ \\t\\r\\n\\x00]+$",
                        "not": {
                          "pattern": "://"
                        }
                      }
                    },
                    "required": [
                      "role",
                      "media_type",
                      "vid"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "media_type": {
                        "const": "image"
                      },
                      "role": {
                        "enum": [
                          "reference",
                          "first_frame",
                          "last_frame"
                        ]
                      },
                      "url": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 65536,
                            "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                          },
                          {
                            "type": "string",
                            "format": "uri",
                            "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                          }
                        ]
                      }
                    },
                    "required": [
                      "role",
                      "media_type",
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "media_type": {
                        "const": "video"
                      },
                      "role": {
                        "enum": [
                          "reference"
                        ]
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 65536,
                        "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                      }
                    },
                    "required": [
                      "role",
                      "media_type",
                      "url"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "media_type": {
                        "const": "audio"
                      },
                      "role": {
                        "enum": [
                          "reference"
                        ]
                      },
                      "url": {
                        "type": "string",
                        "maxLength": 65536,
                        "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                      }
                    },
                    "required": [
                      "role",
                      "media_type",
                      "url"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "allOf": [
                {
                  "minContains": 0,
                  "maxContains": 9,
                  "contains": {
                    "properties": {
                      "media_type": {
                        "const": "image"
                      }
                    },
                    "required": [
                      "media_type"
                    ]
                  }
                },
                {
                  "minContains": 0,
                  "maxContains": 3,
                  "contains": {
                    "properties": {
                      "media_type": {
                        "const": "audio"
                      }
                    },
                    "required": [
                      "media_type"
                    ]
                  }
                },
                {
                  "minContains": 0,
                  "maxContains": 3,
                  "contains": {
                    "properties": {
                      "media_type": {
                        "const": "video"
                      }
                    },
                    "required": [
                      "media_type"
                    ]
                  }
                },
                {
                  "minContains": 0,
                  "maxContains": 1,
                  "contains": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "enum": [
                          "first_frame"
                        ]
                      }
                    },
                    "required": [
                      "role"
                    ]
                  }
                },
                {
                  "minContains": 0,
                  "maxContains": 1,
                  "contains": {
                    "type": "object",
                    "properties": {
                      "role": {
                        "enum": [
                          "last_frame"
                        ]
                      }
                    },
                    "required": [
                      "role"
                    ]
                  }
                },
                {
                  "not": {
                    "allOf": [
                      {
                        "contains": {
                          "type": "object",
                          "properties": {
                            "role": {
                              "enum": [
                                "first_frame",
                                "last_frame"
                              ]
                            }
                          },
                          "required": [
                            "role"
                          ]
                        }
                      },
                      {
                        "contains": {
                          "type": "object",
                          "properties": {
                            "role": {
                              "enum": [
                                "reference"
                              ]
                            }
                          },
                          "required": [
                            "role"
                          ]
                        }
                      }
                    ]
                  }
                }
              ]
            },
            {
              "maxItems": 2,
              "minContains": 1,
              "maxContains": 1,
              "items": {
                "properties": {
                  "media_type": {
                    "const": "image"
                  },
                  "role": {
                    "enum": [
                      "first_frame",
                      "last_frame"
                    ]
                  }
                }
              },
              "contains": {
                "type": "object",
                "properties": {
                  "role": {
                    "enum": [
                      "first_frame"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          ]
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "720p"
        },
        "start_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "not": {
            "required": [
              "reference_assets",
              "image_url"
            ]
          }
        },
        {
          "not": {
            "required": [
              "reference_assets",
              "start_image_url"
            ]
          }
        },
        {
          "not": {
            "required": [
              "reference_assets",
              "end_image_url"
            ]
          }
        }
      ],
      "anyOf": [
        {
          "required": [
            "reference_assets"
          ]
        },
        {
          "required": [
            "image_url"
          ]
        },
        {
          "required": [
            "start_image_url"
          ]
        }
      ]
    },
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "string-length",
            "path": "/prompt",
            "maximum": 30000,
            "unit": "utf16-code-units"
          },
          {
            "kind": "public-http-url",
            "paths": [
              "/image_url",
              "/end_image_url"
            ],
            "allowCredentials": false,
            "allowWhitespace": false
          },
          {
            "kind": "matching-aliases",
            "path": "/count",
            "otherPath": "/n"
          },
          {
            "kind": "matching-aliases",
            "path": "/generate_audio",
            "otherPath": "/audio"
          },
          {
            "kind": "public-http-url",
            "paths": [
              "/start_image_url",
              "/first_frame_url",
              "/last_frame_url",
              "/image_urls/*"
            ],
            "allowCredentials": false,
            "allowWhitespace": false
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/start_image_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/first_frame_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/image_urls/0"
          },
          {
            "kind": "matching-aliases",
            "path": "/start_image_url",
            "otherPath": "/first_frame_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/start_image_url",
            "otherPath": "/image_urls/0"
          },
          {
            "kind": "matching-aliases",
            "path": "/first_frame_url",
            "otherPath": "/image_urls/0"
          },
          {
            "kind": "matching-aliases",
            "path": "/end_image_url",
            "otherPath": "/last_frame_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/end_image_url",
            "otherPath": "/image_urls/1"
          },
          {
            "kind": "matching-aliases",
            "path": "/last_frame_url",
            "otherPath": "/image_urls/1"
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/image_url",
              "/start_image_url",
              "/end_image_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "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"
        },
        "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
                }
              ]
            }
          ]
        },
        "end_image_url": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "first_frame_url": {
          "type": "string",
          "maxLength": 65536,
          "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "prefixItems": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            },
            {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 65536,
                      "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            }
          ]
        },
        "last_frame_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "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"
          ]
        },
        "start_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?:\\/\\/[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        }
      },
      "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"
            ]
          }
        }
      ],
      "anyOf": [
        {
          "required": [
            "image_url"
          ]
        },
        {
          "required": [
            "start_image_url"
          ]
        },
        {
          "required": [
            "first_frame_url"
          ]
        },
        {
          "required": [
            "image_urls"
          ]
        }
      ]
    },
    {
      "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"
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/start_image_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/image_url",
            "otherPath": "/first_frame_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/start_image_url",
            "otherPath": "/first_frame_url"
          },
          {
            "kind": "matching-aliases",
            "path": "/end_image_url",
            "otherPath": "/last_frame_url"
          },
          {
            "kind": "public-http-url",
            "paths": [
              "/image_url",
              "/start_image_url",
              "/first_frame_url",
              "/end_image_url",
              "/last_frame_url",
              "/image_urls/*"
            ],
            "allowCredentials": false,
            "allowWhitespace": false
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/image_url",
              "/start_image_url",
              "/end_image_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "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
        },
        "end_image_url": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                },
                {
                  "type": "null"
                }
              ]
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "first_frame_url": {
          "type": "string",
          "maxLength": 65536,
          "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": false,
          "prefixItems": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            },
            {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 65536,
                      "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            }
          ]
        },
        "last_frame_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "null"
            }
          ]
        },
        "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"
          ]
        },
        "start_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https?://[^\\s/?#@\\\\\\x00]+(?:[/?][^\\s#\\\\\\x00]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        }
      },
      "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"
            ]
          }
        }
      ],
      "anyOf": [
        {
          "required": [
            "image_url"
          ]
        },
        {
          "required": [
            "start_image_url"
          ]
        },
        {
          "required": [
            "first_frame_url"
          ]
        },
        {
          "required": [
            "image_urls"
          ]
        }
      ]
    },
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "reference-image-input",
            "paths": [
              "/image_url",
              "/start_image_url",
              "/end_image_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "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
            }
          ]
        },
        "end_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "first_frame_url": {
          "type": "string",
          "maxLength": 65536,
          "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
        },
        "generate_audio": {
          "type": "boolean",
          "default": true
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 65536,
                "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
              },
              {
                "type": "string",
                "format": "uri",
                "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              }
            ]
          }
        },
        "last_frame_url": {
          "type": "string",
          "maxLength": 65536,
          "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
        },
        "n": {
          "type": "integer",
          "const": 1
        },
        "prompt": {
          "type": "string",
          "minLength": 1
        },
        "reference_assets": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": {
            "type": "object",
            "properties": {
              "media_type": {
                "type": "string",
                "enum": [
                  "image"
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "first_frame",
                  "last_frame"
                ]
              },
              "url": {
                "type": "string",
                "maxLength": 65536,
                "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
              }
            },
            "required": [
              "media_type",
              "role",
              "url"
            ],
            "additionalProperties": false
          },
          "contains": {
            "properties": {
              "role": {
                "const": "first_frame"
              }
            }
          }
        },
        "resolution": {
          "type": "string",
          "enum": [
            "480p",
            "720p"
          ],
          "default": "480p"
        },
        "start_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "pattern": "^https:\\/\\/[^\\s/?#@\\\\\\x00-\\x1f]+(?:[/?][^\\s#\\\\\\x00-\\x1f]*)?$"
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "not": {
        "required": [
          "reference_assets"
        ],
        "anyOf": [
          {
            "required": [
              "image_url"
            ]
          },
          {
            "required": [
              "start_image_url"
            ]
          },
          {
            "required": [
              "first_frame_url"
            ]
          },
          {
            "required": [
              "image_urls"
            ]
          },
          {
            "required": [
              "end_image_url"
            ]
          },
          {
            "required": [
              "last_frame_url"
            ]
          }
        ]
      },
      "anyOf": [
        {
          "required": [
            "image_url"
          ]
        },
        {
          "required": [
            "start_image_url"
          ]
        },
        {
          "required": [
            "first_frame_url"
          ]
        },
        {
          "required": [
            "image_urls"
          ]
        },
        {
          "required": [
            "reference_assets"
          ]
        }
      ]
    },
    {
      "$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",
              "image_url",
              "end_image_url",
              "aspect_ratio"
            ],
            "imageMode": "first-last",
            "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"
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/image_url",
              "/end_image_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "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
            }
          ]
        },
        "end_image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "format": "uri",
              "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#\\\\]+(?:[/?][^\\s#\\\\]*)?$",
              "not": {
                "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
              }
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "generate_audio": {
          "type": "boolean",
          "const": true,
          "default": true
        },
        "image": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri",
              "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#]+(?:[/?#][^\\s]*)?$",
              "not": {
                "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
              }
            },
            {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#]+(?:[/?#][^\\s]*)?$",
                  "not": {
                    "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
                  }
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": true
            }
          ]
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 65536,
              "format": "uri",
              "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#\\\\]+(?:[/?][^\\s#\\\\]*)?$",
              "not": {
                "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
              }
            },
            {
              "type": "string",
              "format": "uri",
              "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "items": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 65536,
                "format": "uri",
                "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#\\\\]+(?:[/?][^\\s#\\\\]*)?$",
                "not": {
                  "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
                }
              },
              {
                "type": "string",
                "format": "uri",
                "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              }
            ]
          }
        },
        "input": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": true
            }
          ]
        },
        "input_reference": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri",
              "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#]+(?:[/?#][^\\s]*)?$",
              "not": {
                "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
              }
            },
            {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#]+(?:[/?#][^\\s]*)?$",
                  "not": {
                    "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
                  }
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": true
            }
          ]
        },
        "metadata": {
          "type": "object",
          "properties": {
            "aspect_ratio": true,
            "duration": true,
            "end_image_url": true,
            "generate_audio": true,
            "image_url": true,
            "model": true,
            "prompt": true,
            "resolution": true
          },
          "additionalProperties": false
        },
        "model": true,
        "n": {
          "const": 1
        },
        "prompt": {
          "type": "string",
          "maxLength": 4000,
          "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"
              },
              {
                "kind": "string-length",
                "path": "/image_url",
                "maximum": 65536,
                "unit": "utf8-bytes"
              },
              {
                "kind": "string-length",
                "path": "/end_image_url",
                "maximum": 65536,
                "unit": "utf8-bytes"
              },
              {
                "kind": "public-http-url",
                "paths": [
                  "/image_url",
                  "/end_image_url"
                ],
                "allowCredentials": false,
                "allowWhitespace": false,
                "requirePublicHost": true
              },
              {
                "kind": "reference-image-input",
                "paths": [
                  "/image_url",
                  "/end_image_url"
                ],
                "scheme": "scenepond-input"
              }
            ]
          },
          "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
                }
              ]
            },
            "end_image_url": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "format": "uri",
                  "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#\\\\]+(?:[/?][^\\s#\\\\]*)?$",
                  "not": {
                    "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
                  }
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            },
            "generate_audio": {
              "type": "boolean",
              "const": true,
              "default": true
            },
            "image_url": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 65536,
                  "format": "uri",
                  "pattern": "^[hH][tT][tT][pP][sS]?://[^\\s/?#\\\\]+(?:[/?][^\\s#\\\\]*)?$",
                  "not": {
                    "pattern": "^[hH][tT][tT][pP][sS]?://[^/]*@"
                  }
                },
                {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^scenepond-input://[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                }
              ]
            },
            "prompt": {
              "type": "string",
              "maxLength": 4000,
              "not": {
                "pattern": "\\x00|\\{\\{\\s*(?:[nN][oO][dD][eE]|[rR][eE][sS]|[uU][rR][iI]|[vV][iI][dD])\\s*:"
              }
            },
            "resolution": {
              "enum": [
                "720p"
              ],
              "default": "720p"
            }
          },
          "required": [
            "image_url"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  ]
}
```
