# GPT Image 2.5 Flare — Scenepond API

模型 ID: `openai/gpt-image-2.5/flare/edit`

模型开发者: OpenAI

用途: 图生图

原始页面: https://open.scenepond.ai/zh/models/openai/gpt-image-2.5/flare/edit#api

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

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

## Scenepond 异步任务

`POST /v1/tasks`

### 请求参数

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

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

### parameters 中的字段

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

- `parameters.image_urls` — **必填**; `array<string>`. 参考图
  - 约束: 最少项数: 1; 最多项数: 16

- `parameters.prompt` — **必填**; `string`. 提示词
  - 约束: 最少字符数: 1; 最多字符数: 32000; 须至少包含一个非空白字符。

- `parameters.background` — **可选**; `string | null`. 透明背景请选择 PNG 或 WebP 输出；JPEG 不支持透明背景。
  - 默认: `"auto"`
  - 约束: 可选值: "auto", "transparent", "opaque", null

- `parameters.image_size` — **可选**; `object | string | null`. 图片尺寸
  - 默认: `"auto"`
  - 约束: 可选择 square_hd、square、portrait_4_3、portrait_16_9、landscape_4_3、landscape_16_9 或 auto，也可传入包含 width 和 height 的对象。自定义宽高须为 16 的倍数且不超过 3840 像素，总像素为 655360–8294400，长边不得超过短边的 3 倍。; 新请求优先使用 image_size，size 是兼容别名。自定义尺寸对象不要同时传入这两项；使用相匹配的预设值时可同时传入。旧尺寸映射为：1024x1024 → square_hd、512x512 → square、768x1024 → portrait_4_3、1024x768 → landscape_4_3。

### parameters.image_size 中的字段

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

- `parameters.image_size.height` — **条件必填**; `integer`. 图片高度，单位为像素。
  - 当 image_size 为对象时必填。
  - 约束: 最小值: 16; 最大值: 3840

- `parameters.image_size.width` — **条件必填**; `integer`. 图片宽度，单位为像素。
  - 当 image_size 为对象时必填。
  - 约束: 最小值: 16; 最大值: 3840


- `parameters.mask_url` — **可选**; `string | null`. 蒙版用于指导编辑区域，区域外的像素仍可能变化。image_passthrough=false 时，以白色标记待编辑区域，黑色标记希望保留的区域。image_passthrough=true 时，使用与首张参考图同尺寸的 PNG 蒙版；透明区域指导编辑，不透明区域指导保留。

- `parameters.num_images` — **可选**; `integer | null`. 图片数量
  - 约束: 最小值: 1; 最大值: 10; num_images 是原生图片数量参数，范围为 1–10。count 是兼容别名；同时传入时，两者必须相同。

- `parameters.output_compression` — **可选**; `integer | null`. 仅在显式设置 output_format 为 jpeg 或 webp 时，才可将 output_compression 设为 0–100 的整数。PNG 请省略 output_compression 或设为 null。未声明固定压缩默认值。
  - 约束: 最小值: 0; 最大值: 100

- `parameters.output_format` — **可选**; `string | null`. 透明背景请选择 PNG 或 WebP 输出；JPEG 不支持透明背景。
  - 默认: `"png"`
  - 约束: 可选值: "png", "jpeg", "webp", null

- `parameters.quality` — **可选**; `string | null`. 画质
  - 默认: `"high"`
  - 约束: 可选值: "auto", "low", "medium", "high", "xhigh", "max", null

- `parameters.sync_mode` — **可选**; `boolean | null`. 设为 true 时，上游内联返回图片数据，并且不将结果保存在其请求历史中。Scenepond 仍以异步任务处理，统一返回托管的结果文件 URL。

- `parameters.enable_safety_checker` — **可选**; `boolean | null`. 安全检查默认启用。获授权的调用者可设为 false，请求放宽上游检查。

- `parameters.image_passthrough` — **可选**; `boolean | null`. 参考图和蒙版不经重新缩放或编码发送，并返回生成图像的原始字节与格式。输出尺寸可能与参考图不同。
  - 约束: 蒙版用于指导编辑区域，区域外的像素仍可能变化。image_passthrough=false 时，以白色标记待编辑区域，黑色标记希望保留的区域。image_passthrough=true 时，使用与首张参考图同尺寸的 PNG 蒙版；透明区域指导编辑，不透明区域指导保留。

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

- `parameters.count` — **可选**; `integer`. 图片数量
  - 默认: `1`
  - 约束: 最小值: 1; 最大值: 10; num_images 是原生图片数量参数，范围为 1–10。count 是兼容别名；同时传入时，两者必须相同。

