> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodylink.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Seedream 5.5

> 字节 Seedream 5.5 图像生成，支持文生图、多图参考与 1K / 1.5K / 2K 输出。

* 异步接口：提交后立即返回 `task_id`，再调用 [查询图片任务](https://docs.nodylink.com/api-reference/images/task-status.md) 获取结果。
* 不传 `image_urls` 为文生图；传入 `image_urls` 为图生图 / 参考图模式。
* 生成的图片不带水印。
* 按张计费，单价由分辨率档位决定，见 [模型价格](https://nodylink.com/pricing)。任务失败自动退款。

```bash cURL theme={null}
curl https://api.nodylink.com/v1/images/generations \
  -H "Authorization: Bearer sk-你的密钥" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-5",
    "prompt": "一只橘猫坐在窗台上看夕阳，水彩画风格",
    "size": "16:9",
    "resolution": "2K"
  }'
```

```python Python theme={null}
import time
import requests

API_KEY = "sk-你的密钥"
BASE = "https://api.nodylink.com"
headers = {"Authorization": f"Bearer {API_KEY}"}

submit = requests.post(
    f"{BASE}/v1/images/generations",
    headers=headers,
    json={
        "model": "seedream-5-5",
        "prompt": "一只橘猫坐在窗台上看夕阳，水彩画风格",
        "size": "16:9",
        "resolution": "2K",
    },
).json()
task_id = submit["task_id"]

while True:
    task = requests.get(f"{BASE}/v1/images/tasks/{task_id}", headers=headers).json()
    if task["status"] == "SUCCESS":
        print(task["data"][0]["url"])
        break
    if task["status"] == "FAILED":
        raise RuntimeError(task["fail_reason"])
    time.sleep(5)
```

```javascript Node.js theme={null}
const API_KEY = "sk-你的密钥";
const BASE = "https://api.nodylink.com";
const headers = {
  Authorization: `Bearer ${API_KEY}`,
  "Content-Type": "application/json",
};

const submit = await fetch(`${BASE}/v1/images/generations`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "seedream-5-5",
    prompt: "一只橘猫坐在窗台上看夕阳，水彩画风格",
    size: "16:9",
    resolution: "2K",
  }),
}).then((r) => r.json());

while (true) {
  const task = await fetch(`${BASE}/v1/images/tasks/${submit.task_id}`, { headers })
    .then((r) => r.json());
  if (task.status === "SUCCESS") {
    console.log(task.data[0].url);
    break;
  }
  if (task.status === "FAILED") throw new Error(task.fail_reason);
  await new Promise((r) => setTimeout(r, 5000));
}
```

```json 200 theme={null}
{
  "code": 200,
  "status": "submitted",
  "task_id": "task_01M7FK2K95YHKT9Z5ZA98PXM84",
  "id": "task_01M7FK2K95YHKT9Z5ZA98PXM84"
}
```

```json 400 theme={null}
{
  "code": "invalid_request",
  "message": "prompt is required",
  "data": null
}
```

```json 403 theme={null}
{
  "error": {
    "message": "用户额度不足, 剩余额度: ¥0.012 (request id: 2026101412000012345678)",
    "type": "new_api_error",
    "param": "",
    "code": "insufficient_user_quota"
  }
}
```

## 鉴权

**Authorization** `string` *required*

`Bearer <API Key>`。在 [API 密钥](https://nodylink.com/dashboard/keys) 页面创建。

## 请求参数

**model** `string` *required* (default: seedream-5-5)

模型 ID，填 `seedream-5-5`。

**prompt** `string` *required*

图像描述，支持中英文。建议写清主体、场景、构图、风格和光线。

**size** `string`

输出比例，或精确像素尺寸。

支持 8 种比例：`1:1`、`4:3`、`3:4`、`16:9`、`9:16`、`3:2`、`2:3`、`21:9`。传比例时必须同时传 `resolution`。

也可以直接传像素尺寸，例如 `2048x2048`，此时忽略 `resolution`。

**resolution** `string`

分辨率档位：`1K`、`1.5K` 或 `2K`，大小写均可。与比例形式的 `size` 一起决定实际像素，见下方对照表。

**image\_urls** `string[]`

参考图列表，传入后为图生图 / 参考图模式。

**详细说明**

* 每项可以是公网可访问的图片 URL，也可以是 `data:image/png;base64,...` 格式的 Data URL，二者可以混填。
* 图片 URL 需要无需登录即可直接下载，签名链接的有效期要覆盖任务执行时间。

## 尺寸对照表

`size` 与 `resolution` 组合后的实际输出像素：

| `size` | `1K` | `1.5K` | `2K` |
| - | - | - | - |
| `1:1` | 1024×1024 | 1536×1536 | 2048×2048 |
| `4:3` | 1152×864 | 1792×1344 | 2368×1776 |
| `3:4` | 864×1152 | 1344×1792 | 1776×2368 |
| `16:9` | 1424×800 | 2048×1152 | 2816×1584 |
| `9:16` | 800×1424 | 1152×2048 | 1584×2816 |
| `3:2` | 1248×832 | 1872×1248 | 2496×1664 |
| `2:3` | 832×1248 | 1248×1872 | 1664×2496 |
| `21:9` | 1568×672 | 2352×1008 | 3136×1344 |

> [!NOTE]
>
> 传比例但不传 `resolution`，或传了表中没有的比例（如 `5:4`），请求会返回错误。

## 提交响应

**code** `integer`

固定为 `200`。

**status** `string`

固定为 `submitted`。

**task\_id** `string`

任务 ID，用于 [查询图片任务](https://docs.nodylink.com/api-reference/images/task-status.md)。

**id** `string`

与 `task_id` 相同。

## 使用示例

**文生图（1K 方图）**

```json theme={null}
{
  "model": "seedream-5-5",
  "prompt": "一只橘猫坐在窗台上看夕阳，水彩画风格",
  "size": "1:1",
  "resolution": "1K"
}
```

**2K 竖版海报**

```json theme={null}
{
  "model": "seedream-5-5",
  "prompt": "星空下的古老城堡，电影感光影",
  "size": "9:16",
  "resolution": "2K"
}
```

**直接指定像素尺寸**

```json theme={null}
{
  "model": "seedream-5-5",
  "prompt": "极简风格的山水画",
  "size": "2048x2048"
}
```

**图生图（参考图 URL）**

```json theme={null}
{
  "model": "seedream-5-5",
  "prompt": "把这张照片变成水彩画风格",
  "size": "1:1",
  "resolution": "2K",
  "image_urls": ["https://example.com/photo.jpg"]
}
```

**多图融合（URL 与 Base64 混填）**

```json theme={null}
{
  "model": "seedream-5-5",
  "prompt": "把这两张照片融合成一张海报",
  "size": "4:3",
  "resolution": "2K",
  "image_urls": [
    "https://example.com/photo-a.jpg",
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
  ]
}
```

## 查询结果

```bash theme={null}
curl https://api.nodylink.com/v1/images/tasks/task_01M7FK2K95YHKT9Z5ZA98PXM84 \
  -H "Authorization: Bearer sk-你的密钥"
```

```json theme={null}
{
  "status": "SUCCESS",
  "task_id": "task_01M7FK2K95YHKT9Z5ZA98PXM84",
  "progress": "100%",
  "created": 1794745925,
  "data": [
    {"url": "https://example.com/generated/3f6c1b2a.png"}
  ]
}
```

取图方式：`data[0].url`。状态说明见 [查询图片任务](https://docs.nodylink.com/api-reference/images/task-status.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.