
Portrait of an elderly fisherman mending a net at dawn, shot on 35mm film1024×1536, medium 
Night market noodle stall in the rain, neon reflected in puddles1536×1024, medium 
Vintage travel poster for Kyoto, the word KYOTO in bold letters across the top1024×1536, medium 
Isometric illustration of a tiny bookshop on a rainy street corner1024×1024, medium 
Watercolour botanical study of a fern, labelled in pencil1024×1536, medium
GPT Image 2 每张 ¥0.1。
兼容 OpenAI,改一行 base_url 就能用,失败不扣钱。
申请名额SDK 不换,只换地址。
OpenAI 的 SDK 照用。base_url 指向 apiaiapi,换上 apiaiapi 的 Key,images.generate 和 images.edit 原样能跑。
from openai import OpenAI
client = OpenAI(
base_url="https://api.apiaiapi.com/v1",
api_key="sk-...",
)
img = client.images.generate(
model="gpt-image-2",
prompt="Night market noodle stall in the rain",
size="1536x1024",
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.apiaiapi.com/v1",
apiKey: "sk-...",
});
const img = await client.images.generate({
model: "gpt-image-2",
prompt: "Night market noodle stall in the rain",
size: "1536x1024",
});
curl https://api.apiaiapi.com/v1/images/generations \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2",
"prompt": "Night market noodle stall in the rain",
"size": "1536x1024"}'
交了片,回头来取。
一张图要等一阵。异步接口立刻回一个任务号,轮询它,好了就拿到图片网址。
- 01
交片
马上返回 202。
POST /v1/images/generations/async 202 { "id": "task_JQ40Zws5uSYUQFPIwV0tJg", "object": "image.task", "status": "queued" } - 02
显影
生成期间轮询任务。
GET /v1/tasks/task_JQ40Zws5uSYUQFPIwV0tJg { "id": "task_JQ40Zws5uSYUQFPIwV0tJg", "status": "running" } - 03
取片
图片网址保留 7 天。
GET /v1/tasks/task_JQ40Zws5uSYUQFPIwV0tJg { "status": "succeeded", "data": [{ "url": "https://img.apiaiapi.com/2026-12-04/task_JQ40Zws5uSYUQFPIwV0tJg-0.png" }], "size": "1536x1024", "quality": "medium" }
Night market noodle stall in the rain, neon reflected in puddles
一个价,按张算。
¥0.1
每张,任何尺寸和质量
出来几张图,收几张的钱。
- 模型
- GPT Image 2
- 尺寸
- 1024×1024、1024×1536、1536×1024、auto
- 质量
- low、medium、high、auto
- 接口
- 生成和编辑,同步或异步
- 调用失败
- 全额退回
暗房须知。
- 调用失败怎么算?
- 上游出错、超时都全额退回。出图比要的少,只收出来的那几张。
- 同步还是异步?
- 同步接口一直等到出图。异步接口立刻回任务号,适合有超时限制的 Serverless 环境。
- 为什么要邀请?
- 出图的算力是共享的。名额分批开放,让已经进来的人不用排长队。
- 支持哪些 SDK?
- 任何 OpenAI SDK,或者直接发 HTTP。只换 base_url 和 Key。