Image Generation

Native OpenAI Images protocol, synchronous — no polling

POST/v1/images/generations

Image generation uses the native OpenAI Images API (POST /v1/images/generations) and is synchronous: the connection stays open until generation completes (seconds up to ~2 minutes depending on model and resolution) and the response carries the image URLs or Base64 directly. There is no task Id and no polling. Available models come from List Models.

Authorizations

Authorizationstring必填

Bearer Token authentication.

Authorization: Bearer YOUR_API_KEY

Endpoint

POST /v1/images/generations

Native OpenAI fields (supported subsets vary by model; refer to each model's upstream docs):

  • model (required), prompt (required)
  • n (optional, default 1)
  • size (optional): pixel dimensions such as "1024x1024", "1536x1024" (pixels, not aspect ratios)
  • quality, response_format (url / b64_json), style: forwarded as supported by the model

Notes

  • Long synchronous request: set the client timeout to ≥ 180 seconds; do not disconnect mid-generation (disconnecting does not cancel it)
  • Returned image URLs expire per upstream policy — download promptly
  • For edits and variations see Image Edits / Variations
  • Model-specific parameters follow each upstream's official docs; the platform performs no rewriting or validation