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

# Seedream 4.5 API：高解像度の画像生成

> 高解像度、マルチ画像、リファレンスガイド付きワークフロー向けの ByteDance Seedream 4.5 画像生成 API

## 概要

Seedream 4.5 は、テキストから画像への生成および参照ガイドに基づく画像生成に適した ByteDance 画像モデルです。2K および 4K 出力プリセット、タスク単位で最大 15 画像の生成、順次生成のオプション、および明示的な寸法を好むユーザー向けに柔軟な `size` 入力に対応しています。

| 機能 | 値 |
| - | - |
| モデル ID | `seedream-4-5` |
| モード | `text-to-image`, `image-to-image` |
| プロンプトの長さ | 1～5000 文字 |
| 参考画像 | 1-14 `image-to-image` の URL |
| タスク単位での画像数 | `max_images` は必須です。1-15。`image-to-image` の場合、`image_urls` の数に `max_images` を加えた値は 15 以下でなければなりません。 |
| 解像度の区分 | `2K`, `4K` |
| アスペクト比 | `1:1`, `2:3`, `3:2`, `4:3`, `3:4`, `9:16`, `16:9`, `21:9` |
| サイズ入力 | `2K`, `4K`, `2048x2048`, `2048X2048`, `2048*2048` |
| 逐次生成 | `disabled`, `auto` |
| プロンプトの最適化 | `standard` |

## エンドポイントと認証

ベース URL：

```text theme={null}
https://api.apixo.ai/api/v1
```

| メソッド | エンドポイント | 用途 |
| - | - | - |
| `POST` | `/generateTask/seedream-4-5` | 生成タスクを送信する |
| `GET` | `/statusTask/seedream-4-5?taskId={taskId}` | タスクの状態を確認して結果を取得する |

すべてのリクエストに APIXO の API キーを指定してください。

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

タスクの送信時には、次のヘッダーも指定してください。

```http theme={null}
Content-Type: application/json
```

## 非同期リクエストの実行例

最小構成のリクエストで、テキストから画像を生成するタスクを送信します。レスポンスには `taskId` が含まれます。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedream-4-5" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "mode": "text-to-image",
      "prompt": "a cozy cyberpunk cafe with warm neon lights, ultra detailed",
      "max_images": 2,
      "resolution": "2K",
      "aspect_ratio": "16:9",
      "prompt_optimize_mode": "standard"
    }
  }'
