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

# GPT Image 1.5

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

## [GPT Image 1.5](https://ailoot.ai/models/ja/gpt-image-1-5/)

GPT Image 1.5は、詳しい指示への追従を重視し、テキストの指示から画像を作成します。三つの画面の形、複数の品質レベルと結果形式が用意されています。

- [**Ailoot · 画像** `POST /v1/images/generations` `gpt-image-1.5`](https://ailoot.ai/models/ja/gpt-image-1-5/#method-0)
- [**Ailoot Ultra · 画像** `POST /v1/images/generations` `gpt-image-1.5`](https://ailoot.ai/models/ja/gpt-image-1-5/#method-1)

モデルについて

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

#### 詳しい指示から画像を作る

GPT Image 1.5は、テキストの説明から画像を作成するOpenAIのモデルです。メーカーは、指示への追従と詳しい指示の処理を特徴として挙げています。シーンの内容、構図、物体の外観、必要なスタイルを指定できます。画像メソッドの結果は、完成した画像です。

Ailootのこのカードは、テキスト入力による生成に関するものです。OpenAIは、元画像の利用、編集、個別領域の変更も説明しています。これらの機能には、別途視覚入力への対応が必要です。ここで示されているテキストによる生成方法には含まれません。

OpenAIが別途用意する編集操作では、マスクが手掛かりになります。結果がその輪郭と厳密に一致することは保証されません。この操作には、元画像の送信への対応が必要です。現在のAilootのカードは、引き続きテキスト入力による生成に関するものです。

#### 三つの画面の形と品質設定

正方形の`1024x1024`、横長の`1536x1024`、縦長の`1024x1536`と、自動選択が用意されています。このバージョンに、ほかのモデルの任意のサイズを適用してはいけません。

品質レベルは、`low`、`medium`、`high`、`auto`です。品質の選択は、処理量や結果の細かさに影響します。品質とサイズは異なる設定です。画面の向きは構図の空間を、品質レベルは生成モードを定めます。`xhigh`と`max`は、GPT Image 1.5には公表されていません。

#### ファイル形式と背景

既定ではPNGで結果を作成し、JPEGとWebPも用意されています。JPEGとWebPでは、圧縮の程度を指定できます。結果ファイルの設定であり、生成の品質とは異なります。

メーカーは、透明と不透明の背景、自動選択を用意しています。透明な背景にはPNGまたはWebPが必要です。JPEGはアルファチャンネルを保持しません。その後の構図で独立した物体として画像を使う場合、透明な背景が便利です。具体的なパラメータへの対応は、選択したメソッドに合わせて考慮する必要があります。

#### 文字と構図は検証が必要

モデルは画像に文字を含め、複数の要素からシーンを構成できますが、文字や物体の正確な位置は保証されません。個別の生成間で、同じ登場人物の外観やデザインを繰り返し再現できるかも、確認が必要です。

複雑な画像は、単純な画像より生成に時間がかかる場合があります。OpenAIによると、個々の複雑な指示には二分までかかる場合があります。元の説明の十分さと、完成した画像の検証の両方が重要です。文字の読みやすさ、細部の位置、指定したシーンとの一致は、ファイルそのもので評価します。

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

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

OpenAI /`gpt-image-1.5`

### はじめに

GPT Image 1.5は、詳しい指示への追従を重視し、テキストの指示から画像を作成します。三つの画面の形、複数の品質レベルと結果形式が用意されています。

対応する入力

テキスト

結果

画像

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

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

入力の種類

`text`

出力の種類

`image`

出力形式

画像ファイル

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-1.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.01 */ 1K*

入力、画像

$0.008 */ 1K tokens*

出力、画像

$0.032 */ 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-1.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-1.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-1.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、リクエストヘッダー、レスポンスを保存し、その元の操作に対してサポートされている読み取りを継続してください。作成リクエストを再送しないでください。 |

### エイリアス

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

<strong>Ailoot</strong> [`gpt-image-1.5`](https://ailoot.ai/models/ja/#m=gpt-image-1.5&route=Core&caller=gpt-image-1.5&fmt=images)
**Ailoot Ultra** [`gpt-image-1.5`](https://ailoot.ai/models/ja/#m=gpt-image-1.5&route=Ultra&caller=gpt-image-1.5&fmt=images)

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

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

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

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

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

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

OpenAI /`gpt-image-1.5`

### はじめに

GPT Image 1.5は、詳しい指示への追従を重視し、テキストの指示から画像を作成します。三つの画面の形、複数の品質レベルと結果形式が用意されています。

対応する入力

テキスト

結果

画像

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

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

入力の種類

`text`

出力の種類

`image`

| フィールド | 種類 | 要件 | 値と制限 | デフォルト |
| --- | --- | --- | --- | --- |
| フィールド`model` | 種類`string` | 要件必須 | 値と制限 gpt-image-1.5 | デフォルト— |
| フィールド`prompt` | 種類`string` | 要件必須 | 値と制限 最大の長さ: 32,000 | デフォルト— |
| フィールド`size` | 種類`string` | 要件任意 | 値と制限 1024x1024, 1536x1024, 1024x1536, auto | デフォルトauto |
| フィールド`background` | 種類`string` | 要件任意 | 値と制限 transparent, opaque, auto | デフォルトauto |
| フィールド`moderation` | 種類`string` | 要件任意 | 値と制限 low, auto 条件: 標準のコンテンツモデレーションにはautoを使用してください。 | デフォルト— |
| フィールド`n` | 種類`integer` | 要件任意 | 値と制限 最小値: 1 最大値: 10 | デフォルト1 |
| フィールド`quality` | 種類`string` | 要件任意 | 値と制限 auto, high, medium, low | デフォルトauto |
| フィールド`output_compression` | 種類`integer` | 要件任意 | 値と制限 最小値: 0 最大値: 100 条件: JPEGとWebPの出力に適用されます。文書に記載された整数値を送信してください。 | デフォルト100 |
| フィールド`output_format` | 種類`string` | 要件任意 | 値と制限 webp, png, jpeg | デフォルトpng |
| フィールド`stream` | 種類`boolean` | 要件任意 | 値と制限 false 条件: このルートは、完了したJSONレスポンスを一件返します。 | デフォルトfalse |

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

| パラメータ | 仕様 |
| --- | --- |
| パラメータ`content_type` | 仕様application/json |
| パラメータ`required` | 仕様prompt, model |
| パラメータ`material_types` | 仕様text |
| パラメータ`optional` | 仕様size, background, moderation, n, quality, output\_compression, output\_format, stream |
| パラメータ`conditions` | 仕様透過背景にはPNGまたはWebPが必要です。, 出力圧縮はJPEGまたはWebPに適用されます。, 選択したメソッドはテキストから生成します。メーカーの説明に記載されている編集およびストリーミングの制御は、別の機能です。 |

ライフサイクル: `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}`

### 料金

##### 最終料金の計算方法

表示料金は生成前の費用の見積もりです。最終請求額は、元の生成処理に記録された費用から計算されます。実測された出力時間や予測数量が、そのまま最終的な課金数量になるわけではありません。

料金情報はリクエストの機能を追加しません。対応するパラメーターは選択したメソッドに記載されています。

高速モード

未指定 高速モードが選択されている場合

Flex モード

未指定 flex モードが選択されている場合

最大推論量

未指定 推論量が最大で、調整に既定値（default）を使用する場合

#### 比較用の推定料金

#### 設定別の価格

各料金を表示された条件と照合してください。選択肢となる設定の各組には、いずれか1つの料金を適用します。

| 設定 | 料金表 | 予測数量 | 料金 |
| --- | --- | --- | --- |
| 設定基本トークン料金 | 料金表基本料金 | 予測数量— | 料金 入力 · 入力トークン · 比較専用の見積もり **—** / 1K トークン 出力 · 出力トークン · 比較専用の見積もり **—** / 1K トークン 入力 · キャッシュ読み取り · 比較専用の見積もり **—** / 1K トークン 入力 · キャッシュ書き込み · 比較専用の見積もり **—** / 1K トークン 入力 · キャッシュ書き込み、1時間 · 比較専用の見積もり **—** / 1K トークン |
| 設定生成費用の見積もり | 料金表— | 予測数量生成1回分の概算 | 料金 出力 · 推定生成コスト · 比較専用の見積もり **$0.32768** 生成前の見積もり この見積もりは追加料金ではなく、完了した生成処理に対する固定料金でもありません。 |

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

### リクエスト例

#### Ailoot Ultra · 画像

curl

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p={'prompt': 'A cute baby sea otter', 'model': 'gpt-image-1.5', 'size': '1024x1024', 'n': 1, 'background': 'auto', 'moderation': 'auto', 'output_format': 'png'}

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
```

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

#### Ailoot Ultra · 画像

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

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

その他のコンテンツ取得

自分が所有する既存のアセットを読み取る

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/media/assets \
  -H "Authorization: Bearer $AILOOT_API_KEY" -o owned-assets.json
# Preserve every returned asset and follow its exact signed content URL. Do not construct a signed token.
```

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

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

レスポンスとヘッダーの全体、実際の出力すべて、最初に返された識別子、使用量フィールドすべてを保存してください。作成リクエストを再送せずに、元の操作を復旧してください。

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

照合のため、返された X-Client-Request-ID を保存してください。実際に返された task\_id/asset\_id の値、または自分が所有するメディアライブラリだけを使って読み取ってください。操作 ID からタスクの URL を組み立てたり、作成リクエストを再送したりしないでください。

レスポンスのフィールド

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

### エイリアス

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

<strong>Ailoot</strong> [`gpt-image-1.5`](https://ailoot.ai/models/ja/#m=gpt-image-1.5&route=Core&caller=gpt-image-1.5&fmt=images)
**Ailoot Ultra** [`gpt-image-1.5`](https://ailoot.ai/models/ja/#m=gpt-image-1.5&route=Ultra&caller=gpt-image-1.5&fmt=images)

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

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

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

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

FAQ · GPT Image 1.5

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

`POST /v1/images/generations` · `gpt-image-1.5`: `text` → `image` `POST /v1/images/generations` · `gpt-image-1.5`: `text` → `image`

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

`POST /v1/images/generations` · `gpt-image-1.5`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image-1.5`: `model`, `prompt`, `size`, `background`, `moderation`, `n`, `quality`, `output_compression`, `output_format`, `stream`

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

`POST /v1/images/generations` · `gpt-image-1.5`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image-1.5`: `prompt.maximum_length`: `32000`; `n.minimum`: `1`; `n.maximum`: `10`; `output_compression.minimum`: `0`; `output_compression.maximum`: `100`

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アクセスに活かしています。
