Documentation Index
Fetch the complete documentation index at: https://docs.ruoli.dev/llms.txt
Use this file to discover all available pages before exploring further.
gpt-image-2 is OpenAI’s latest image-generation model, supporting up to 3840px on the longest side. RuoLi proxies OpenAI’s /v1/images/generations protocol directly — any OpenAI SDK or compatible client works out of the box.
Basics
| Field | Value |
|---|
| Endpoint | POST https://ruoli.dev/v1/images/generations |
| Token group | codex-team (other groups return No available channel) |
| Sizes | 1K 1024x1024 1536x1024 1024x1536 · 2K 2048x2048 2048x1152 · 4K 3840x2160 2160x3840 |
| Latency | 30 – 90 seconds |
| Pricing | See the pricing page, billed per image |
Examples
curl https://ruoli.dev/v1/images/generations \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "An orange cat sitting on a sofa",
"size": "3840x2160"
}'
from openai import OpenAI
import base64
client = OpenAI(
api_key="sk-YOUR-KEY",
base_url="https://ruoli.dev/v1",
)
res = client.images.generate(
model="gpt-image-2",
prompt="An orange cat sitting on a sofa",
size="3840x2160",
)
with open("cat.png", "wb") as f:
f.write(base64.b64decode(res.data[0].b64_json))
import OpenAI from "openai";
import fs from "fs";
const client = new OpenAI({
apiKey: "sk-YOUR-KEY",
baseURL: "https://ruoli.dev/v1",
});
const res = await client.images.generate({
model: "gpt-image-2",
prompt: "An orange cat sitting on a sofa",
size: "3840x2160",
});
fs.writeFileSync(
"cat.png",
Buffer.from(res.data[0].b64_json, "base64"),
);
Request Parameters
| Param | Description |
|---|
model | Fixed gpt-image-2 |
prompt | Image description, Chinese or English |
n | Count, 1 – 10, default 1 |
size | One of the 7 sizes in Basics |
quality | standard · hd · medium |
response_format | b64_json (default) · url. 4K base64 ~8MB — use url for bandwidth-sensitive cases |
Common Errors
| Error | Fix |
|---|
No available channel | Switch token group to codex-team |
503 ... /images/generations | Use /v1/images/generations — not /chat/completions |
Invalid size | Pick one of the 7 sizes in Basics |
504 Gateway Timeout | Raise client timeout to 120s+ |
The “Test Connectivity” button in the console returns 503 — this is normal. The new-api test hits /chat/completions, but image models only accept /images/generations — a protocol mismatch. Real client calls work fine; ignore the test button’s error.