Source: https://ailoot.ai/models/th/gpt-image-2-5-flare/
Canonical: https://ailoot.ai/models/th/gpt-image-2-5-flare/
Language: th

# OpenAI: GPT Image 2.5 Flare

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

## [OpenAI: GPT Image 2.5 Flare](https://ailoot.ai/models/th/gpt-image-2-5-flare/)

GPT Image 2.5 Flare สร้างและแก้ไขภาพจากข้อความและภาพอ้างอิง โดยเน้นงานภาพประจำวันรวดเร็ว รองรับขนาดกำหนดเอง พื้นหลังโปร่งใส มาสก์ และระดับคุณภาพถึง max สำหรับร่าง ภาพประกอบ และชิ้นงานแคมเปญ

- [**Ailoot · รูปภาพ** `POST /v1/images/generations` `gpt-image-2.5-flare`](https://ailoot.ai/models/th/gpt-image-2-5-flare/#method-0)
- [**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations` `gpt-image-2.5-flare`](https://ailoot.ai/models/th/gpt-image-2-5-flare/#method-1)
- [**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations` `openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/gpt-image-2-5-flare/#method-2)

เกี่ยวกับโมเดล

คำอธิบายนี้ครอบคลุมความสามารถของโมเดล อินพุต เอาต์พุต และตัวเลือกที่ใช้ได้ใน Ailoot แสดงด้านล่างตามเมธอดที่เลือก

GPT Image 2.5 Flare เป็นรุ่นสร้างและแก้ไขภาพของ OpenAI ที่วางตำแหน่งสำหรับงานประจำวันคุณภาพสูงและรวดเร็ว รับข้อความและภาพแล้วส่งผลภาพ ใช้กับร่างภาพ ภาพประกอบ แนวคิดผลิตภัณฑ์ และงานสร้างสรรค์ซ้ำที่ต้องแปลงบรีฟเป็นภาพใช้ได้ทันเวลา Flare แยกจาก Sunburst ที่เน้นความแม่นยำในการแก้ เลือก Flare สำหรับการสร้างภาพประจำ และ Sunburst เมื่อการแก้อย่างแม่นยำเป็นหลัก

เริ่มด้วยตัวแบบหลัก การกระทำ สภาพแวดล้อม องค์ประกอบ และแนวทางภาพ สำหรับภาพประกอบแคมเปญ ขอคนขี่จักรยานข้ามสะพานเล็กในแสงยามเย็นโทนอุ่น มีเส้นรูปเด่นและท้องฟ้าโล่งสำหรับข้อความภายหลัง บรีฟสำรวจกระชับอาจเปิดการตัดสินใจสุนทรียะไว้ แต่บรีฟผลิตจริงควรระบุรายละเอียดและตำแหน่งสำคัญ เวิร์กโฟลว์สร้างและแก้โดยตรงรับพรอมป์ต์สูงสุด 32,000 อักขระและผลหนึ่งถึงสิบภาพ จึงใช้เปรียบเทียบไม่กี่แบบกับเป้าหมายเดียวกันได้

การแก้ไขส่งภาพอ้างอิงได้สูงสุดสิบหกภาพ กำหนดบทบาทแต่ละภาพให้ชัด แทนคาดให้โมเดลตัดสินว่าภาพแทนเอกลักษณ์ตัวแบบ ฉาก หรือสไตล์ มาสก์ชี้นำการเปลี่ยนพื้นที่ได้ และใช้กับภาพแรกเมื่อมีหลายภาพ ภาพและมาสก์ต้องมีรูปแบบกับขนาดตรงกัน มาสก์ต้องมีช่อง alpha คู่มือกำหนดให้ต้นฉบับและมาสก์ต่ำกว่า 50 MB มาสก์เป็นแนวทาง ไม่ใช่คำรับประกันคงขอบตรงเป๊ะ จึงระบุทั้งการเปลี่ยนที่ต้องการและสิ่งที่ควรจำได้

Flare รองรับคุณภาพ low, medium, high, xhigh, max และอัตโนมัติ โดยค่าเริ่มต้น auto คุณภาพต่ำใช้ทำร่างเร็ว ระดับสูงใช้เทียบรายละเอียดชิ้นงานสุดท้ายได้ คุณภาพแยกจากขนาดและการบีบอัดผล ขนาดมาตรฐานมี 1024 × 1024, 1536 × 1024 และ 1024 × 1536 พร้อมขนาดอัตโนมัติหรือกำหนดเอง เลือกแนวภาพตามตำแหน่งสุดท้ายและพื้นที่ใช้ได้ในฉาก

ความกว้างและสูงกำหนดเองต้องเป็นทวีคูณของสิบหก ไม่มีด้านเกิน 3840 พิกเซล อัตราส่วนที่อนุญาตจาก 1:3 ถึง 3:1 และพื้นที่รวมอย่างน้อย 655,360 ไม่เกิน 8,294,400 พิกเซล ทั้งสี่เงื่อนไขใช้พร้อมกัน คู่มือระบุความละเอียดเกิน 2560 × 1440 เป็นการทดลอง ใช้กรอบที่ถูกต้องเหมาะองค์ประกอบ และใส่รายละเอียดที่ต้องระวังการครอบตัดในบรีฟ แทนถือว่าความละเอียดมากขึ้นปรับเลย์เอาต์ให้อัตโนมัติ

ผลใช้ PNG เป็นค่าเริ่มต้น มีทางเลือก JPEG และ WebP ซึ่งเลือกการบีบอัด 0 ถึง 100 ได้ สำหรับพื้นหลังโปร่งใส เลือก PNG หรือ WebP และรองรับพื้นหลังทึบกับอัตโนมัติด้วย ชิ้นงานโปร่งใสนำไปวางในเลย์เอาต์ภายหลัง ส่วนภาพทึบมีฉากหลังของตัวเอง เลือกรูปแบบ พื้นหลัง และการบีบอัดตามความต้องการส่งมอบจริง แล้วเก็บไฟล์เสร็จพร้อมบรีฟและค่าตั้ง

ผู้ผลิตระบุการสร้างภาพและแก้โดยตรง รวมเครื่องมือภาพแบบสนทนาที่เก็บผลที่เลือกไว้เปลี่ยนต่อได้ ในเวิร์กโฟลว์นั้น action เป็นอัตโนมัติ บังคับสร้าง หรือบังคับแก้เมื่อมีภาพในบริบท สตรีมมิงแสดงภาพบางส่วนได้สูงสุดสามภาพก่อนผลสุดท้าย ภาพตัวอย่างเหล่านั้นแสดงความคืบหน้า ไม่ใช่ชิ้นงานสำเร็จที่เพิ่มขึ้น สำหรับการทำหลายรอบ ให้ต่อจากภาพที่เลือกและบรรยายสิ่งเปลี่ยนที่เห็น เช่น ย้ายวัตถุหนึ่งชิ้นหรือปรับแนวสี อินเทอร์เฟซผู้ผลิตรองรับ batch ด้วย

ตรวจตัวอักษร ตำแหน่งวัตถุ รายละเอียดตัวแบบ และองค์ประกอบภาพที่ขนาดต้องการ GPT Image ยังอาจมีปัญหาการวางข้อความตรงเป๊ะ เลย์เอาต์มีโครงสร้าง และเอกลักษณ์ภาพซ้ำข้ามการสร้าง เก็บแบบที่ยอมรับเป็นภาพอ้างอิงถัดไป แล้วจำกัดการแก้ต่อที่ประเด็นสำคัญ บทบาทสร้างงานประจำวันของ Flare มีประโยชน์กับลำดับชัดของบรีฟ ตัวเลือกภาพ การเลือก และการปรับปรุง โดยตัดสินชิ้นงานสุดท้ายตามเป้าหมายสร้างสรรค์จริง

**Ailoot · รูปภาพ** `POST /v1/images/generations` `gpt-image-2.5-flare`

[`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images)

OpenAI /`gpt-image-2.5-flare`

### เริ่มต้น

GPT Image 2.5 Flare สร้างและแก้ไขภาพจากข้อความและภาพอ้างอิง โดยเน้นงานภาพประจำวันรวดเร็ว รองรับขนาดกำหนดเอง พื้นหลังโปร่งใส มาสก์ และระดับคุณภาพถึง max สำหรับร่าง ภาพประกอบ และชิ้นงานแคมเปญ

อินพุตที่รองรับ

ข้อความ

ผลลัพธ์

รูปภาพ

### ใช้งานได้ใน Ailoot · อินพุตและเมธอด

**Ailoot · รูปภาพ** `POST /v1/images/generations`

ขาเข้า

`text`

ขาออก

`image`

รูปแบบเอาต์พุต

ไฟล์ภาพ

| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
| --- | --- | --- | --- | --- |
| ฟิลด์`model` | ประเภท`string` | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด gpt-image-2.5-flare | ค่าเริ่มต้น— |
| ฟิลด์`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

ข้อความอินพุต

US$0.005 */ 1K*

ขาเข้า, รูปภาพ

US$0.008 */ 1K tokens*

ขาออก, รูปภาพ

US$0.03 */ 1K tokens*

Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย [วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →](https://ailoot.ai/docs/th/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-flare", "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-flare', '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-flare", "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 จริง ห้ามส่งคำขอสร้าง/แก้ไขซ้ำ หรือสร้าง URL สำหรับตรวจสอบสถานะเป็นระยะจาก operation\_id

ฟิลด์การตอบกลับ

| ฟิลด์ | ประเภท |
| --- | --- |
| ฟิลด์`created` | ประเภทinteger |
| ฟิลด์`data[].url` | ประเภทstring |
| ฟิลด์`data[].b64_json` | ประเภทbase64 string |
| ฟิลด์`usage` | ประเภทobject |

ข้อผิดพลาดและขั้นตอนถัดไป

| การตอบกลับ | เงื่อนไข | ขั้นตอนถัดไป |
| --- | --- | --- |
| การตอบกลับ400 · `invalid_request_error` | เงื่อนไขฟิลด์จำเป็น รูปแบบการแทนข้อมูล หรือค่าพารามิเตอร์ไม่ถูกต้อง | ขั้นตอนถัดไปแก้ฟิลด์ที่ระบุก่อนส่งคำขอสร้างครั้งใหม่ |
| การตอบกลับ`server_error` | เงื่อนไขการตอบกลับที่ได้รับระบุว่าต้องตรวจสอบการดำเนินการหรือผลลัพธ์ | ขั้นตอนถัดไปเก็บ ID การดำเนินการ/งานที่ส่งกลับมาแต่เดิม ส่วนหัวของคำขอ และการตอบกลับไว้ แล้วอ่านข้อมูลการดำเนินการเดิมนั้นต่อด้วยวิธีที่รองรับ ห้ามส่งคำขอสร้างซ้ำ |

### ชื่ออื่น

#### ชื่ออื่นของโมเดล

<strong>Ailoot</strong> [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images)
**Ailoot Ultra** [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images), [`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images)

