Source: https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/
Canonical: https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/
Language: ja

# GPT Image 2.5 Sunburst

[Markdown](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/index.md) · [JSON](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/facts.json)

## [GPT Image 2.5 Sunburst](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/)

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/#method-0)
- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image`](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/#method-1)
- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5`](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/#method-2)
- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5-latest`](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/#method-3)
- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-latest`](https://ailoot.ai/models/ja/gpt-image-2-5-sunburst/#method-4)

モデルについて

この説明はモデルの機能を紹介するものです。Ailootで利用できる入力、出力、オプションは、選択したメソッドごとに以下に記載されています。

#### 生成と画像の処理

GPT Image 2.5 Sunburstは、画像を作成するOpenAIのモデルです。メーカーは、元の素材の編集精度を特に重視しています。テキストの指示と、対応する操作での視覚的な元画像を利用できます。

現在のAilootのカードには、テキストから画像を作成するモードが掲載されています。これから作る結果のシーン、構図、スタイル、細部を指定できます。OpenAIが説明する参照資料の利用、編集、マスクによる領域の変更には、別途入力画像への対応が必要です。テキスト生成があることは、その対応の確認にはなりません。

#### 品質と画面の形

`low`、`medium`、`high`、`xhigh`、`max`、`auto`を利用できます。品質の選択は、画像の生成モードを制御します。構図のサイズや、得られたファイルの圧縮の程度とは異なります。

サイズは、正方形、横長、縦長、自動選択、手動指定にできます。独自サイズでは、各辺が16ピクセルの倍数で、3840ピクセル以下である必要があります。面積は655 360〜8 294 400ピクセル、長辺と短辺の比率は3:1以下である必要があります。すべての条件を同時に適用します。

メーカーは、`2560x1440`を超える解像度を実験的なものとしています。大きな画面は、構図に適した空間を選ぶのに役立ちますが、文字や物体の位置の検証が不要になるわけではありません。

#### 結果形式と背景

既定ではPNGを使い、JPEGとWebPも用意されています。JPEGとWebPでは、圧縮を調整できます。透明な背景にはPNGまたはWebPが必要です。JPEGはアルファチャンネルを保持しないためです。透明な背景に加え、不透明な背景と自動選択が用意されています。

サイズ、品質、形式、背景は、結果の異なる側面を担います。画像のスタイルは、シーンの内容とともにテキストの説明で指定します。具体的な設定への対応は、メーカーの一般的な機能とは別に考慮する必要があります。

#### 修正の精度と画像の確認

OpenAIによると、複雑な指示の処理には二分までかかる場合があります。これはメーカー側の生成についての説明であり、具体的なアプリケーションで結果を取得するまでの全時間の保証ではありません。

別途対応する編集操作では、マスクが選択した領域の変更を導きます。結果と境界の厳密な一致は保証しないため、正確な局所修正を約束するのは強すぎる表現になります。このモードを使うには、対応する元画像の送信方法が必要です。

生成時にも、文字や細部の配置を誤ったり、個々の画像の間で登場人物の外観が変わったりする場合があります。文字、構図、再現性の確認は、完成ファイルの検証に属します。詳しい指示でも、これらの特性が保証されるわけではありません。

**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5-sunburst`

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images)

OpenAI /`gpt-image-2.5-sunburst`

モデルID

- `gpt-image-2.5-sunburst`
- `gpt-image`
- `gpt-image-2.5`
- `gpt-image-2.5-latest`
- `gpt-image-latest`

### はじめに

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

対応する入力

テキスト

結果

画像

### Ailootで利用可能 · 入力とメソッド

**Ailoot · 画像** `POST /v1/images/generations`

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-2.5-sunburst | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最小の長さ: 1 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 | デフォルト1 |
| フィールド`response_format` | 種類`string` | 要件任意 | 値と制限 url, b64\_json | デフォルト— |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 | デフォルトfalse |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`input_fidelity` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`style` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`partial_images` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |

入力素材の組み合わせ

**テキストから画像へ** · 必須: prompt

メソッドのパラメータとライフサイクル

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`material_types` | 仕様text |
| パラメータ`required` | 仕様model, prompt |
| パラメータ`optional_controls` | 仕様null |
| パラメータ`content_type` | 仕様application/json |

ライフサイクル: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 実際に返された task\_id またはメディアライブラリのレコード

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。

### 料金

#### Ailootのメソッド料金

テキスト入力

$0.005 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.03 */ 1K tokens*

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。[金額の確保と精算の仕組み →](https://ailoot.ai/docs/ja/billing/reserve/)

### リクエスト例

#### Ailoot · 画像

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "gpt-image-2.5-sunburst", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'gpt-image-2.5-sunburst', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "gpt-image-2.5-sunburst", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 結果を受け取って保存

#### Ailoot · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

すべてのデータ項目を保存してください。各 b64\_json をデコードするか、返された署名付き URL すべてから取得してください。実際の MIME タイプ／バイト列に応じてファイル名の拡張子を選んでください。

##### 元のレスポンスを確認する場合

画像の生成または編集の結果に確認が必要な場合は、元の operation\_id/X-Client-Request-ID と、返された結果情報を保存してください。実際の task\_id または asset\_id の値を使い、メディアライブラリから自分が所有する既存の結果を取得してください。生成／編集リクエストを再送したり、operation\_id からポーリング URL を組み立てたりしないでください。

レスポンスのフィールド

| フィールド | 種類 |
| --- | --- |
| フィールド`created` | 種類integer |
| フィールド`data[].url` | 種類string |
| フィールド`data[].b64_json` | 種類base64 string |
| フィールド`usage` | 種類object |

エラーと次の手順

| レスポンス | 条件 | 次の手順 |
| --- | --- | --- |
| レスポンス400 · `invalid_request_error` | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
| レスポンス`server_error` | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作／タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

#### モデルのエイリアス

**Ailoot** [`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

#### メソッドパスのエイリアス

上記に表示されたメソッドパスを使用してください。

#### 関連する呼び出し用ID

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

**Ailoot · 画像** `POST /v1/images/generations` `gpt-image`

[`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images)

OpenAI /`gpt-image`

モデルID

- `gpt-image-2.5-sunburst`
- `gpt-image`
- `gpt-image-2.5`
- `gpt-image-2.5-latest`
- `gpt-image-latest`

### はじめに

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

対応する入力

テキスト

結果

画像

### Ailootで利用可能 · 入力とメソッド

**Ailoot · 画像** `POST /v1/images/generations`

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最小の長さ: 1 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 | デフォルト1 |
| フィールド`response_format` | 種類`string` | 要件任意 | 値と制限 url, b64\_json | デフォルト— |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 | デフォルトfalse |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`input_fidelity` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`style` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`partial_images` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |

入力素材の組み合わせ

**テキストから画像へ** · 必須: prompt

メソッドのパラメータとライフサイクル

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`material_types` | 仕様text |
| パラメータ`required` | 仕様model, prompt |
| パラメータ`optional_controls` | 仕様null |
| パラメータ`content_type` | 仕様application/json |

ライフサイクル: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 実際に返された task\_id またはメディアライブラリのレコード

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。

### 料金

#### Ailootのメソッド料金

テキスト入力

$0.005 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.03 */ 1K tokens*

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。[金額の確保と精算の仕組み →](https://ailoot.ai/docs/ja/billing/reserve/)

### リクエスト例

#### Ailoot · 画像

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "gpt-image", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'gpt-image', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "gpt-image", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 結果を受け取って保存

#### Ailoot · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

すべてのデータ項目を保存してください。各 b64\_json をデコードするか、返された署名付き URL すべてから取得してください。実際の MIME タイプ／バイト列に応じてファイル名の拡張子を選んでください。

##### 元のレスポンスを確認する場合

画像の生成または編集の結果に確認が必要な場合は、元の operation\_id/X-Client-Request-ID と、返された結果情報を保存してください。実際の task\_id または asset\_id の値を使い、メディアライブラリから自分が所有する既存の結果を取得してください。生成／編集リクエストを再送したり、operation\_id からポーリング URL を組み立てたりしないでください。

レスポンスのフィールド

| フィールド | 種類 |
| --- | --- |
| フィールド`created` | 種類integer |
| フィールド`data[].url` | 種類string |
| フィールド`data[].b64_json` | 種類base64 string |
| フィールド`usage` | 種類object |

エラーと次の手順

| レスポンス | 条件 | 次の手順 |
| --- | --- | --- |
| レスポンス400 · `invalid_request_error` | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
| レスポンス`server_error` | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作／タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

#### モデルのエイリアス

**Ailoot** [`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

#### メソッドパスのエイリアス

上記に表示されたメソッドパスを使用してください。

#### 関連する呼び出し用ID

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5`

[`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images)

OpenAI /`gpt-image-2.5`

モデルID

- `gpt-image-2.5-sunburst`
- `gpt-image`
- `gpt-image-2.5`
- `gpt-image-2.5-latest`
- `gpt-image-latest`

### はじめに

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

対応する入力

テキスト

結果

画像

### Ailootで利用可能 · 入力とメソッド

**Ailoot · 画像** `POST /v1/images/generations`

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-2.5 | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最小の長さ: 1 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 | デフォルト1 |
| フィールド`response_format` | 種類`string` | 要件任意 | 値と制限 url, b64\_json | デフォルト— |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 | デフォルトfalse |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`input_fidelity` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`style` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`partial_images` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |

入力素材の組み合わせ

**テキストから画像へ** · 必須: prompt

メソッドのパラメータとライフサイクル

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`material_types` | 仕様text |
| パラメータ`required` | 仕様model, prompt |
| パラメータ`optional_controls` | 仕様null |
| パラメータ`content_type` | 仕様application/json |

ライフサイクル: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 実際に返された task\_id またはメディアライブラリのレコード

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。

### 料金

#### Ailootのメソッド料金

テキスト入力

$0.005 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.03 */ 1K tokens*

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。[金額の確保と精算の仕組み →](https://ailoot.ai/docs/ja/billing/reserve/)

### リクエスト例

#### Ailoot · 画像

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "gpt-image-2.5", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'gpt-image-2.5', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "gpt-image-2.5", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 結果を受け取って保存

#### Ailoot · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

すべてのデータ項目を保存してください。各 b64\_json をデコードするか、返された署名付き URL すべてから取得してください。実際の MIME タイプ／バイト列に応じてファイル名の拡張子を選んでください。

##### 元のレスポンスを確認する場合

画像の生成または編集の結果に確認が必要な場合は、元の operation\_id/X-Client-Request-ID と、返された結果情報を保存してください。実際の task\_id または asset\_id の値を使い、メディアライブラリから自分が所有する既存の結果を取得してください。生成／編集リクエストを再送したり、operation\_id からポーリング URL を組み立てたりしないでください。

レスポンスのフィールド

| フィールド | 種類 |
| --- | --- |
| フィールド`created` | 種類integer |
| フィールド`data[].url` | 種類string |
| フィールド`data[].b64_json` | 種類base64 string |
| フィールド`usage` | 種類object |

エラーと次の手順

| レスポンス | 条件 | 次の手順 |
| --- | --- | --- |
| レスポンス400 · `invalid_request_error` | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
| レスポンス`server_error` | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作／タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

#### モデルのエイリアス

**Ailoot** [`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

#### メソッドパスのエイリアス

上記に表示されたメソッドパスを使用してください。

#### 関連する呼び出し用ID

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-2.5-latest`

[`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images)

OpenAI /`gpt-image-2.5-latest`

モデルID

- `gpt-image-2.5-sunburst`
- `gpt-image`
- `gpt-image-2.5`
- `gpt-image-2.5-latest`
- `gpt-image-latest`

### はじめに

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

対応する入力

テキスト

結果

画像

### Ailootで利用可能 · 入力とメソッド

**Ailoot · 画像** `POST /v1/images/generations`

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-2.5-latest | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最小の長さ: 1 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 | デフォルト1 |
| フィールド`response_format` | 種類`string` | 要件任意 | 値と制限 url, b64\_json | デフォルト— |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 | デフォルトfalse |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`input_fidelity` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`style` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`partial_images` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |

入力素材の組み合わせ

**テキストから画像へ** · 必須: prompt

メソッドのパラメータとライフサイクル

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`material_types` | 仕様text |
| パラメータ`required` | 仕様model, prompt |
| パラメータ`optional_controls` | 仕様null |
| パラメータ`content_type` | 仕様application/json |

ライフサイクル: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 実際に返された task\_id またはメディアライブラリのレコード

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。

### 料金

#### Ailootのメソッド料金

テキスト入力

$0.005 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.03 */ 1K tokens*

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。[金額の確保と精算の仕組み →](https://ailoot.ai/docs/ja/billing/reserve/)

### リクエスト例

#### Ailoot · 画像

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "gpt-image-2.5-latest", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'gpt-image-2.5-latest', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "gpt-image-2.5-latest", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 結果を受け取って保存

#### Ailoot · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

すべてのデータ項目を保存してください。各 b64\_json をデコードするか、返された署名付き URL すべてから取得してください。実際の MIME タイプ／バイト列に応じてファイル名の拡張子を選んでください。

##### 元のレスポンスを確認する場合

画像の生成または編集の結果に確認が必要な場合は、元の operation\_id/X-Client-Request-ID と、返された結果情報を保存してください。実際の task\_id または asset\_id の値を使い、メディアライブラリから自分が所有する既存の結果を取得してください。生成／編集リクエストを再送したり、operation\_id からポーリング URL を組み立てたりしないでください。

レスポンスのフィールド

| フィールド | 種類 |
| --- | --- |
| フィールド`created` | 種類integer |
| フィールド`data[].url` | 種類string |
| フィールド`data[].b64_json` | 種類base64 string |
| フィールド`usage` | 種類object |

エラーと次の手順

| レスポンス | 条件 | 次の手順 |
| --- | --- | --- |
| レスポンス400 · `invalid_request_error` | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
| レスポンス`server_error` | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作／タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

#### モデルのエイリアス

**Ailoot** [`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

#### メソッドパスのエイリアス

上記に表示されたメソッドパスを使用してください。

#### 関連する呼び出し用ID

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-latest`

[`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

OpenAI /`gpt-image-latest`

モデルID

- `gpt-image-2.5-sunburst`
- `gpt-image`
- `gpt-image-2.5`
- `gpt-image-2.5-latest`
- `gpt-image-latest`

### はじめに

GPT Image 2.5 Sunburstは、テキストの指示から画像を作成します。独自サイズ、拡張された品質レベル、透明な背景に対応しています。メーカーは、編集の精度も特徴として挙げています。

対応する入力

テキスト

結果

画像

### Ailootで利用可能 · 入力とメソッド

**Ailoot · 画像** `POST /v1/images/generations`

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-latest | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最小の長さ: 1 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 | デフォルト1 |
| フィールド`response_format` | 種類`string` | 要件任意 | 値と制限 url, b64\_json | デフォルト— |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 | デフォルトfalse |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`input_fidelity` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`style` | 種類`string` | 要件任意 | 値と制限 モデルによる | デフォルト— |
| フィールド`partial_images` | 種類`integer` | 要件任意 | 値と制限 モデルによる | デフォルト— |

入力素材の組み合わせ

**テキストから画像へ** · 必須: prompt

メソッドのパラメータとライフサイクル

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`material_types` | 仕様text |
| パラメータ`required` | 仕様model, prompt |
| パラメータ`optional_controls` | 仕様null |
| パラメータ`content_type` | 仕様application/json |

ライフサイクル: `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 実際に返された task\_id またはメディアライブラリのレコード

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

メソッドの形式とIDは正確に記載しています。供給元の対応能力とリクエストの受け入れは別です。

### 料金

#### Ailootのメソッド料金

テキスト入力

$0.005 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.03 */ 1K tokens*

Ailootはリクエスト前に見積額を確保します。結果の取得後、実測使用量に基づいて最終料金を精算します。ストリーミング時の精算には最終の使用量記録を使用します。[金額の確保と精算の仕組み →](https://ailoot.ai/docs/ja/billing/reserve/)

### リクエスト例

#### Ailoot · 画像

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "gpt-image-latest", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'gpt-image-latest', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "gpt-image-latest", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 結果を受け取って保存

#### Ailoot · 画像

返された画像をすべてダウンロードするか、Base64の内容を保存

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 完了した結果をすべて保存

完了した画像をすべて保存してください。返された各URLから取得するか、Base64の内容をデコードしてください。

すべてのデータ項目を保存してください。各 b64\_json をデコードするか、返された署名付き URL すべてから取得してください。実際の MIME タイプ／バイト列に応じてファイル名の拡張子を選んでください。

##### 元のレスポンスを確認する場合

画像の生成または編集の結果に確認が必要な場合は、元の operation\_id/X-Client-Request-ID と、返された結果情報を保存してください。実際の task\_id または asset\_id の値を使い、メディアライブラリから自分が所有する既存の結果を取得してください。生成／編集リクエストを再送したり、operation\_id からポーリング URL を組み立てたりしないでください。

レスポンスのフィールド

| フィールド | 種類 |
| --- | --- |
| フィールド`created` | 種類integer |
| フィールド`data[].url` | 種類string |
| フィールド`data[].b64_json` | 種類base64 string |
| フィールド`usage` | 種類object |

エラーと次の手順

| レスポンス | 条件 | 次の手順 |
| --- | --- | --- |
| レスポンス400 · `invalid_request_error` | 条件必須フィールド、素材の表現形式、またはパラメーター値が不正です | 次の手順新しい生成リクエストを送る前に、指定されたフィールドを修正してください。 |
| レスポンス`server_error` | 条件返されたレスポンスは、操作または結果の確認が必要であることを示しています | 次の手順最初に返された操作／タスク ID、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

#### モデルのエイリアス

**Ailoot** [`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

#### メソッドパスのエイリアス

上記に表示されたメソッドパスを使用してください。

#### 関連する呼び出し用ID

[`gpt-image-2.5-sunburst`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-sunburst&fmt=images), [`gpt-image`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image&fmt=images), [`gpt-image-2.5`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5&fmt=images), [`gpt-image-2.5-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-2.5-latest&fmt=images), [`gpt-image-latest`](https://ailoot.ai/models/ja/#m=gpt-image-2.5-sunburst&route=Core&caller=gpt-image-latest&fmt=images)

FAQ · GPT Image 2.5 Sunburst

利用できる入力と結果は何ですか？

`POST /v1/images/generations` · `gpt-image-2.5-sunburst`: `text` → `image` `POST /v1/images/generations` · `gpt-image`: `text` → `image` `POST /v1/images/generations` · `gpt-image-2.5`: `text` → `image` `POST /v1/images/generations` · `gpt-image-2.5-latest`: `text` → `image` `POST /v1/images/generations` · `gpt-image-latest`: `text` → `image`

リクエストはどの項目を使用しますか？

`POST /v1/images/generations` · `gpt-image-2.5-sunburst`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image-2.5`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image-2.5-latest`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image-latest`: `model`, `prompt`, `n`, `response_format`, `stream`

どの制限が適用されますか？

`POST /v1/images/generations` · `gpt-image-2.5-sunburst`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image-2.5`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image-2.5-latest`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image-latest`: `n.minimum`: `1`

AilootをClaude Code、OpenCode、Hermes、自分のアプリに接続しましょう。

## 企業とそのプロジェクト群

企業とそのプロジェクト群：数百万の顧客、毎月数十億規模の売上。

## トークンを割引価格で購入。

継続利用にサブスクリプション割引。プロモコードでトークン購入が最大50%割引。

サブスクリプション

定期的なリクエストに合う割引プランを選びましょう。

最大50%のプロモコード

購入時にコードを入力すると、実施中のキャンペーンに沿って価格を再計算します。

支出を履歴で確認

各リクエストのモデル、トークン、金額が保存されます。

[サブスクリプションを選ぶ](https://ailoot.ai/docs/ja/billing/subscriptions/) · [モデルの価格を見る](https://ailoot.ai/models/ja/)

## 販売する製品に、 APIを組み込みましょう。

SaaS、アプリ、ボットをAilootの公式サービス提供条件とライセンス契約に基づいて接続できます。再販にはリセラーライセンスを申請できます。

商用アプリ

サービスの有料機能に、文章、画像、動画、音声の生成を組み込めます。

リセラーライセンス

プロジェクトの説明とアクセスの仕組みをお送りください。利用・再販条件の書面を申請できます。

サイトで契約文書を確認

接続前にサービス提供条件、ライセンス契約、データ処理ポリシーを読めます。

[リセラーライセンスを申請](mailto:support@ailoot.ai) · [サービス提供条件とライセンス契約](https://ailoot.ai/legal/offer?lang=ja)

## Ailoot · 企業とそのプロジェクト群





Ailootは、蓄積した運営経験、幅広い顧客基盤、安定したサービス、継続的なKPI管理を基盤としています。





企業とそのプロジェクト群：数百万の顧客、毎月数十億規模の売上。





Ailootはこの運営経験を、お客様の製品、エージェント、アプリケーション、自動化でAI機能を利用するためのAPIアクセスに活かしています。
