跳到主要内容

Creates an image given a prompt.

POST 

/images/generations

Uses an OpenAI-compatible request format. Parameter availability depends on the selected model and upstream provider; compatibility does not mean every model supports every field in the schema.

For GPT Image models, including GPT-image-2 and GPT-image-2.5, set moderation at the top level of the JSON body: auto (default) uses standard filtering; low uses less restrictive filtering. low does not disable moderation or guarantee that a prompt or generated image will pass safety checks. It is independent of quality: "low" and is not a platform-wide setting for other image providers.

size and quality control dimensions and generation quality; output_format and output_compression control file encoding and compression. GPT Image models return Base64 image data in data[*].b64_json; omit response_format.

See image generation parameter usage and provider limitations and moderation examples before copying parameters between models.

Request​

Responses​

OK

自助排查