# Seedance 2.0 Mini — Scenepond API

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

Model developer: ByteDance

Purpose: Image to video

Source page: https://open.scenepond.ai/en/models/bytedance/seedance-2.0-mini/image-to-video#api

Base URL: `https://open.scenepond.ai/v1`

Authenticate every request with Authorization: Bearer and your Scenepond API key. Keep the key on your server.

## Scenepond asynchronous tasks

`POST /v1/tasks`

### Request parameters

- `model` — **Required**; `string`. Use this exact public model ID.

- `parameters` — **Required**; `object`. Generation parameters for this model.

### Fields in parameters

These fields apply when parameters is supplied. A required child does not make its optional parent required.

- `parameters.image_url` — **Conditional**; `string`. Reference image
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - Constraints: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.

- `parameters.prompt` — **Conditional**; `string`. Prompt
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.

- `parameters.reference_assets` — **Conditional**; `array<JSON value>`. Generation parameter
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - Constraints: Minimum items: 1; Maximum items: 2; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.

### Fields in parameters.reference_assets

These fields apply when parameters.reference_assets is supplied. A required child does not make its optional parent required.

- `parameters.reference_assets[].role` — **Optional**; `string`. Generation parameter
  - Constraints: Allowed values: "first_frame", "last_frame"

- `parameters.reference_assets[].url` — **Optional**; `string`. Generation parameter
  - Constraints: Maximum characters: 65536; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.


- `parameters.aspect_ratio` — **Optional**; `string`. Aspect ratio
  - Default: `"16:9"`
  - Constraints: Allowed values: "adaptive", "21:9", "16:9", "9:16", "4:3", "1:1", "3:4", "auto"

- `parameters.duration` — **Optional**; `integer`. Duration
  - Default: `5`
  - Constraints: Minimum value: 4; Maximum value: 15

- `parameters.end_image_url` — **Optional**; `string | null`. Last frame
  - Constraints: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.

- `parameters.generate_audio` — **Optional**; `boolean`. Generate audio
  - Default: `true`

- `parameters.resolution` — **Optional**; `string`. Resolution
  - Constraints: Allowed values: "480p", "720p"

- `parameters.last_frame_url` — **Optional**; `string | null`. Last frame
  - Constraints: Maximum characters: 65536

- `parameters.negative_prompt` — **Optional**; `string`. Negative prompt

- `parameters.seed` — **Optional**; `number`. Seed

- `parameters.duration_secs` — **Optional**; `integer`. Generation parameter
  - Constraints: Minimum value: 4; Maximum value: 15; When duration and duration_secs are both supplied, their values must match.

<details>
<summary>Compatibility parameters</summary>

- `parameters.start_image_url` — **Conditional**; `string`. First frame
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - Constraints: image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.

- `parameters.first_frame_url` — **Conditional**; `string`. First frame
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - Constraints: Maximum characters: 65536

- `parameters.image_urls` — **Conditional**; `array<JSON value>`. Reference images
  - Provide at least one of: prompt + reference_assets; image_url; start_image_url; first_frame_url; image_urls.
  - Constraints: Minimum items: 1; Maximum items: 2; image_url, start_image_url, end_image_url, image_urls[], reference_assets[].url also accept scenepond-input:// references to your own uploaded images until they expire.; image_url, start_image_url, end_image_url, image_urls[] also accept scenepond-input:// references to your own uploaded images until they expire.

- `parameters.audio` — **Optional**; `boolean`. Generate audio

- `parameters.seconds` — **Optional**; `string | integer`. Duration
  - Constraints: Minimum value: 4; Maximum value: 15

- `parameters.size` — **Optional**; `string`. Image size
  - Constraints: Allowed values: "auto", "480p", "720p", "1280x720", "720x1280"

- `parameters.image` — **Optional**; `object | string`. Generation parameter

### Fields in parameters.image

These fields apply when parameters.image is supplied. A required child does not make its optional parent required.

- `parameters.image.url` — **Optional**; `string`. Generation parameter


- `parameters.input` — **Optional**; `array<JSON value> | string`. Generation parameter

- `parameters.input_reference` — **Optional**; `object | string`. Generation parameter

### Fields in parameters.input_reference

These fields apply when parameters.input_reference is supplied. A required child does not make its optional parent required.

- `parameters.input_reference.url` — **Optional**; `string`. Generation parameter


- `parameters.metadata` — **Optional**; `object`. Generation parameter

### Fields in parameters.metadata

These fields apply when parameters.metadata is supplied. A required child does not make its optional parent required.

- `parameters.metadata.aspect_ratio` — **Optional**; `JSON value`. Aspect ratio

- `parameters.metadata.duration` — **Optional**; `JSON value`. Duration

