≡ 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/generations

Request Parameters

ParameterTypeRequiredDescription
modelstringRequiredImage model ID, e.g. cogview-4, flux-1.1-pro, dall-e-3
promptstringRequiredImage prompt, in English or Chinese, up to 1000 characters
nintegerOptionalNumber of images to generate, in [1, 4], default 1
sizestringOptionalImage size, e.g. 1024x1024, 1792x1024, 1024x1792
qualitystringOptionalQuality level, standard or hd, default standard
response_formatstringOptionalReturn 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 →