> ## 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 5.0 API：ウェブ検索を利用したテキストからの画像生成

> ByteDance Seedream 5.0 のテキストから画像・画像から画像へのワークフロー用の画像生成 API

## 概要

Seedream 5.0 は、テキストから画像への生成および参照ガイドに基づいた画像生成に適した ByteDance の画像生成モデルです。2K および 3K 出力プリセット、オプションのウェブ検索、選択可能な出力形式、および明示的な寸法を好む開発者向けに柔軟な `size` 入力に対応しています。

| 機能 | 値 |
| - | - |
| モデル ID | `seedream-5-0` |
| モード | `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`, `3K` |
| アスペクト比 | `1:1`, `2:3`, `3:2`, `4:3`, `3:4`, `9:16`, `16:9`, `21:9` |
| サイズ入力 | `2K`, `3K`, `2048x2048`, `2048X2048`, `2048*2048` |
| 出力フォーマット | `jpeg`, `png` |
| ウェブ検索 | `true`, `false` |
| プロンプトの最適化 | `standard` |

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

ベース URL：

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

| メソッド | エンドポイント | 用途 |
| - | - | - |
| `POST` | `/generateTask/seedream-5-0` | 生成タスクを送信する |
| `GET` | `/statusTask/seedream-5-0?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-5-0" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "mode": "text-to-image",
      "prompt": "a cozy cyberpunk cafe with neon lights, ultra detailed",
      "max_images": 1,
      "resolution": "2K",
      "aspect_ratio": "16:9",
      "output_format": "jpeg",
      "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-5-0?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

成功の応答です。

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/xxx.jpeg\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965644132,
    "costTime": 33203
  }
}
```

## リクエストボディ

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

```json theme={null}
{
  "input": {
    "mode": "text-to-image",
    "prompt": "a clean product photo of wireless earbuds on soft stone",
    "max_images": 1,
    "resolution": "2K",
    "aspect_ratio": "1:1",
    "sequential_image_generation": "disabled",
    "output_format": "jpeg",
    "prompt_optimize_mode": "standard"
  }
}
```

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

```json theme={null}
{
  "input": {
    "mode": "image-to-image",
    "prompt": "make this scene look like sunrise with warm colors",
    "image_urls": [
      "https://example.com/ref1.jpg",
      "https://example.com/ref2.jpg"
    ],
    "max_images": 2,
    "resolution": "3K",
    "aspect_ratio": "3:4",
    "sequential_image_generation": "auto",
    "output_format": "png",
    "prompt_optimize_mode": "standard"
  }
}
```

### 明示的なサイズ

```json theme={null}
{
  "input": {
    "mode": "text-to-image",
    "prompt": "a minimalist industrial poster",
    "max_images": 1,
    "size": "3072X3072",
    "output_format": "jpeg"
  }
}
```

## パラメーター

**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 5.0 の入力パラメータです。

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

**mode** `string` *required*

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

**prompt** `string` *required*

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

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

参考画像のURL。`image-to-image` では必須です。1 ～ 14 の公開画像URLを受付します。`image-to-image` の場合、`image_urls` の数に`max_images`を加えた値は15以下でなければなりません。

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

要求された画像数。1から15までの整数でなければなりません。`image-to-image` の場合、`image_urls` に含まれる参照画像の数に`max_images`を加えた値は15を超過してはなりません。

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

出力解像度のプリセット。サポートされている値: `2K`、`3K`。`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`および`3K`をサポートします。ピクセル文字列は`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`。

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

プロンプト最適化モード。Seedream 5.0 は現在 `standard` をサポートしています。

**web\_search** `boolean` (default: false)

`true`に設定するとWeb検索が有効になります。

**output\_format** `string` (default: jpeg)

出力画像の形式です。指定できる値は `jpeg`、`png` です。

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

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

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

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

| アスペクト比 | `2K`サイズ | `3K`サイズ |
| - | - | - |
| `1:1` | `2048x2048` | `3072x3072` |
| `4:3` | `2304x1728` | `3456x2592` |
| `3:4` | `1728x2304` | `2592x3456` |
| `16:9` | `2848x1600` | `4096x2304` |
| `9:16` | `1600x2848` | `2304x4096` |
| `3:2` | `2496x1664` | `3744x2496` |
| `2:3` | `1664x2496` | `2496x3744` |
| `21:9` | `3136x1344` | `4704x2016` |

## レスポンス形式

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

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

**code** `integer`

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

**message** `string`

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

**data.taskId** `string`

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

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

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

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

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

## 料金

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

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

| 単位 | APIXO の料金 |
| - | - |
| 生成されたイメージごと | `$0.035 / 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-5-0.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 5.0 を試す](https://apixo.ai/models/seedream-5-0)
* [API 価格](https://apixo.ai/pricing/api)


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