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/generationsParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Image model, e.g. dall-e-3 |
prompt | string | Yes | Text prompt describing the image |
n | integer | No | Number to generate, default 1 |
size | string | No | Size, e.g. 1024x1024 |
quality | string | No | Quality, e.g. standard / hd |
response_format | string | No | url (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.