API Endpoint
POST Image Generation API
/api/v1/ai/image-generation
Generate marketing visuals and product creatives from text prompts.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string | Required | Image generation prompt (Max: 4,000 chars) |
style |
string | Optional | Visual style, e.g. "photorealistic", "illustration", "3d_render" |
size |
string | Optional | Output size, e.g. "1024x1024", "1024x1792" |
n |
integer | Optional | Number of images to generate (1 to 4) |
Important Note on Credit Usage
Image Generation is a high-cost endpoint. Your Processing Credits will be multiplied directly by the number of images requested (n) and the requested size. Requesting 4 large images in a single call will consume significantly more credits than a single default-sized image.
Example Request
JSON Request
{
"prompt": "Clean product hero image for a developer API dashboard",
"style": "photorealistic",
"size": "1024x1024",
"n": 2
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/image-generation \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Clean product hero image for a developer API dashboard",
"style": "photorealistic",
"size": "1024x1024",
"n": 2
}'
Example Response
JSON Response
{
"success": true,
"data": {
"result": {
"images": [
"https://ai-storage.rsflowhub.com/generated/img_abc123.png",
"https://ai-storage.rsflowhub.com/generated/img_xyz789.png"
]
}
},
"meta": {
"credits_used": 40,
"credits_remaining": 960
}
}
API Request Example
Use the cURL snippet below to test the endpoint.
cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/image-generation' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Clean product hero image for a developer API dashboard",
"style": "photorealistic",
"size": "1024x1024",
"n": 2
}'