- `parameters.size` — **可选**; `object | string | null`. 图片尺寸
  - 约束: 可选择 square_hd、square、portrait_4_3、portrait_16_9、landscape_4_3、landscape_16_9 或 auto，也可传入包含 width 和 height 的对象。自定义宽高须为 16 的倍数且不超过 3840 像素，总像素为 655360–8294400，长边不得超过短边的 3 倍。; 新请求优先使用 image_size，size 是兼容别名。自定义尺寸对象不要同时传入这两项；使用相匹配的预设值时可同时传入。旧尺寸映射为：1024x1024 → square_hd、512x512 → square、768x1024 → portrait_4_3、1024x768 → landscape_4_3。

### parameters.size 中的字段

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

- `parameters.size.height` — **条件必填**; `integer`. 图片高度，单位为像素。
  - 当 size 为对象时必填。
  - 约束: 最小值: 16; 最大值: 3840

- `parameters.size.width` — **条件必填**; `integer`. 图片宽度，单位为像素。
  - 当 size 为对象时必填。
  - 约束: 最小值: 16; 最大值: 3840


</details>


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

### 请求头

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

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

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

### 最小调用

#### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ]
  }
}
JSON
```

#### Python

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

payload = json.loads("{\n  \"model\": \"openai/gpt-image-2.5/flare/edit\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_urls\": [\n      \"https://example.com/reference.png\"\n    ]\n  }\n}")

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

#### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ]
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

### 可选参数示例

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

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "num_images": 1
  }
}
JSON
```

##### Python

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

payload = json.loads("{\n  \"model\": \"openai/gpt-image-2.5/flare/edit\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_urls\": [\n      \"https://example.com/reference.png\"\n    ],\n    \"num_images\": 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": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "num_images": 1
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

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

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

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "background": "auto",
    "count": 1,
    "image_size": "auto",
    "mask_url": "https://example.com/reference.png",
    "output_compression": 0,
    "output_format": "webp",
    "quality": "high",
    "sync_mode": true,
    "enable_safety_checker": true,
    "image_passthrough": false
  }
}
JSON
```

##### Python

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

payload = json.loads("{\n  \"model\": \"openai/gpt-image-2.5/flare/edit\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_urls\": [\n      \"https://example.com/reference.png\"\n    ],\n    \"background\": \"auto\",\n    \"count\": 1,\n    \"image_size\": \"auto\",\n    \"mask_url\": \"https://example.com/reference.png\",\n    \"output_compression\": 0,\n    \"output_format\": \"webp\",\n    \"quality\": \"high\",\n    \"sync_mode\": true,\n    \"enable_safety_checker\": true,\n    \"image_passthrough\": false\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": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "background": "auto",
    "count": 1,
    "image_size": "auto",
    "mask_url": "https://example.com/reference.png",
    "output_compression": 0,
    "output_format": "webp",
    "quality": "high",
    "sync_mode": true,
    "enable_safety_checker": true,
    "image_passthrough": false
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

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

##### cURL

```bash
curl --fail-with-body -X POST "https://open.scenepond.ai/v1/tasks" \
  -H "Authorization: Bearer $SCENEPOND_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "size": "auto"
  }
}
JSON
```

##### Python

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

payload = json.loads("{\n  \"model\": \"openai/gpt-image-2.5/flare/edit\",\n  \"parameters\": {\n    \"prompt\": \"A quiet lakeside at sunrise, soft light and a clear subject.\",\n    \"image_urls\": [\n      \"https://example.com/reference.png\"\n    ],\n    \"size\": \"auto\"\n  }\n}")

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

##### JavaScript

```javascript
const response = await fetch("https://open.scenepond.ai/v1/tasks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.SCENEPOND_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "model": "openai/gpt-image-2.5/flare/edit",
  "parameters": {
    "prompt": "A quiet lakeside at sunrise, soft light and a clear subject.",
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "size": "auto"
  }
})
});
if (!response.ok) throw new Error(`API error: ${response.status} ${await response.text()}`);
const result = await response.json();
console.log(result);
```

</details>

### 后续请求

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

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

`GET /v1/tasks/{task_id}`

##### cURL

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

##### Python

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

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

##### JavaScript

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

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

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

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

##### cURL

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

##### Python

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

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

##### JavaScript

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

#### 4. 到期前下载

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

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

##### cURL

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

##### Python

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

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

##### JavaScript

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

### 响应示例

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

#### 提交响应

```json
{
  "task_id": "task_EXAMPLE",
  "model": "openai/gpt-image-2.5/flare/edit",
  "status": "queued",
  "progress": 0,
  "created_at": 1700000000,
  "finished_at": 0,
  "error": null,
  "links": {
    "self": "/v1/tasks/task_EXAMPLE",
    "artifacts": "/v1/tasks/task_EXAMPLE/artifacts"
  }
}
```

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

```json
{
  "task_id": "task_EXAMPLE",
  "model": "openai/gpt-image-2.5/flare/edit",
  "status": "succeeded",
  "progress": 100,
  "created_at": 1700000000,
  "finished_at": 1700000060,
  "error": null,
  "links": {
    "self": "/v1/tasks/task_EXAMPLE",
    "artifacts": "/v1/tasks/task_EXAMPLE/artifacts"
  }
}
```

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

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

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

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

#### 生成文件列表

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

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

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

### 响应字段

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

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

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

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

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

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

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

### response.error 中的字段

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

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

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

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

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


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

### response.links 中的字段

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

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

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


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

### response.attention 中的字段

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

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

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

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


### 相关接口

#### 上传参考图片

`POST /v1/media/images`

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

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

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

##### cURL

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

##### Python

```python
import os
import requests

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

