Generate image
Create an image from a prompt. Learn more.
Request Body
application/json
Model name. Required by this gateway (optional in the official API); omitting it returns model is required
Image description. Up to 32000 characters for the GPT image family, 4000 for dall-e-3 and 1000 for dall-e-2
Number of results. The gateway allows 1–128 and treats omitted or 0 as 1; the real ceiling depends on the upstream model (officially 1–10 for OpenAI, and only 1 for dall-e-3)
1 <= value <= 128Output size, formatted as widthxheight. The gateway validates it per model: dall-e-2 accepts only 256x256 / 512x512 / 1024x1024 (default 1024x1024), dall-e-3 only 1024x1024 / 1024x1792 / 1792x1024 (default 1024x1024), and the GPT image family is unrestricted. Use a lowercase x — the full-width multiplication sign × is rejected
Quality tier. GPT image uses low / medium / high / auto (the gateway fills in auto); dall-e-3 uses standard / hd (the gateway fills in standard)
"auto" | "low" | "medium" | "high" | "standard" | "hd"Background handling, GPT image family only. transparent requires png or webp output
"transparent" | "opaque" | "auto"Output image format, supported by the GPT image family only
"png" | "jpeg" | "webp"Compression level 0–100, effective only for the GPT image family with webp or jpeg output
0 <= value <= 100Moderation strictness, GPT image family only. low is more permissive, auto is the default
"low" | "auto"Response form, dall-e-2 and dall-e-3 only. url links are valid for 60 minutes; the GPT image family always returns base64
"url" | "b64_json"Style, dall-e-3 only. vivid is more dramatic, natural is more realistic
"vivid" | "natural"Whether to stream partial results; GPT image family only
Number of partial images returned in streaming mode, 0–3
0 <= value <= 3Whether to add a watermark. Gateway extension for upstreams that support it; the official OpenAI API has no such parameter
End-user identifier, useful for tracing abuse
Alias for the end-user identifier. Gateway extension
Extra parameters forwarded upstream. Gateway extension for provider-specific options
Response Body
application/json
curl -X POST "https://jiniu.ai/v1/images/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-1", "prompt": "一只戴着宇航头盔的柴犬,等距视角,柔和光照" }'{
"created": 0,
"data": [
{
"url": "string",
"b64_json": "string",
"revised_prompt": "string"
}
]
}