Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)
Nano Banana 2 Lite หรือ Gemini 3.1 Flash Lite Image เป็นโมเดลภาพของ Google สำหรับสำรวจแนวทางภาพอย่างรวดเร็ว โปรไฟล์เผยแพร่รับข้อความและภาพ ส่งออกภาพหรือข้อความ รองรับบรีฟภาพที่มีข้อมูลภาพอ้างอิง
- Ailoot · รูปภาพ
POST /v1/images/generationsgemini-3.1-flash-lite-image - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsgoogle/gemini-3.1-flash-lite-image - Ailoot Ultra · รูปภาพ
POST /v1/images/generationsgoogle/gemini-3.1-flash-lite-image - Ailoot Ultra · Anthropic Messages
POST /v1/messagesgoogle/gemini-3.1-flash-lite-image
เกี่ยวกับโมเดล
คำอธิบายนี้ครอบคลุมความสามารถของโมเดล อินพุต เอาต์พุต และตัวเลือกที่ใช้ได้ใน Ailoot แสดงด้านล่างตามเมธอดที่เลือก
Nano Banana 2 Lite เป็นโมเดล Gemini 3.1 Flash Lite Image ของ Google มีบทบาทสำรวจภาพเร็วและงานข้อความเป็นภาพ โปรไฟล์เผยแพร่รับอินพุตข้อความและภาพ และคืนภาพกับข้อความได้ ทำให้บรีฟเขียนและภาพต้นทางอยู่ในคำขอสร้างสรรค์เดียวกัน
บรีฟที่ชัดสำหรับผลภาพ
อธิบายตัวแบบ องค์ประกอบ สื่อ และปลายทางของภาพ ภาพประกอบสินค้าระบุวัตถุ มุมมอง พื้นหลัง และพื้นที่ที่เลย์เอาต์รอบข้างต้องการได้ ฉากระบุสถานที่ การกระทำหลัก และรายละเอียดสร้างอารมณ์ได้ ทำความสัมพันธ์ไม่กี่อย่างที่นิยามภาพให้ชัดก่อนเพิ่มรายละเอียดตกแต่ง
เมื่อถ้อยคำที่มองเห็นสำคัญ ให้คำตรงตัวและลำดับชั้น ระบุบรรทัดนำและความสัมพันธ์กับตัวแบบหลัก ตรวจสะกด ป้าย และระยะห่างในภาพที่คืน ณ ขนาดใช้งาน แนวคิดภาพมีประโยชน์เมื่อเนื้อหาตรวจเทียบบรีฟได้
ระบุบทบาทของภาพอินพุต
บอกโมเดลว่าภาพที่ให้มีส่วนช่วยคำขออย่างไร อาจกำหนดตัวแบบ การจัดวางที่มองเห็น หรือข้อมูลที่ภาพใหม่ควรคำนึงถึง ระบุรายละเอียดสำคัญเพื่อไม่ให้ภาพอ้างอิงเป็นส่วนที่ไม่มีคำอธิบายในบรีฟ เก็บภาพต้นทางกับผลที่คืนเมื่อเทียบการเปลี่ยนหรือทิศทางภาพที่ขอ
ส่งภาพที่เลือกไปขั้นถัดไป
ตรวจชิ้นงานจริงเรื่องตัวแบบ กรอบภาพ ข้อความสำคัญ และความสัมพันธ์องค์ประกอบ เก็บบรีฟที่สำเร็จ ภาพอ้างอิง และผลที่เลือกด้วยกัน สำหรับชุดภาพ ให้รักษาตัวแบบและศัพท์ภาพที่ใช้ซ้ำในคำขอหลัง และเทียบความต่อเนื่องของผลก่อนรวมในเลย์เอาต์สมบูรณ์
ชิ้นงานที่มีประโยชน์คือภาพที่คืนหรือข้อความประกอบจากโปรไฟล์ Lite ตรงตัวนี้ ขนาดส่งออก รูปแบบไฟล์ และตัวควบคุมที่ยอมรับขึ้นกับอินเทอร์เฟซภาพที่ใช้ เก็บคุณสมบัติจริงของชิ้นงานไว้ด้วยเมื่อเตรียมวางหรือแก้ต่อ
งานตัวอย่างจริง
งานตัวอย่างจริง
ตัวอย่างทางเทคนิคภาษาอังกฤษ
Explore a product illustration
Create a clean editorial illustration of a reusable steel lunchbox, lid open at a three-quarter angle, with two compartments visible. Use soft daylight, a warm off-white background and restrained sage accents. Place the lunchbox in the lower-right area with generous empty space at upper left for a website heading. Include no lettering or logos.ผลลัพธ์ที่คาดหวัง
An image concept showing the open two-compartment lunchbox, warm background and clear upper-left layout space.ตรวจสอบผลลัพธ์
Inspect the actual image for two visible compartments, the requested placement and absence of lettering or logos.Ailoot · รูปภาพ POST /v1/images/generations gemini-3.1-flash-lite-image
gemini-3.1-flash-lite-imageเริ่มต้น
Nano Banana 2 Lite หรือ Gemini 3.1 Flash Lite Image เป็นโมเดลภาพของ Google สำหรับสำรวจแนวทางภาพอย่างรวดเร็ว โปรไฟล์เผยแพร่รับข้อความและภาพ ส่งออกภาพหรือข้อความ รองรับบรีฟภาพที่มีข้อมูลภาพอ้างอิง
- อินพุตที่รองรับ
- ข้อความ
- ผลลัพธ์
- รูปภาพ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot · รูปภาพ POST /v1/images/generations
- ขาเข้า
text- ขาออก
image- บริบท
- 65,536 tokens
- เอาต์พุตสูงสุด
- 4,096 tokens
- รูปแบบเอาต์พุต
- ไฟล์ภาพ
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด gemini-3.1-flash-lite-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
POST /v1/images/generations- ขาเข้า
- US$0.00025 / 1K โทเค็นภาพ
- ขาออก
- US$0.0336 ต่อภาพความละเอียด 1K
Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →
รายละเอียดอัตราอ้างอิง
ตารางอัตราอ้างอิงระดับโมเดลไม่เปลี่ยนเมธอดที่เลือก ยอดประมาณการ หรือค่าบริการ การคิดค่าบริการจริงใช้อัตราของเมธอด Ailoot ที่เลือก
ตารางอัตราอ้างอิงของโมเดล
ราคาตามการตั้งค่า
| การตั้งค่า | ตารางอัตราค่าบริการ | ค่าบริการ |
|---|---|---|
| การตั้งค่าUltra | ตารางอัตราค่าบริการอัตราพื้นฐาน | ค่าบริการ ขาเข้า · โทเค็นอินพุต $0.00050000 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต $0.0030000 / 1K โทเค็น ขาออก · ภาพขาออก $0.06000 / 1K โทเค็น ขาออก · การค้นหาบนเว็บ $0.028 ต่อการค้นหาเว็บ |
ตัวอย่างคำขอ
Ailoot · รูปภาพ
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": "gemini-3.1-flash-lite-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
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': 'gemini-3.1-flash-lite-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])
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": "gemini-3.1-flash-lite-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}/contentGET /v1/media/assetsGET /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 การดำเนินการ/งานที่ส่งกลับมาแต่เดิม ส่วนหัวของคำขอ และการตอบกลับไว้ แล้วอ่านข้อมูลการดำเนินการเดิมนั้นต่อด้วยวิธีที่รองรับ ห้ามส่งคำขอสร้างซ้ำ |
ชื่ออื่น
ชื่ออื่นของโมเดล
Ailoot gemini-3.1-flash-lite-image
Ailoot Ultra google/gemini-3.1-flash-lite-image
ชื่อพาธเมธอดอื่น
/v1/images
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-imageเริ่มต้น
Nano Banana 2 Lite หรือ Gemini 3.1 Flash Lite Image เป็นโมเดลภาพของ Google สำหรับสำรวจแนวทางภาพอย่างรวดเร็ว โปรไฟล์เผยแพร่รับข้อความและภาพ ส่งออกภาพหรือข้อความ รองรับบรีฟภาพที่มีข้อมูลภาพอ้างอิง
- อินพุตที่รองรับ
- ข้อความ
- ผลลัพธ์
- ข้อความ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- ขาเข้า
text- ขาออก
text- รูปแบบเอาต์พุต
- json หรือ SSE
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด google/gemini-3.1-flash-lite-image | ค่าเริ่มต้น— |
ฟิลด์messages | ประเภทmessage[] | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 1 | ค่าเริ่มต้น— |
ฟิลด์messages[].role | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ตัวอย่าง: system, user, assistant, tool, function เงื่อนไข: บทบาทเหล่านี้แทนอย่างชัดเจนด้วยชนิดข้อมูลเพื่อความเข้ากันได้ในซอร์สโค้ด แต่ชุดบทบาทที่แน่นอนยังขึ้นกับแต่ละโมเดล ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์messages[].content | ประเภทstring|content_part[]|null | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์messages[].tool_calls | ประเภทtool_call[] | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์messages[].tool_call_id | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ใช้เมื่อ: role=tool โดยใช้ ID ที่ส่งกลับจริง | ค่าเริ่มต้น— |
ฟิลด์messages[].name | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์messages[].reasoning_content | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ใช้เมื่อ: ส่งเนื้อหาการใช้เหตุผลที่คืนจริงกลับในคำขอถัดไป เมื่อโมเดลนี้ใช้เนื้อหานั้น | ค่าเริ่มต้น— |
ฟิลด์messages[].reasoning_details | ประเภทobject|array | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์max_tokens | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 1 ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์max_completion_tokens | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 1 ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์stream | ประเภทboolean | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้นfalse |
ฟิลด์stream_options.include_usage | ประเภทboolean | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์temperature | ประเภทnumber | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์top_p | ประเภทnumber | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์stop | ประเภทstring|string[] | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์tools | ประเภทfunction_tool[] | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์tools[].type | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด function ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์tools[].function.name | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ใช้เมื่อ: มีเครื่องมือฟังก์ชันให้ใช้ | ค่าเริ่มต้น— |
ฟิลด์tools[].function.description | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์tools[].function.parameters | ประเภทJSON_schema | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์tool_choice | ประเภทstring|object | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์parallel_tool_calls | ประเภทboolean | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์response_format | ประเภทobject | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์reasoning_effort | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์reasoning | ประเภทobject | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์service_tier | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์instructions | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ฟิลด์เพื่อความเข้ากันได้ | ค่าเริ่มต้น— |
ฟิลด์functions | ประเภทfunction[] | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์function_call | ประเภทstring|object | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์prompt_cache_options | ประเภทobject | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขึ้นอยู่กับโมเดล | ค่าเริ่มต้น— |
ฟิลด์modalities | ประเภทstring[] | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด text | ค่าเริ่มต้น— |
ฟิลด์provider | ประเภทobject | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด เงื่อนไข: เส้นทางข้อความ Ultra นี้ปฏิเสธ provider.options | ค่าเริ่มต้น— |
ฟิลด์cache_control.ttl | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด เงื่อนไข: ตำแหน่งแคชพรอมป์ต์จริงปฏิเสธ 1h | ค่าเริ่มต้น— |
ชุดผสมของสื่ออินพุต
ข้อความ · ข้อความ UTF8
messages[].content
พารามิเตอร์และวงจรการทำงานของเมธอด
| พารามิเตอร์ | ข้อกำหนด |
|---|---|
พารามิเตอร์content_type | ข้อกำหนดapplication/json |
พารามิเตอร์required | ข้อกำหนดmodel, messages |
พารามิเตอร์material_types | ข้อกำหนดtext |
พารามิเตอร์messages | ข้อกำหนดอาร์เรย์ข้อความที่มีโครงสร้าง role/content |
พารามิเตอร์file_material | ข้อกำหนดแทรกเอกสาร UTF-8 จริงเป็นข้อความตามต้นฉบับ โดยไม่อนุมาน ID ไฟล์ |
พารามิเตอร์optional_controls | ข้อกำหนดstream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
พารามิเตอร์control_scope | ข้อกำหนดขึ้นกับโมเดล เครื่องมือฟังก์ชันของผู้ใช้ต่างจากเครื่องมือที่โฮสต์จัดให้ |
พารามิเตอร์output_modalities | ข้อกำหนดtext |
พารามิเตอร์hosted_operations | ข้อกำหนดfalse |
พารามิเตอร์multimodal_input_binding | ข้อกำหนดnull |
วงจรการทำงาน: synchronous_or_streamed
ส่ง ID โมเดลที่ตรงทุกตัวพร้อม messages
ความยาวบริบทไม่ใช่เพดานผลลัพธ์
ไฟล์ข้อความให้ข้อความตามต้นฉบับได้ ส่วนข้อมูลเข้าภาพ/เสียง/ออบเจ็กต์ไฟล์ต้องมีการผูกที่ตรงตามจริง
ราคา
ข้อมูลอัตราราคาไม่ได้เพิ่มตัวเลือกคำขอ พารามิเตอร์ที่รองรับระบุไว้สำหรับเมธอดที่เลือก
- โหมดรวดเร็ว
- อัตรามาตรฐาน เมื่อเลือกโหมดรวดเร็ว
- โหมดยืดหยุ่น
- อัตรามาตรฐาน เมื่อเลือกโหมด flex
- ระดับการใช้เหตุผลสูงสุด
- อัตรามาตรฐาน เมื่อใช้การปรับตามค่าเริ่มต้น (default) สำหรับระดับการใช้เหตุผลสูงสุด
- ระดับการใช้เหตุผล · สูง
- อัตรามาตรฐาน เมื่อระดับการใช้เหตุผลอยู่ในระดับสูง
- ระดับการใช้เหตุผล · ต่ำสุด
- อัตรามาตรฐาน เมื่อระดับการใช้เหตุผลอยู่ในระดับต่ำสุด
- การคิดราคาแคชแบบระบุชัด
- ไม่ได้เปิดใช้ เมื่อร้องขอแคชแบบระบุชัด
อัตราค่าบริการ Ailoot
ราคาตามการตั้งค่า
เทียบค่าบริการแต่ละรายการกับเงื่อนไขที่แสดง เลือกใช้อัตราเดียวสำหรับแต่ละชุดการตั้งค่าที่เป็นตัวเลือกทดแทนกัน
| การตั้งค่า | ตารางอัตราค่าบริการ | โทเค็นบริบท มากกว่า | โทเค็นบริบท ไม่เกินและรวมค่า | ค่าบริการ |
|---|---|---|---|---|
| การตั้งค่าอัตราราคาพื้นฐานของโทเคน | ตารางอัตราค่าบริการอัตราพื้นฐาน | โทเค็นบริบท มากกว่า— | โทเค็นบริบท ไม่เกินและรวมค่าไม่มีขีดจำกัดสูงสุด | ค่าบริการ ขาเข้า · โทเค็นอินพุต $0.0005 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต $0.003 / 1K โทเค็น ขาเข้า · การอ่านแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง — / 1K โทเค็น ขาออก · โทเคนภาพขาออก $0.06 / 1K โทเค็นภาพ |
| การตั้งค่าระดับความยาวคำขอ 1 | ตารางอัตราค่าบริการ— | โทเค็นบริบท มากกว่า0 | โทเค็นบริบท ไม่เกินและรวมค่าไม่มีขีดจำกัดสูงสุด | ค่าบริการ ขาเข้า · โทเค็นอินพุต $0.0005 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต $0.003 / 1K โทเค็น ขาเข้า · การอ่านแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง — / 1K โทเค็น |
รายละเอียดอัตราอ้างอิง
ตารางอัตราอ้างอิงระดับโมเดลไม่เปลี่ยนเมธอดที่เลือก ยอดประมาณการ หรือค่าบริการ การคิดค่าบริการจริงใช้อัตราของเมธอด Ailoot ที่เลือก
Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)
ราคาตามการตั้งค่า
| การตั้งค่า | เงื่อนไขคิดค่าบริการ | ค่าบริการ |
|---|---|---|
| การตั้งค่าGoogle: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image) · การตั้งค่าเริ่มต้น | เงื่อนไขคิดค่าบริการการตั้งค่าเริ่มต้น | ค่าบริการ ขาเข้า · โทเค็นอินพุต US$0.0005 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต US$0.003 / 1K โทเค็น ขาออก · ภาพขาออก US$0.06 / 1K โทเค็น ขาออก · การค้นหาบนเว็บ US$0.028 ต่อการค้นหา |
Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →
ตัวอย่างคำขอ
Ailoot Ultra · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "google/gemini-3.1-flash-lite-image", "messages": [{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}]}')
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/chat/completions \
-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 json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model='google/gemini-3.1-flash-lite-image',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}])
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(result.to_dict(mode="json"))
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='google/gemini-3.1-flash-lite-image',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_completion()
save_result(final.to_dict(mode="json"),"stream-result")
รับและบันทึกผลลัพธ์
Ailoot Ultra · OpenAI Chat
json หรือ SSE
เก็บผลลัพธ์ที่เสร็จสมบูรณ์ทั้งหมด
เก็บทุกการตอบกลับ ไฟล์ และส่วนเนื้อหาที่ส่งกลับมาอย่างครบถ้วน
เก็บทุกตัวเลือกพร้อมเนื้อหา/การเรียกเครื่องมือ/การใช้เหตุผล ใน SSE ให้ประกอบส่วนเพิ่มตามดัชนีตัวเลือก/เครื่องมือ และเก็บเหตุผลสิ้นสุดกับข้อมูลการใช้งานสุดท้าย
เมื่อต้องตรวจสอบการตอบกลับต้นฉบับ
เก็บ ID และส่วนหัวของคำขอ/คำตอบ ไม่มี URL ทั่วไปสำหรับดึงงานข้อความให้ใช้
ฟิลด์การตอบกลับ
| ฟิลด์ | ประเภท |
|---|---|
ฟิลด์choices[].index | ประเภทinteger |
ฟิลด์choices[].message.content | ประเภทstring|null |
ฟิลด์choices[].message.tool_calls | ประเภทtool_call[] |
ฟิลด์choices[].message.reasoning_content | ประเภทstring |
ฟิลด์choices[].message.reasoning_details | ประเภทobject|array |
ฟิลด์choices[].finish_reason | ประเภทstring|null |
ฟิลด์usage | ประเภทobject |
ข้อผิดพลาดและขั้นตอนถัดไป
| การตอบกลับ | เงื่อนไข | ขั้นตอนถัดไป |
|---|---|---|
การตอบกลับ400 · invalid_request_error | เงื่อนไขฟิลด์จำเป็น รูปแบบการแทนข้อมูล หรือค่าพารามิเตอร์ไม่ถูกต้อง | ขั้นตอนถัดไปแก้ฟิลด์ที่ระบุก่อนส่งคำขอสร้างครั้งใหม่ |
ชื่ออื่น
ชื่ออื่นของโมเดล
Ailoot gemini-3.1-flash-lite-image
Ailoot Ultra google/gemini-3.1-flash-lite-image
ชื่อพาธเมธอดอื่น
/v1/images
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image
Ailoot Ultra · รูปภาพ POST /v1/images/generations google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-imageเริ่มต้น
Nano Banana 2 Lite หรือ Gemini 3.1 Flash Lite Image เป็นโมเดลภาพของ Google สำหรับสำรวจแนวทางภาพอย่างรวดเร็ว โปรไฟล์เผยแพร่รับข้อความและภาพ ส่งออกภาพหรือข้อความ รองรับบรีฟภาพที่มีข้อมูลภาพอ้างอิง
- อินพุตที่รองรับ
- ข้อความ · รูปภาพ
- ผลลัพธ์
- รูปภาพ
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot Ultra · รูปภาพ POST /v1/images/generations
- ขาเข้า
text,image- ขาออก
image
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด google/gemini-3.1-flash-lite-image | ค่าเริ่มต้น— |
ฟิลด์prompt | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด ความยาวขั้นต่ำ: 1 | ค่าเริ่มต้น— |
ฟิลด์resolution | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 1K | ค่าเริ่มต้น— |
ฟิลด์aspect_ratio | ประเภทstring | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 | ค่าเริ่มต้น— |
ฟิลด์n | ประเภทinteger | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด ขั้นต่ำ: 1 สูงสุด: 1 | ค่าเริ่มต้น— |
ฟิลด์input_references | ประเภทarray | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด จำนวนรายการขั้นต่ำ: 0 จำนวนรายการสูงสุด: 14 | ค่าเริ่มต้น— |
ฟิลด์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 กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →
ตัวอย่างคำขอ
Ailoot Ultra · รูปภาพ
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': 'google/gemini-3.1-flash-lite-image', '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}/contentGET /v1/media/assetsGET /v1/media/assets/{asset_id}
การอ่านเนื้อหาแบบอื่น
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 | ประเภท |
ชื่ออื่น
ชื่ออื่นของโมเดล
Ailoot gemini-3.1-flash-lite-image
Ailoot Ultra google/gemini-3.1-flash-lite-image
ชื่อพาธเมธอดอื่น
/v1/images
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image
Ailoot Ultra · Anthropic Messages POST /v1/messages google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-imageเริ่มต้น
Nano Banana 2 Lite หรือ Gemini 3.1 Flash Lite Image เป็นโมเดลภาพของ Google สำหรับสำรวจแนวทางภาพอย่างรวดเร็ว โปรไฟล์เผยแพร่รับข้อความและภาพ ส่งออกภาพหรือข้อความ รองรับบรีฟภาพที่มีข้อมูลภาพอ้างอิง
- อินพุตที่รองรับ
- ข้อความ
- ผลลัพธ์
- json · sse
ใช้งานได้ใน Ailoot · อินพุตและเมธอด
Ailoot Ultra · Anthropic Messages POST /v1/messages
- ขาเข้า
text- ขาออก
json,sse- รูปแบบเอาต์พุต
- JSON หรือ SSE
| ฟิลด์ | ประเภท | ข้อกำหนด | ค่าและข้อจำกัด | ค่าเริ่มต้น |
|---|---|---|---|---|
ฟิลด์model | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด google/gemini-3.1-flash-lite-image | ค่าเริ่มต้น— |
ฟิลด์messages | ประเภทmessage[] | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์messages[].role | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด user, assistant | ค่าเริ่มต้น— |
ฟิลด์messages[].content | ประเภทstring | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์max_tokens | ประเภทinteger | ข้อกำหนดจำเป็น | ค่าและข้อจำกัด | ค่าเริ่มต้น— |
ฟิลด์stream | ประเภทboolean | ข้อกำหนดไม่บังคับ | ค่าและข้อจำกัด | ค่าเริ่มต้นfalse |
ชุดผสมของสื่ออินพุต
ข้อความ · ข้อความ UTF-8
สตริง messages[].content
พารามิเตอร์และวงจรการทำงานของเมธอด
| พารามิเตอร์ | ข้อกำหนด |
|---|---|
พารามิเตอร์content_type | ข้อกำหนดapplication/json |
พารามิเตอร์required | ข้อกำหนดmodel, messages, max_tokens |
พารามิเตอร์optional_controls | ข้อกำหนดstream |
พารามิเตอร์material_types | ข้อกำหนดtext |
พารามิเตอร์text_file_material | ข้อกำหนดอ่านเอกสาร UTF-8 จริง แล้วใส่ข้อความใน input หรือสตริงเนื้อหาข้อความที่ระบุ |
วงจรการทำงาน: synchronous_or_streamed
ราคา
ข้อมูลอัตราราคาไม่ได้เพิ่มตัวเลือกคำขอ พารามิเตอร์ที่รองรับระบุไว้สำหรับเมธอดที่เลือก
- โหมดรวดเร็ว
- อัตรามาตรฐาน เมื่อเลือกโหมดรวดเร็ว
- โหมดยืดหยุ่น
- อัตรามาตรฐาน เมื่อเลือกโหมด flex
- ระดับการใช้เหตุผลสูงสุด
- อัตรามาตรฐาน เมื่อใช้การปรับตามค่าเริ่มต้น (default) สำหรับระดับการใช้เหตุผลสูงสุด
- ระดับการใช้เหตุผล · สูง
- อัตรามาตรฐาน เมื่อระดับการใช้เหตุผลอยู่ในระดับสูง
- ระดับการใช้เหตุผล · ต่ำสุด
- อัตรามาตรฐาน เมื่อระดับการใช้เหตุผลอยู่ในระดับต่ำสุด
- การคิดราคาแคชแบบระบุชัด
- ไม่ได้เปิดใช้ เมื่อร้องขอแคชแบบระบุชัด
อัตราค่าบริการ Ailoot
ราคาตามการตั้งค่า
เทียบค่าบริการแต่ละรายการกับเงื่อนไขที่แสดง เลือกใช้อัตราเดียวสำหรับแต่ละชุดการตั้งค่าที่เป็นตัวเลือกทดแทนกัน
| การตั้งค่า | ตารางอัตราค่าบริการ | โทเค็นบริบท มากกว่า | โทเค็นบริบท ไม่เกินและรวมค่า | ค่าบริการ |
|---|---|---|---|---|
| การตั้งค่าอัตราราคาพื้นฐานของโทเคน | ตารางอัตราค่าบริการอัตราพื้นฐาน | โทเค็นบริบท มากกว่า— | โทเค็นบริบท ไม่เกินและรวมค่าไม่มีขีดจำกัดสูงสุด | ค่าบริการ ขาเข้า · โทเค็นอินพุต $0.0005 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต $0.003 / 1K โทเค็น ขาเข้า · การอ่านแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง — / 1K โทเค็น ขาออก · โทเคนภาพขาออก $0.06 / 1K โทเค็นภาพ |
| การตั้งค่าระดับความยาวคำขอ 1 | ตารางอัตราค่าบริการ— | โทเค็นบริบท มากกว่า0 | โทเค็นบริบท ไม่เกินและรวมค่าไม่มีขีดจำกัดสูงสุด | ค่าบริการ ขาเข้า · โทเค็นอินพุต $0.0005 / 1K โทเค็น ขาออก · โทเค็นเอาต์พุต $0.003 / 1K โทเค็น ขาเข้า · การอ่านแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช — / 1K โทเค็น ขาเข้า · การเขียนแคช, 1 ชั่วโมง — / 1K โทเค็น |
Ailoot กันยอดเงินประมาณการไว้ก่อนส่งคำขอ หลังได้ผลลัพธ์ จะคิดค่าบริการสุดท้ายตามการใช้งานที่วัดได้ การคิดค่าบริการแบบสตรีมใช้บันทึกการใช้งานสุดท้าย วิธีกันยอดเงินและคิดค่าบริการสุดท้าย →
ตัวอย่างคำขอ
Ailoot Ultra · Anthropic Messages
{
"model": "google/gemini-3.1-flash-lite-image",
"max_tokens": 128,
"messages": [
{
"role": "user",
"content": "Summarize the incident report."
}
],
"stream": false
}set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'google/gemini-3.1-flash-lite-image', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'google/gemini-3.1-flash-lite-image', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError
api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
with urlopen(request, timeout=120) as response:
raw = response.read()
Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
Path('result.json').write_bytes(error.read())
Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
รับและบันทึกผลลัพธ์
Ailoot Ultra · Anthropic Messages
JSON หรือ SSE
เก็บผลลัพธ์ที่เสร็จสมบูรณ์ทั้งหมด
เก็บทุกการตอบกลับ ไฟล์ และส่วนเนื้อหาที่ส่งกลับมาอย่างครบถ้วน
เก็บทุกบล็อกเนื้อหา ลายเซ็นการคิด และ ID การใช้เครื่องมือจริง ประกอบส่วนเพิ่มของบล็อก SSE ทั้งหมด บล็อกข้อความแรกไม่ใช่ผลลัพธ์ทั้งหมด
เมื่อต้องตรวจสอบการตอบกลับต้นฉบับ
เก็บ ID และส่วนหัวของคำขอ/คำตอบ ไม่มี URL ทั่วไปสำหรับดึงงานข้อความให้ใช้
ฟิลด์การตอบกลับ
| ฟิลด์ | ประเภท |
|---|---|
ฟิลด์id | ประเภทstring |
ฟิลด์model | ประเภทstring |
ฟิลด์content[] | ประเภทtext|thinking|tool_use|other content block |
ฟิลด์stop_reason | ประเภทstring|null |
ฟิลด์usage | ประเภทobject |
ข้อผิดพลาดและขั้นตอนถัดไป
| การตอบกลับ | เงื่อนไข | ขั้นตอนถัดไป |
|---|---|---|
การตอบกลับ400 · invalid_request_error | เงื่อนไขฟิลด์จำเป็น รูปแบบการแทนข้อมูล หรือค่าพารามิเตอร์ไม่ถูกต้อง | ขั้นตอนถัดไปแก้ฟิลด์ที่ระบุก่อนส่งคำขอสร้างครั้งใหม่ |
ชื่ออื่น
ชื่ออื่นของโมเดล
Ailoot gemini-3.1-flash-lite-image
Ailoot Ultra google/gemini-3.1-flash-lite-image
ชื่อพาธเมธอดอื่น
/v1/images
ID ที่เกี่ยวข้องสำหรับเรียกใช้โมเดล
google/gemini-3.1-flash-lite-image, gemini-3.1-flash-lite-image
FAQ · Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)
- มีอินพุตและผลลัพธ์ใดบ้าง?
POST /v1/images/generations·gemini-3.1-flash-lite-image:text→imagePOST /v1/chat/completions·google/gemini-3.1-flash-lite-image:text→textPOST /v1/images/generations·google/gemini-3.1-flash-lite-image:text,image→imagePOST /v1/messages·google/gemini-3.1-flash-lite-image:text→json,sse- คำขอใช้ฟิลด์ใดบ้าง?
POST /v1/images/generations·gemini-3.1-flash-lite-image:model,prompt,n,response_format,streamPOST /v1/chat/completions·google/gemini-3.1-flash-lite-image:model,messages,stream,modalities,providerPOST /v1/images/generations·google/gemini-3.1-flash-lite-image:model,prompt,resolution,aspect_ratio,n,input_references,providerPOST /v1/messages·google/gemini-3.1-flash-lite-image:model,messages,max_tokens,stream- มีข้อจำกัดใดบ้าง?
POST /v1/images/generations·gemini-3.1-flash-lite-image:ctx:65536;max_out:4096;n.minimum:1POST /v1/chat/completions·google/gemini-3.1-flash-lite-image:messages.min_items:1POST /v1/images/generations·google/gemini-3.1-flash-lite-image:n.minimum:1;n.maximum:1