- `parameters.metadata.end_image_url` — **Optional**; `JSON value`. Last frame

- `parameters.metadata.image_url` — **Optional**; `JSON value`. Reference image

- `parameters.metadata.prompt` — **Optional**; `JSON value`. Prompt


</details>


- `callback_url` — **Optional**; `string`. Optional task completion webhook. Use a public HTTPS URL of at most 2048 bytes, without credentials or a fragment.

### Request headers

- `headers.Authorization` — **Required**; `string`. Bearer followed by your Scenepond API key.

- `headers.Content-Type` — **Required**; `string`. Use application/json for task submission.

- `headers.X-Scenepond-Max-Reservation` — **Optional**; `string`. Optional limit on the initial reservation in quota units. Final usage settlement can differ. A larger reservation is rejected before dispatch with reservation_changed.
  - Constraints: integer value = 0..2147483647

### Minimum request

#### 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);
```

### Optional parameter examples

#### Request with optional parameters 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);
```

#### Request with optional parameters 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);
```

#### Request with optional parameters 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>Compatibility examples</summary>

#### Request with optional parameters 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>

### Follow-up requests

#### 2. Check task status

Poll every few seconds until succeeded or 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. Get the results

After succeeded, list artifacts and download each content_url with the same API key.

`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. Download before expiry

Set SCENEPOND_TASK_ID to task_id and SCENEPOND_ARTIFACT_KEY to artifacts[].key. Download the binary file before expires_at. The content endpoint supports GET, HEAD, and Range requests; saving content_url alone does not save the media.

`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");
```

### Illustrative responses

Response examples show the structure only. IDs, URLs, and values are placeholders.

#### Submission response

```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"
  }
}
```

#### Completed task status

```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"
  }
}
```

#### Failed task status (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"
  }
}
```

#### Submission rejection (HTTP 400)

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

#### Artifact listing

```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
    }
  ]
}
```

#### Expired artifact response (API key authentication)

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

### Response fields

- `response.task_id` — **Required**; `string`. Opaque task identifier. Save it and URL-encode it when building a path.

- `response.model` — **Required**; `string`. The public model ID used for this task.

- `response.status` — **Required**; `string`. Task state: queued, processing, succeeded, or failed.

- `response.progress` — **Required**; `integer`. Progress from 0 to 100; only succeeded guarantees 100.

- `response.created_at` — **Required**; `integer`. Creation time as Unix seconds.

- `response.finished_at` — **Required**; `integer`. Finish time as Unix seconds, or 0 before the task is terminal.

- `response.error` — **Required**; `object | null`. Null until a terminal failure is finalized.

### Fields in response.error

These fields apply when response.error is supplied. A required child does not make its optional parent required.

- `response.error.code` — **Required**; `string`. Public task failure classification.

- `response.error.message` — **Required**; `string`. Safe public failure explanation.

- `response.error.retryable` — **Required**; `boolean`. Whether retrying may succeed; check the existing task and billing before resubmitting.

- `response.error.charged` — **Required**; `boolean`. Whether the failed task retains a charge. Read this only when returned.


- `response.links` — **Required**; `object`. Relative paths for retrieving this task and its artifacts.

### Fields in response.links

These fields apply when response.links is supplied. A required child does not make its optional parent required.

- `response.links.self` — **Required**; `string`. Task status path.

- `response.links.artifacts` — **Required**; `string`. Artifact listing path.


- `response.attention` — **Optional**; `object`. Optional non-terminal observation notice. A delayed task keeps its queued or processing status; this is not a failed generation.

### Fields in response.attention

These fields apply when response.attention is supplied. A required child does not make its optional parent required.

- `response.attention.code` — **Required**; `string`. generation_delayed, provider_query_retrying, or provider_query_paused.

- `response.attention.message` — **Required**; `string`. Safe public observation notice.

- `response.attention.required_action` — **Required**; `string`. Wait and keep checking the original task for generation_delayed. Contact support for a paused task; this field does not authorize a new generation or refund.


### Related endpoints

#### Upload a reference image

`POST /v1/media/images`

Upload with your API key, then use data.reference in an image field that declares support for uploaded references.

- `file` — **Required**; `binary file`. Exactly one multipart file part named file, with a filename. PNG, JPEG, and WebP are verified from the uploaded bytes.
  - Constraints: Maximum value: 52428800 bytes (50 MiB); width and height = 1–8192 pixels

- Authenticate with the same Authorization: Bearer API key. Set SCENEPOND_IMAGE_PATH to the local image path. Python examples require the requests package; JavaScript examples use Node.js FormData and Blob.
- Use multipart/form-data with exactly one file part and no other parts. Let the HTTP client generate Content-Type and its boundary; do not set the boundary yourself.
- A successful upload returns HTTP 201 with success: true and the receipt inside data. data.id starts with img_; data.reference uses scenepond-input:// followed by a canonical lowercase UUID.
- Use data.reference only in declared image URL fields, not video or audio fields. The server checks ownership and expires_at, resolves the reference, and then applies the selected model’s stricter media requirements.
- The upload receipt contains content_type, size in bytes, width, height, sha256, and expires_at in Unix seconds. An upload is not a generation request or a guarantee that every model accepts that image.
- Account preview fields are for the signed-in dashboard and are not an API-key download contract. No public image-list, image-delete, task-list, or task-cancel API is published here.
- Upload validation errors use success: false with message and code: invalid_image (400), image_too_large (413), unsupported_image_format (415), image_upload_interrupted (408), or image_storage_unavailable (503). Missing or expired references are rejected when used.

##### 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());
```