##### JavaScript

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

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

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

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

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

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

### 调用注意事项

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

### 模型参数（JSON）

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "x-scenepond-constraints": {
    "version": 1,
    "rules": [
      {
        "kind": "reference-image-input",
        "paths": [
          "/mask_url",
          "/image_urls/*"
        ],
        "scheme": "scenepond-input"
      }
    ]
  },
  "anyOf": [
    {
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "image-dimensions",
            "path": "/image_size",
            "minimumSide": 16,
            "maximumSide": 3840,
            "sideMultipleOf": 16,
            "minimumPixels": 655360,
            "maximumPixels": 8294400,
            "maximumAspectRatio": 3
          },
          {
            "kind": "image-dimensions",
            "path": "/size",
            "minimumSide": 16,
            "maximumSide": 3840,
            "sideMultipleOf": 16,
            "minimumPixels": 655360,
            "maximumPixels": 8294400,
            "maximumAspectRatio": 3
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/mask_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "type": "object",
      "properties": {
        "background": {
          "type": "string",
          "enum": [
            "auto",
            "transparent",
            "opaque"
          ],
          "default": "auto"
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 4
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "image_size": {
          "default": "auto",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "square_hd",
                "square",
                "portrait_4_3",
                "portrait_16_9",
                "landscape_4_3",
                "landscape_16_9",
                "auto"
              ]
            },
            {
              "type": "object",
              "properties": {
                "height": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840
                },
                "width": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840
                }
              },
              "required": [
                "width",
                "height"
              ],
              "additionalProperties": false
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "pattern": "^https://[^\\s/@]+(?::[0-9]+)?(?:[/?#][^\\s]*)?$"
              },
              {
                "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}$"
              }
            ]
          }
        },
        "mask_url": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "pattern": "^https://[^\\s/@]+(?::[0-9]+)?(?:[/?#][^\\s]*)?$"
            },
            {
              "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}$"
            }
          ]
        },
        "num_images": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        "output_compression": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "output_format": {
          "type": "string",
          "enum": [
            "png",
            "jpeg",
            "webp"
          ],
          "default": "png"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32000
        },
        "quality": {
          "type": "string",
          "enum": [
            "auto",
            "low",
            "medium",
            "high",
            "xhigh",
            "max"
          ],
          "default": "high"
        },
        "size": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "square_hd",
                "square",
                "portrait_4_3",
                "portrait_16_9",
                "landscape_4_3",
                "landscape_16_9",
                "auto",
                "1024x1024",
                "512x512",
                "768x1024",
                "1024x768"
              ]
            },
            {
              "type": "object",
              "properties": {
                "height": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840
                },
                "width": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840
                }
              },
              "required": [
                "width",
                "height"
              ],
              "additionalProperties": false
            }
          ]
        },
        "sync_mode": {
          "type": "boolean"
        }
      },
      "required": [
        "prompt",
        "image_urls"
      ],
      "additionalProperties": false
    },
    {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "x-scenepond-constraints": {
        "version": 1,
        "rules": [
          {
            "kind": "image-dimensions",
            "path": "/image_size",
            "minimumSide": 16,
            "maximumSide": 3840,
            "sideMultipleOf": 16,
            "minimumPixels": 655360,
            "maximumPixels": 8294400,
            "maximumAspectRatio": 3
          },
          {
            "kind": "image-dimensions",
            "path": "/size",
            "minimumSide": 16,
            "maximumSide": 3840,
            "sideMultipleOf": 16,
            "minimumPixels": 655360,
            "maximumPixels": 8294400,
            "maximumAspectRatio": 3
          },
          {
            "kind": "parameter-effect",
            "path": "/output_compression",
            "behavior": "jpeg-webp-compression"
          },
          {
            "kind": "reference-image-input",
            "paths": [
              "/mask_url",
              "/image_urls/*"
            ],
            "scheme": "scenepond-input"
          }
        ]
      },
      "type": "object",
      "properties": {
        "background": {
          "default": "auto",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "auto",
                "transparent",
                "opaque"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "count": {
          "default": 1,
          "allOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 128
            }
          ]
        },
        "enable_safety_checker": {
          "default": true,
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "image_passthrough": {
          "default": false,
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "image_size": {
          "default": "auto",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "square_hd",
                    "square",
                    "portrait_4_3",
                    "portrait_16_9",
                    "landscape_4_3",
                    "landscape_16_9",
                    "auto"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "height": {
                      "type": "integer",
                      "minimum": 16,
                      "maximum": 3840,
                      "multipleOf": 16
                    },
                    "width": {
                      "type": "integer",
                      "minimum": 16,
                      "maximum": 3840,
                      "multipleOf": 16
                    }
                  },
                  "required": [
                    "width",
                    "height"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "image_urls": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^https?://[^\\s/?#@]+(?:[/?#][^\\s]*)?$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[dD][aA][tT][aA]:[iI][mM][aA][gG][eE]/[a-zA-Z0-9.+-]+;[bB][aA][sS][eE]64,[A-Za-z0-9+/=]+$"
                  }
                ]
              },
              {
                "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}$"
              }
            ]
          }
        },
        "mask_url": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^https?://[^\\s/?#@]+(?:[/?#][^\\s]*)?$"
                    },
                    {
                      "type": "string",
                      "pattern": "^[dD][aA][tT][aA]:[iI][mM][aA][gG][eE]/[a-zA-Z0-9.+-]+;[bB][aA][sS][eE]64,[A-Za-z0-9+/=]+$"
                    }
                  ]
                },
                {
                  "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}$"
            }
          ]
        },
        "num_images": {
          "default": 1,
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 10
            },
            {
              "type": "null"
            }
          ]
        },
        "output_compression": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "output_format": {
          "default": "png",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "jpeg",
                "png",
                "webp"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32000,
          "pattern": "\\S"
        },
        "quality": {
          "default": "high",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "auto",
                "low",
                "medium",
                "high",
                "xhigh",
                "max"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "size": {
          "default": "auto",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "square_hd",
                "square",
                "portrait_4_3",
                "portrait_16_9",
                "landscape_4_3",
                "landscape_16_9",
                "auto",
                "1024x1024",
                "512x512",
                "768x1024",
                "1024x768"
              ]
            },
            {
              "type": "null"
            },
            {
              "type": "object",
              "properties": {
                "height": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840,
                  "multipleOf": 16
                },
                "width": {
                  "type": "integer",
                  "minimum": 16,
                  "maximum": 3840,
                  "multipleOf": 16
                }
              },
              "required": [
                "width",
                "height"
              ],
              "additionalProperties": false
            }
          ]
        },
        "sync_mode": {
          "default": false,
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "prompt",
        "image_urls"
      ],
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 1
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 2
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 2
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 3
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 3
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 4
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 4
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 5
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 5
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 6
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 6
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 7
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 7
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 8
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 8
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 9
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 9
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "count": {
                "allOf": [
                  {
                    "const": 10
                  },
                  {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 128
                  }
                ]
              }
            },
            "required": [
              "count"
            ]
          },
          "then": {
            "properties": {
              "num_images": {
                "const": 10
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "type": "object"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "not": {
              "required": [
                "image_size"
              ]
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "square_hd"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "square_hd"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "square"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "square"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "portrait_4_3"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "portrait_4_3"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "portrait_16_9"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "portrait_16_9"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "landscape_4_3"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "landscape_4_3"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "landscape_16_9"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "landscape_16_9"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "auto"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "auto"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "1024x1024"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "square_hd"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "512x512"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "square"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "768x1024"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "portrait_4_3"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": "1024x768"
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": "landscape_4_3"
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "size": {
                "const": null
              }
            },
            "required": [
              "size"
            ]
          },
          "then": {
            "properties": {
              "image_size": {
                "const": null
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "background": {
                "const": "transparent"
              }
            },
            "required": [
              "background"
            ]
          },
          "then": {
            "properties": {
              "output_format": {
                "not": {
                  "const": "jpeg"
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "output_compression": {
                "not": {
                  "type": "null"
                }
              }
            },
            "required": [
              "output_compression"
            ]
          },
          "then": {
            "properties": {
              "output_format": {
                "enum": [
                  "jpeg",
                  "webp"
                ]
              }
            },
            "required": [
              "output_format"
            ]
          }
        }
      ]
    }
  ]
}
```
