Jiniu AIJiniu AI
Docs
ImagesNative OpenAI format

Generate image

Create an image from a prompt. Learn more.

POST
/v1/images/generations

Request Body

application/json

model*string

Model name. Required by this gateway (optional in the official API); omitting it returns model is required

prompt*string

Image description. Up to 32000 characters for the GPT image family, 4000 for dall-e-3 and 1000 for dall-e-2

n?integer

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)

Range1 <= value <= 128
size?string

Output 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?string

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)

Value in"auto" | "low" | "medium" | "high" | "standard" | "hd"
background?string

Background handling, GPT image family only. transparent requires png or webp output

Value in"transparent" | "opaque" | "auto"
output_format?string

Output image format, supported by the GPT image family only

Value in"png" | "jpeg" | "webp"
output_compression?integer

Compression level 0–100, effective only for the GPT image family with webp or jpeg output

Range0 <= value <= 100
moderation?string

Moderation strictness, GPT image family only. low is more permissive, auto is the default

Value in"low" | "auto"
response_format?string

Response form, dall-e-2 and dall-e-3 only. url links are valid for 60 minutes; the GPT image family always returns base64

Value in"url" | "b64_json"
style?string

Style, dall-e-3 only. vivid is more dramatic, natural is more realistic

Value in"vivid" | "natural"
stream?boolean

Whether to stream partial results; GPT image family only

partial_images?integer

Number of partial images returned in streaming mode, 0–3

Range0 <= value <= 3
watermark?boolean

Whether to add a watermark. Gateway extension for upstreams that support it; the official OpenAI API has no such parameter

user?string

End-user identifier, useful for tracing abuse

user_id?string

Alias for the end-user identifier. Gateway extension

extra_fields?object

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"
    }
  ]
}