Skip to content

Generate Images (OpenAI Native Format)

Generate images from a text prompt. See also Edit images; as well as the Gemini native format and Qwen native format.

Endpoint

POST /v1/images/generations

Parameters

ParameterTypeRequiredDescription
modelstringYesImage model, e.g. dall-e-3
promptstringYesText prompt describing the image
nintegerNoNumber to generate, default 1
sizestringNoSize, e.g. 1024x1024
qualitystringNoQuality, e.g. standard / hd
response_formatstringNourl (default) or b64_json

Request

bash
curl https://ai.youqi.tech/v1/images/generations \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A white fox running under a starry sky, photorealistic",
    "size": "1024x1024",
    "n": 1
  }'

Response

json
{
  "created": 1715367049,
  "data": [
    { "url": "https://.../generated-image.png" }
  ]
}

TIP

Supported size and quality vary by model. When response_format is url, the returned link is temporary — download and store it promptly.