GPT Image 2.5 Flare
gpt-image-2.5-flare
Thông số
- Nhà cung cấp
- OpenAI
- Loại
- Tạo ảnh
- Đầu vào
- Văn bản
- Đầu ra
- Ảnh
- Ngữ cảnh
- 200K
- Định dạng API
- Images
Giá
| Mục | VNĐ | Credit | Đơn vị |
|---|---|---|---|
| Mỗi ảnh | 2.338đ | 2.337,5 credit | / ảnh |
1 credit = 1đ. Credit trừ theo usage thực tế sau mỗi request. Xem bảng giá và gói nạp
Bắt đầu nhanh
- Tạo API key tại trang API key (cần đăng ký trước).
- Lưu key vào biến môi trường
WIROUTER_API_KEY. - Gọi API với base URL
https://api.wirouter.store/v1và modelgpt-image-2.5-flare.
export WIROUTER_API_KEY="your-api-key"
curl -s https://api.wirouter.store/v1/models -H "Authorization: Bearer $WIROUTER_API_KEY"
Gọi API
Tạo ảnh
Tạo ảnh (OpenAI Images) POST /v1/images/generations
curl -sS --fail-with-body https://api.wirouter.store/v1/images/generations \
-H "Authorization: Bearer $WIROUTER_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<'EOF' | jq -er '.data[0].b64_json' | base64 -d > image.png
{
"model": "gpt-image-2.5-flare",
"prompt": "Một chú cáo đỏ ngồi trên tuyết, tranh minh họa phẳng",
"aspect_ratio": "16:9",
"resolution": "2K",
"n": 1
}
EOF
import base64
import os
import requests
API_KEY = os.environ["WIROUTER_API_KEY"]
resp = requests.post(
"https://api.wirouter.store/v1/images/generations",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"model": "gpt-image-2.5-flare",
"prompt": "Một chú cáo đỏ ngồi trên tuyết, tranh minh họa phẳng",
"aspect_ratio": "16:9",
"resolution": "2K",
"n": 1
},
timeout=300,
)
resp.raise_for_status()
data = resp.json()
open("image.png", "wb").write(base64.b64decode(data["data"][0]["b64_json"]))
// Node 18+ (lưu thành file .mjs)
import fs from "node:fs";
const apiKey = process.env.WIROUTER_API_KEY;
const resp = await fetch("https://api.wirouter.store/v1/images/generations", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"model": "gpt-image-2.5-flare",
"prompt": "Một chú cáo đỏ ngồi trên tuyết, tranh minh họa phẳng",
"aspect_ratio": "16:9",
"resolution": "2K",
"n": 1
}),
});
if (!resp.ok) throw new Error(`HTTP ${resp.status}: ${await resp.text()}`);
const data = await resp.json();
fs.writeFileSync("image.png", Buffer.from(data.data[0].b64_json, "base64"));
Lỗi thường gặp
401- API key sai, đã bị thu hồi hoặc tài khoản hết credit. Kiểm tra key và số dư.
429- Model tạm hết quota hoặc đang cooldown. Thử lại sau số giây trong header
Retry-After. 400- Request không hợp lệ, thường do sai model ID. Dùng đúng ID
gpt-image-2.5-flare. 524- Request chạy quá 100 giây nên bị cắt. Dùng stream hoặc rút gọn yêu cầu.