跳转到主要内容

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 是 OpenAI 最新的图像生成模型,最长边支持 3840px。RuoLi 直接透传 OpenAI /v1/images/generations 协议,任何 OpenAI SDK 或兼容客户端都能直接对接。

基础信息

项目
端点POST https://ruoli.dev/v1/images/generations
Token 分组codex-team(其它分组报 No available channel
支持尺寸1K 1024x1024 1536x1024 1024x1536 · 2K 2048x2048 2048x1152 · 4K 3840x2160 2160x3840
出图时间30 – 90 秒
定价定价页为准,按张结算

调用示例

curl https://ruoli.dev/v1/images/generations \
  -H "Authorization: Bearer sk-你的KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "一只橘猫坐在沙发上",
    "size": "3840x2160"
  }'

请求参数

参数说明
model固定 gpt-image-2
prompt图片描述,中英文均可
n数量,1 – 10,默认 1
size基础信息里的 7 种尺寸
qualitystandard · hd · medium
response_formatb64_json(默认)· url。4K 响应 base64 约 8MB,流量敏感场景建议 url

常见错误

报错解决
No available channel令牌分组改成 codex-team
503 ... /images/generations改用 /v1/images/generations,不要走 /chat/completions
Invalid size基础信息里列出的 7 种尺寸
504 Gateway Timeout客户端超时设到 120 秒以上
后台”测试连通”按钮报 503 是正常现象 —— new-api 测试走 /chat/completions,图像模型只认 /images/generations,协议不匹配。真实调用不受影响,忽略即可。