```

成功した応答:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

結果のポーリングに使うため、`taskId` を保存してください。

## ポーリングで結果を取得する

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/seedream-4-5?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

処理中のレスポンス例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

成功の応答です。

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/img1.png\",\"https://file.apixo.ai/img2.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

## リクエストボディ

### テキストから画像を生成

```json theme={null}
{
  "input": {
    "mode": "text-to-image",
    "prompt": "a fox in watercolor style",
    "max_images": 1,
    "resolution": "2K",
    "aspect_ratio": "1:1",
    "sequential_image_generation": "disabled",
    "prompt_optimize_mode": "standard"
  }
}
```

### 参照画像から画像を生成

```json theme={null}
{
  "input": {
    "mode": "image-to-image",
    "prompt": "turn this scene into a warm sunrise illustration",
    "image_urls": [
      "https://example.com/reference-1.png",
      "https://example.com/reference-2.jpg"
    ],
    "max_images": 3,
    "resolution": "4K",
    "aspect_ratio": "3:4",
    "sequential_image_generation": "auto",
    "prompt_optimize_mode": "standard"
  }
}
```

### 明示的なサイズ

```json theme={null}
{
  "input": {
    "mode": "text-to-image",
    "prompt": "an editorial still life scene",
    "max_images": 1,
    "size": "2048*2048"
  }
}
```

## パラメーター

**request\_type** `string` (default: async)

結果の取得方法です。`async` では `statusTask` をポーリングし、`callback` では Webhook で結果を受け取ります。

**callback\_url** `string`

`request_type` が `callback` の場合は必須です。タスクの最終結果を受け取る、外部からアクセス可能な HTTPS URL を指定してください。詳しくは [Webhook](https://apixo.ai/docs/ja/api-reference/webhooks.md) を参照してください。

**input** `object` *required*

Seedream 4.5 の入力パラメータです。

**HTTP ステータスコードです。**

**mode** `string` *required*

生成モードです。指定できる値は `text-to-image`、`image-to-image` です。

**prompt** `string` *required*

生成したい画像や編集内容をテキストで指定します。前後の空白を除いて、1～5000 文字で指定してください。

**max\_images** `integer` *required*

リクエストする画像の数。サポート範囲: 1 ～ 15。この項目は必須です。バックエンドではデフォルト値は適用されません。`image-to-image` の場合、`image_urls` に含まれる参照画像の数に加えて `max_images` を足した合計が 15 を超えてはなりません。

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

参考画像のURL。`image-to-image`では必須です。1～14のURLをサポートします。URLは公開されており、直接アクセス可能な画像ファイルでなければなりません。`image-to-image`の場合は、`image_urls`の数 + `max_images`が15以下でなければなりません。

**resolution** `string` (default: 2K)

出力解像度のプリセット。サポートされている値: `2K`、`4K`。`resolution + aspect_ratio` と `size` が両方指定された場合は、`resolution + aspect_ratio` が優先されます。

**aspect\_ratio** `string`

オプションの出力アスペクト比。サポートされる値: `1:1`、`2:3`、`3:2`、`4:3`、`3:4`、`9:16`、`16:9`、`21:9`。

**size** `string`

オプションの明示的なサイズまたは事前設定トークン。プリセットトークンは大小文字を区別せず、`2K` および `4K` をサポートします。ピクセル文字列では `x`、`X`、または `*` を区切り文字として受け入れます。たとえば `2048x2048`、`2048X2048`、または `2048*2048` など。カスタムピクセルサイズは16ピクセル単位で指定し、アスペクト比は `1/16` から `16` の範囲内、総ピクセル数は `3,686,400` から `16,777,216`（`2560x1440` から `4096x4096` に相当）の範囲を維持します。サポートされていないカスタム値は、最も近いサポートされる出力サイズに調整されます。

**sequential\_image\_generation** `string` (default: disabled)

連写モード。サポートされている値: `disabled`、`auto`。関連するシーケンスとして複数の画像を生成する必要がある場合は、`auto` を使用します。

**prompt\_optimize\_mode** `string` (default: standard)

プロンプト最適化モード。Seedream 4.5 では現在 `standard` がサポートされています。

**nsfw\_checker** `boolean` (default: false)

このリクエストにコンテンツの安全性フィルターを適用します。デフォルトは `false` です。指定する場合はブール値を使用してください。

### `resolution + aspect_ratio` からのサイズ プリセット

`aspect_ratio`が指定されている場合、APIXOは`resolution`と`aspect_ratio`を次の出力次元にマップします。

| アスペクト比 | `2K`サイズ | `4K`サイズ |
| - | - | - |
| `1:1` | `2048x2048` | `4096x4096` |
| `2:3` | `1664x2496` | `3328x4992` |
| `3:2` | `2496x1664` | `4992x3328` |
| `3:4` | `1728x2304` | `3520x4704` |
| `4:3` | `2304x1728` | `4704x3520` |
| `9:16` | `1600x2848` | `3040x5504` |
| `16:9` | `2848x1600` | `5504x3040` |
| `21:9` | `3136x1344` | `6240x2656` |

## レスポンス形式

### タスク送信時のレスポンス

タスクが受け付けられると、`POST /generateTask/seedream-4-5` からタスク ID が返されます。

**code** `integer`

API のステータスコードです。`200` はタスクが受け付けられたことを示します。

**message** `string`

状態を説明するメッセージです。

**data.taskId** `string`

後でポーリングまたは Webhook マッチングに使用されるタスク ID。

### ステータス応答

**data.state** `string`

タスクの状態。共通の値は `processing`、`success`、`failed` です。

**data.resultJson** `string`

成功時に存在。この JSON 文字列を解析し、`resultUrls` を読み取ります。

**data.failCode** `string`

失敗時に存在。機械可読で安定した失敗コード。

**data.failMsg** `string`

失敗時に存在。人間が判読できる失敗メッセージ。

## ポーリングと配信のガイダンス

Seedream 4.5 タスクは非同期です。

| 解像度 | 生成にかかる時間の目安 | 初回ポーリングの目安 | ポーリング間隔 |
| - | - | - | - |
| `2K` | 25s-35s | タスク作成から 20 秒後 | 3s-5s |
| `4K` | 40s-55s | タスク作成から 30 秒後 | 5s |

運用システムでは、タイトなポーリング ループよりも `callback_url` を使用してください。

## 料金

新規の非 LLM リクエストは **1 クレジット = `$0.001`** で換算します。利用量と追加項目から合計額を求め、アカウントの割引を適用してから、クレジットの端数を切り上げます。個別に固定単価を取り決めている場合は、その精度を保ったまま計算し、標準料金や割引は適用しません。この場合も最終額の端数は切り上げます。詳しくは[クレジットの換算と端数処理](https://apixo.ai/docs/ja/pricing.md#credit-conversion-and-rounding)を参照してください。

Seedream 4.5 は生成されたイメージごとに課金されます。現在の公開 APIXO 価格は、このモデルの単一定額料金です。

| 単位 | APIXO の料金 |
| - | - |
| 生成されたイメージごと | `$0.040 / image` |

請求動作:

```text theme={null}
precharge = requested max_images * unit price
final charge = successful images * unit price
```

要求されたイメージよりも成功したイメージが少ない場合、APIXOは最終料金を実際に成功した出力数に合わせて自動的に調整します。

## MCP 連携

[モデルの完全なスキーマ](https://apixo.ai/docs/models/schemas/image/seedream-4-5.json)では、`mcp.result` に結果のデコード方法、`mcp.attachments` にファイルを割り当てられるフィールドを定義しています。いずれもクライアント実装用のメタデータで、生成リクエストの入力パラメータには含めません。添付先は `image_urls` です。ユーザーが指定したファイルの順序を維持してください。モデルのパラメータは API 側で検証します。

## 関連リンク

* [画像モデル](https://apixo.ai/docs/ja/models/image)
* [生成 API の概要](https://apixo.ai/docs/ja/models.md)
* [生成タスクを送信](https://apixo.ai/docs/ja/api-reference/generate-task.md)
* [タスクステータス](https://apixo.ai/docs/ja/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/ja/api-reference/webhooks.md)
* [エラーコード](https://apixo.ai/docs/ja/api-reference/errors.md)
* [APIXO Playground で Seedream 4.5 を試す](https://apixo.ai/models/seedream-4-5)
* [API 価格](https://apixo.ai/pricing/api)


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