≡ All docs
Model API / Image Generation
Image Generation
Updated: 2026-05-11
Overview
Generate images from a text prompt, compatible with the OpenAI Images API. Supports multiple sizes and quality options, and can produce 1–4 images.
POST
/images/generationsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Image model ID, e.g. cogview-4, flux-1.1-pro, dall-e-3 |
| prompt | string | Required | Image prompt, in English or Chinese, up to 1000 characters |
| n | integer | Optional | Number of images to generate, in [1, 4], default 1 |
| size | string | Optional | Image size, e.g. 1024x1024, 1792x1024, 1024x1792 |
| quality | string | Optional | Quality level, standard or hd, default standard |
| response_format | string | Optional | Return format, url or b64_json, default url |
Example
cURL
curl -X POST "https://www.starunion.net/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cogview-4",
"prompt": "A silver wolf running under the moonlight, ink wash painting style",
"size": "1024x1024",
"n": 1
}'Response Format
JSON
{"created": 1708502400,"data": [{"url": "https://cdn.starunion.net/images/abc123.png","revised_prompt": "A silver wolf running under the moonlight, ink wash painting style"}]}
Didn't find what you were looking for?Contact us →