Image Generations
Generate images from text prompts using DALL-E, GPT-Image, and more.
Generate images from a text prompt. The endpoint mirrors OpenAI's
images.generate so any OpenAI SDK works out of the box - just point
baseURL at https://api.aivene.com/v1.
POST /v1/images/generationsAuthentication
AuthorizationBearerrequiredAPI key as bearer token in the Authorization header. Create keys at
Manage API Keys.
Headers
Content-TypestringrequiredMust be application/json.
Body
promptstringrequiredText description of the image to generate. Be specific and detailed for best results.
modelstringrequiredImage model id from GET /v1/models. Example: dall-e-3, gpt-image-1,
flux-pro.
nintegeroptionalDefault 1Number of images to generate. Some models only support 1.
sizestringoptionalDefault 1024x1024Output dimensions. Available sizes depend on the model.
256x256512x5121024x10241792x10241024x1792qualitystringoptionalDefault standardImage quality. hd produces finer details (DALL-E 3). low, medium,
high for gpt-image-1.
standardhdlowmediumhighstylestringoptionalDefault vividVisual style. vivid is more dramatic, natural is more realistic.
Only supported by DALL-E 3.
vividnaturalbackgroundstringoptionalBackground transparency. Only supported by gpt-image-1.
transparentopaqueautoresponse_formatstringoptionalDefault urlurl returns a temporary URL (valid ~1 hour), b64_json returns inline
base64 data.
urlb64_jsonuserstringoptionalEnd-user identifier for abuse tracking. safety_identifier is accepted
as an alias.
URL expiration
URLs returned with response_format: 'url' expire after approximately 1 hour.
Download and store images promptly, or use b64_json for persistence.
Response
createdintegeroptionalUnix timestamp (seconds) when the images were generated.
dataImage[]optionalArray of generated images. Each contains either url or b64_json
depending on response_format, plus revised_prompt if the model
rewrote your prompt.
Example
curl https://api.aivene.com/v1/images/generations \
-H "Authorization: Bearer $AIVENE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dall-e-3",
"prompt": "A serene Japanese garden with cherry blossoms in spring",
"n": 1,
"size": "1024x1024",
"quality": "hd"
}'Response:
{
"created": 1715000000,
"data": [
{
"url": "https://...",
"revised_prompt": "A tranquil Japanese garden featuring blooming cherry blossom trees..."
}
]
}Model comparison
| Model | Sizes | Quality | Notes |
|---|---|---|---|
dall-e-3 | 1024x1024, 1792x1024, 1024x1792 | standard, hd | Best for artistic images, auto-rewrites prompts |
dall-e-2 | 256x256, 512x512, 1024x1024 | standard | Faster, cheaper, no prompt rewriting |
gpt-image-1 | 1024x1024, 1536x1024, 1024x1536, auto | low, medium, high | Transparent backgrounds, inpainting |
Errors
All errors follow the OpenAI structured shape:
{ "error": { "type": "invalid_request_error", "message": "..." } }| Status | error.type | Meaning |
|---|---|---|
400 | invalid_request_error | Schema violation or content policy rejection. |
401 | authentication_error | Missing or invalid API key. |
402 | billing_error | Account out of credit or hit a spend limit. |
403 | permission_error | Key lacks the required scope. |
429 | rate_limit_error | RPM exceeded. Respect Retry-After. |
500 | internal_server_error | Unexpected gateway failure. Safe to retry. |
502 / 503 | upstream_error | Downstream provider failure. |