#### ชื่อพาธเมธอดอื่น

`/v1/images`

#### ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล

[`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images)

**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations` `gpt-image-2.5-flare`

[`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images)

OpenAI /`gpt-image-2.5-flare`

ID โมเดล

- `gpt-image-2.5-flare`
- `openai/gpt-image-2.5-flare`

### เริ่มต้น

GPT Image 2.5 Flare สร้างและแก้ไขภาพจากข้อความและภาพอ้างอิง โดยเน้นงานภาพประจำวันรวดเร็ว รองรับขนาดกำหนดเอง พื้นหลังโปร่งใส มาสก์ และระดับคุณภาพถึง max สำหรับร่าง ภาพประกอบ และชิ้นงานแคมเปญ

อินพุตที่รองรับ

ข้อความ

ผลลัพธ์

รูปภาพ

### ใช้งานได้ใน Ailoot · อินพุตและเมธอด

**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations`

ขาเข้า

`text`

ขาออก

`image`

| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
| --- | --- | --- | --- | --- |
| ฟิลด์`model` | ประเภท`string` | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด gpt-image-2.5-flare | ค่าเริ่มต้น— |
| ฟิลด์`prompt` | ประเภท`string` | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวสูงสุด: 32,000 | ค่าเริ่มต้น— |
| ฟิลด์`size` | ประเภท`string` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด เงื่อนไข: ใช้ auto หรือ WIDTHxHEIGHT โดยทั้งสองมิติต้องหารด้วย 16 ลงตัว ด้านที่ยาวที่สุดไม่เกิน 3,840 พิกเซล และขนาดรวมไม่เกิน 8,300,000 พิกเซล | ค่าเริ่มต้น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

ระดับการใช้เหตุผลสูงสุด

ไม่ได้ระบุ เมื่อใช้การปรับตามค่าเริ่มต้น (default) สำหรับระดับการใช้เหตุผลสูงสุด

#### อัตราประมาณการเพื่อเปรียบเทียบ

#### ราคาตามการตั้งค่า

เทียบค่าบริการแต่ละรายการกับเงื่อนไขที่แสดง เลือกใช้อัตราเดียวสำหรับแต่ละชุดการตั้งค่าที่เป็นตัวเลือกทดแทนกัน

| การตั้งค่า | ตารางอัตราค่าบริการ | ปริมาณคาดการณ์ | ค่าบริการ |
| --- | --- | --- | --- |
| การตั้งค่าอัตราค่าบริการโทเคนพื้นฐาน | ตารางอัตราค่าบริการอัตราพื้นฐาน | ปริมาณคาดการณ์— | ค่าบริการ ขาเข้า · โทเค็นอินพุต · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การอ่านแคช · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การเขียนแคช · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น |
| การตั้งค่าต้นทุนการสร้างโดยประมาณ | ตารางอัตราค่าบริการ— | ปริมาณคาดการณ์ค่าประมาณสำหรับการสร้างหนึ่งครั้ง | ค่าบริการ ขาออก · ค่าใช้จ่ายในการสร้างโดยประมาณ · ประมาณการเพื่อเปรียบเทียบเท่านั้น **$0.24576** ประมาณการก่อนสร้าง ค่าประมาณนี้ไม่ใช่ค่าใช้จ่ายเพิ่มเติมหรืออัตราคงที่สำหรับการสร้างผลลัพธ์ที่เสร็จสมบูรณ์แล้ว |

Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย [วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →](https://ailoot.ai/docs/th/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-2.5-flare', '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 ที่ส่งกลับมาจริง หรืออ่านจากคลังสื่อที่เป็นของตนเอง ห้ามสร้าง URL ของงานจาก ID การดำเนินการ และห้ามส่งคำขอสร้างซ้ำเด็ดขาด

ฟิลด์การตอบกลับ

| ฟิลด์ | ประเภท |
| --- | --- |
| ฟิลด์`created` | ประเภท |
| ฟิลด์`data[].url` | ประเภท |
| ฟิลด์`data[].b64_json` | ประเภท |
| ฟิลด์`usage` | ประเภท |

### ชื่ออื่น

#### ชื่ออื่นของโมเดล

<strong>Ailoot</strong> [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images)
**Ailoot Ultra** [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images), [`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images)

#### ชื่อพาธเมธอดอื่น

`/v1/images`

#### ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล

[`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images)

**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations` `openai/gpt-image-2.5-flare`

[`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images)

OpenAI /`openai/gpt-image-2.5-flare`

ID โมเดล

- `gpt-image-2.5-flare`
- `openai/gpt-image-2.5-flare`

### เริ่มต้น

GPT Image 2.5 Flare สร้างและแก้ไขภาพจากข้อความและภาพอ้างอิง โดยเน้นงานภาพประจำวันรวดเร็ว รองรับขนาดกำหนดเอง พื้นหลังโปร่งใส มาสก์ และระดับคุณภาพถึง max สำหรับร่าง ภาพประกอบ และชิ้นงานแคมเปญ

อินพุตที่รองรับ

ข้อความ · รูปภาพ

ผลลัพธ์

รูปภาพ

### ใช้งานได้ใน Ailoot · อินพุตและเมธอด

**Ailoot Ultra · รูปภาพ** `POST /v1/images/generations`

ขาเข้า

`text`, `image`

ขาออก

`image`

| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
| --- | --- | --- | --- | --- |
| ฟิลด์`model` | ประเภท`string` | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด openai/gpt-image-2.5-flare | ค่าเริ่มต้น— |
| ฟิลด์`prompt` | ประเภท`string` | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวขั้นต่ำ: 1 | ค่าเริ่มต้น— |
| ฟิลด์`aspect_ratio` | ประเภท`string` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, auto | ค่าเริ่มต้น— |
| ฟิลด์`quality` | ประเภท`string` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด auto, low, medium, high, xhigh, max | ค่าเริ่มต้น— |
| ฟิลด์`background` | ประเภท`string` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด auto, transparent, opaque | ค่าเริ่มต้น— |
| ฟิลด์`n` | ประเภท`integer` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 1 สูงสุด: 10 | ค่าเริ่มต้น— |
| ฟิลด์`input_references` | ประเภท`array` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 0 จำนวนรายการสูงสุด: 16 | ค่าเริ่มต้น— |
| ฟิลด์`output_compression` | ประเภท`integer` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 0 สูงสุด: 100 | ค่าเริ่มต้น— |
| ฟิลด์`provider` | ประเภท`object` | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |

พารามิเตอร์และวงจรการทำงานของเมธอด

| พารามิเตอร์ | ข้อกำหนด |
| --- | --- |
| พารามิเตอร์`content_type` | ข้อกำหนดapplication/json |
| พารามิเตอร์`required` | ข้อกำหนดmodel, prompt |
| พารามิเตอร์`material_types` | ข้อกำหนดtext, image |

วงจรการทำงาน: `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

ระดับการใช้เหตุผลสูงสุด

ไม่ได้ระบุ เมื่อใช้การปรับตามค่าเริ่มต้น (default) สำหรับระดับการใช้เหตุผลสูงสุด

#### อัตราประมาณการเพื่อเปรียบเทียบ

#### ราคาตามการตั้งค่า

เทียบค่าบริการแต่ละรายการกับเงื่อนไขที่แสดง เลือกใช้อัตราเดียวสำหรับแต่ละชุดการตั้งค่าที่เป็นตัวเลือกทดแทนกัน

| การตั้งค่า | ตารางอัตราค่าบริการ | ปริมาณคาดการณ์ | ค่าบริการ |
| --- | --- | --- | --- |
| การตั้งค่าอัตราค่าบริการโทเคนพื้นฐาน | ตารางอัตราค่าบริการอัตราพื้นฐาน | ปริมาณคาดการณ์— | ค่าบริการ ขาเข้า · โทเค็นอินพุต · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การอ่านแคช · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การเขียนแคช · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง · ประมาณการเพื่อเปรียบเทียบเท่านั้น **—** / 1K โทเค็น |
| การตั้งค่าต้นทุนการสร้างโดยประมาณ | ตารางอัตราค่าบริการ— | ปริมาณคาดการณ์ค่าประมาณสำหรับการสร้างหนึ่งครั้ง | ค่าบริการ ขาออก · ค่าใช้จ่ายในการสร้างโดยประมาณ · ประมาณการเพื่อเปรียบเทียบเท่านั้น **$0.24576** ประมาณการก่อนสร้าง ค่าประมาณนี้ไม่ใช่ค่าใช้จ่ายเพิ่มเติมหรืออัตราคงที่สำหรับการสร้างผลลัพธ์ที่เสร็จสมบูรณ์แล้ว |

Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย [วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →](https://ailoot.ai/docs/th/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={'model': 'openai/gpt-image-2.5-flare', 'prompt': 'a red panda astronaut floating in space, studio lighting'}

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 ที่ส่งกลับมาจริง หรืออ่านจากคลังสื่อที่เป็นของตนเอง ห้ามสร้าง URL ของงานจาก ID การดำเนินการ และห้ามส่งคำขอสร้างซ้ำเด็ดขาด

ฟิลด์การตอบกลับ

| ฟิลด์ | ประเภท |
| --- | --- |
| ฟิลด์`created` | ประเภท |
| ฟิลด์`data[].url` | ประเภท |
| ฟิลด์`data[].b64_json` | ประเภท |
| ฟิลด์`usage` | ประเภท |

### ชื่ออื่น

#### ชื่ออื่นของโมเดล

<strong>Ailoot</strong> [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images)
**Ailoot Ultra** [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images), [`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images)

#### ชื่อพาธเมธอดอื่น

`/v1/images`

#### ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล

[`openai/gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=openai%2Fgpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Core&caller=gpt-image-2.5-flare&fmt=images), [`gpt-image-2.5-flare`](https://ailoot.ai/models/th/#m=openai%2Fgpt-image-2.5-flare&route=Ultra&caller=gpt-image-2.5-flare&fmt=images)

FAQ · OpenAI: GPT Image 2.5 Flare

มีอินพุตและผลลัพธ์ใดบ้าง?

`POST /v1/images/generations` · `gpt-image-2.5-flare`: `text` → `image` `POST /v1/images/generations` · `gpt-image-2.5-flare`: `text` → `image` `POST /v1/images/generations` · `openai/gpt-image-2.5-flare`: `text`, `image` → `image`

คำขอใช้ฟิลด์ใดบ้าง?

`POST /v1/images/generations` · `gpt-image-2.5-flare`: `model`, `prompt`, `n`, `response_format`, `stream` `POST /v1/images/generations` · `gpt-image-2.5-flare`: `model`, `prompt`, `size`, `background`, `moderation`, `n`, `quality`, `output_compression`, `output_format`, `stream` `POST /v1/images/generations` · `openai/gpt-image-2.5-flare`: `model`, `prompt`, `aspect_ratio`, `quality`, `background`, `n`, `input_references`, `output_compression`, `provider`

มีข้อจำกัดใดบ้าง?

`POST /v1/images/generations` · `gpt-image-2.5-flare`: `n.minimum`: `1` `POST /v1/images/generations` · `gpt-image-2.5-flare`: `prompt.maximum_length`: `32000`; `n.minimum`: `1`; `n.maximum`: `10`; `output_compression.minimum`: `0`; `output_compression.maximum`: `100` `POST /v1/images/generations` · `openai/gpt-image-2.5-flare`: `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/th/billing/subscriptions/) · [ดูราคาโมเดล](https://ailoot.ai/models/th/)

## เชื่อม API กับผลิตภัณฑ์ ที่คุณขาย

SaaS แอป และบอต ตามข้อเสนอและสัญญาอนุญาต Ailoot หากขายต่อให้ขอใบอนุญาตรีเซลเลอร์

แอปเชิงพาณิชย์

ใส่การสร้างข้อความ ภาพ วิดีโอ และเสียงในฟีเจอร์เสียเงินของบริการคุณ

ใบอนุญาตรีเซลเลอร์

ส่งคำอธิบายโครงการและรูปแบบการเข้าถึง ขอเงื่อนไขใช้และขายต่อเป็นลายลักษณ์อักษร

เอกสารบนเว็บไซต์

อ่านข้อเสนอ สัญญาอนุญาต และนโยบายประมวลผลข้อมูลก่อนเชื่อมได้

[ขอใบอนุญาตขายต่อ](mailto:support@ailoot.ai) · [ข้อเสนอและสัญญาอนุญาต](https://ailoot.ai/legal/offer?lang=th)

## Ailoot · บริษัทและพอร์ตโฟลิโอโครงการของบริษัท





Ailoot อาศัยประสบการณ์การดำเนินงานที่สั่งสม ฐานลูกค้าขนาดใหญ่ บริการที่เสถียร และการติดตาม KPI อย่างต่อเนื่อง





บริษัทและพอร์ตโฟลิโอโครงการของบริษัท: ลูกค้าหลายล้านราย; ยอดขายระดับหลายพันล้านต่อเดือน.





Ailoot นำประสบการณ์การดำเนินงานนี้มาใช้เพื่อให้เข้าถึงฟังก์ชัน AI ผ่าน API ในผลิตภัณฑ์ของลูกค้า เอเจนต์ แอปพลิเคชัน และระบบอัตโนมัติ