##### Image upload response (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
  }
}
```

##### Image upload error (HTTP 413)

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

### Request notes

- Only model, parameters and callback_url are accepted at the request top level. Put generation settings inside parameters.
- Images and videos use the same Scenepond task API. Select a model and its generation settings.
- Authenticate every request with Authorization: Bearer and your Scenepond API key. Keep the key on your server.
- Submit once, save task_id, then poll until succeeded or failed. Download results from the artifacts endpoint.
- Creation returns the task ID after acceptance. Some tasks may already be complete when the ID is returned.
- Fresh accepted submissions return HTTP 202 with Location: /v1/tasks/{task_id}. Provider-specific submission recovery is not a published general idempotency API.
- Generated artifacts are stored for 14 days. Download them before expires_at; expired artifacts cannot be recovered.
- Do not automatically resubmit a timed-out POST. It may already have created a billable task.
- GET task status has no published filter or pagination parameters. There is no public task-list or task-cancel route in this contract.
- Task submission errors use error.code, error.message, and error.retryable; error.submission may be not_submitted for a pre-submission rejection. Submission errors do not include a charged guarantee. Authentication and routing failures may use a different error shape; also check the HTTP status.
- Current task failure codes are content_policy_violation, invalid_parameters, reservation_changed, input_media_unavailable, generation_timeout, upstream_unavailable, artifact_storage_failed, and generation_failed. Legacy aliases in troubleshooting are compatibility guidance, not additional current task codes.
- A failed task is returned by a successful HTTP 200 status query with error.retryable and error.charged. Retryable does not mean safe to submit another billable task automatically.
- An optional attention notice keeps the task non-terminal with error: null. generation_delayed means the original task is taking longer than usual and keeps its queued or processing status; it does not confirm a queue position or actual generation progress. provider_query_retrying means observation is retrying; provider_query_paused requires operator attention. No public resume, reconciliation, or operator-action endpoint is promised.
- Optional callback_url must be a non-null string containing a public HTTPS URL of at most 2048 UTF-8 bytes, without credentials, fragments, or whitespace. Public DNS and destination addresses are checked by the server.
- A completion callback is a POST of the terminal task JSON after billing is finalized. Verify Scenepond-Signature: t=<unix_seconds>,v1=<hex_hmac> and Scenepond-Event-ID using HMAC-SHA256 over timestamp + "." + event_id + "." + the exact raw request body.
- Use the full per-account whsec_ signing secret as the UTF-8 HMAC key, including its prefix; it is separate from your API key. Key retrieval and rotation require an authenticated account security flow and reauthentication. No public API-key endpoint for retrieving that secret is published here; contact support to arrange webhook verification before enabling callbacks.
- Verify signatures with constant-time comparison and enforce a timestamp freshness window. Deduplicate by Scenepond-Event-ID, return 2xx promptly, and process the event durably. Deliveries may repeat with the same event ID and body; each attempt gets a fresh signature timestamp.
- Callback delivery has a 5-second timeout, does not follow redirects, and accepts only 2xx. It makes at most 6 attempts, with retry delays of 10, 20, 40, 80, and 160 seconds after failures. Polling remains available if delivery fails.
- Replace example media URLs with your own publicly accessible files before submitting.
- Generated images and videos are stored for 14 days. Download and save them before expiry.
- Each stored artifact includes expires_at, its expiry time as a Unix timestamp in seconds. Use that value for each file; do not calculate expiry from the task creation time.
- Some older results may omit expires_at. This does not mean unlimited storage; download them as soon as possible.
- After expiry, content requests authenticated with an API key (without an access query parameter) return HTTP 410 with code artifact_expired. Private access links may return 404 for unavailable content. Expired files cannot be downloaded or recovered.
- Keep content_url private. Saving a link does not preserve the file; download the actual bytes to your own storage before expires_at.
- Video charges use the published estimated per-second rates.

### Model parameters (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
    }
  ]
}
```
