Skip to content
RSFlowHub
  1. Home
  2. APIs
  3. Image & Vision
  4. AI Image Generation API
Image & Vision API

AI Image Generation API

Turn text prompts into visuals and mockups. You only pay for images that are actually generated.

POST https://rsflowhub.com/api/v1/ai/image-generation
  • 120 credits per call
  • X-API-Key header
  • JSON in, JSON out
POST /api/v1/ai/image-generation
{
    "prompt": "A futuristic city skyline at sunset, cyberpunk style.",
    "size": "1024x1024"
}
200 OK response.json
{
    "result": {
        "images": [
            {
                "url": "https://rsflowhub.com/storage/generated/20261019/img_7c1e9a40d2b84f63a1c5e8d07b9f2a6c41de3b58.jpg",
                "mime_type": "image/jpeg",
                "width": 1024,
                "height": 1024,
                "expires_at": "2026-10-26T10:30:00+00:00"
            }
        ]
    }
}
Definition

What is the AI Image Generation API?

AI Image Generation API is a REST API on RSFlowHub for web, mobile and AI agent applications. Send a JSON request to POST /api/v1/ai/image-generation with your API key; RSFlowHub runs it on a tuned AI model, falls back to a backup provider if needed, and returns a structured JSON result, usually within 1 to 3 seconds.

Endpoint
POST /api/v1/ai/image-generation
Authentication
X-API-Key header
Price
120 credits per call
Rate limit
10 to 120 requests / minute by plan
Typical response
1 to 3 seconds
Format
JSON, UTF-8

Request parameters

Send these fields as a JSON body. An invalid or missing field returns a 422 error that names the field.

FieldTypeRequiredDescription
prompt string Required Image generation prompt (Max: 4,000 chars)
style string Optional Visual style, e.g. "photorealistic", "illustration", "3d_render"
aspect_ratio string Optional Image shape: "1:1", "3:2", "2:3", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9" or "21:9". Default is "1:1".
size string Optional Older way to pick the shape, e.g. "1024x1024" or "1024x1792": mapped to the closest aspect ratio. Images are always about 1 megapixel. Ignored when aspect_ratio is set.
n integer Optional Number of images to generate (1 to 4). Each generated image is billed separately.

Code examples

Copy, replace rfh_your_api_key with your key and run. Prefer a client library? See the official SDKs.

request.sh
curl -X POST "https://rsflowhub.com/api/v1/ai/image-generation" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: rfh_your_api_key" \
  -d '{"prompt":"A futuristic city skyline at sunset, cyberpunk style.","size":"1024x1024"}'

Response

Every RSFlowHub endpoint uses the same envelope, so one parser handles all of them. Failed calls are not charged.

response.json
{
    "success": true,
    "request_id": "req_3f9a2c7e-5b1d-4e8a-9c2f-7d6e1a0b4c8d",
    "data": {
        "result": {
            "images": [
                {
                    "url": "https://rsflowhub.com/storage/generated/20261019/img_7c1e9a40d2b84f63a1c5e8d07b9f2a6c41de3b58.jpg",
                    "mime_type": "image/jpeg",
                    "width": 1024,
                    "height": 1024,
                    "expires_at": "2026-10-26T10:30:00+00:00"
                }
            ]
        }
    },
    "meta": {
        "version": "v1",
        "timestamp": "2026-10-05T09:30:00Z"
    }
}
Envelope fields
FieldTypeMeaning
successbooleantrue when the call worked, false on any error.
request_idstringUnique id for this call. Quote it when you contact support.
data.resultobjectThe result of this endpoint (see the example).
errorobjectOnly on failure: code, message and details per field.
metaobjectAPI version and server timestamp.

All error codes: Errors reference

Features

Photorealistic & Vector Styling

Render photorealistic photos, 3D renders, cyberpunk art, or minimalist vector illustrations on demand.

Custom Aspect Ratios & Resolutions

Generate assets in 1:1 (square), 16:9 (landscape), 9:16 (mobile story), 4:3, 3:2, 21:9 and more, at about 1 megapixel (1024x1024 for square).

Safety Filter Built In

Prompts blocked by the safety filter return HTTP 422 CONTENT_BLOCKED and cost no credits.

Ready-to-use Image URLs

Each image comes back as an HTTPS URL with its size, type and expiry time. Download it within 7 days.

Use cases

How teams use the AI Image Generation API in production.

Publishing & Media

Dynamic Blog & Article Header Art

Generate bespoke header visuals matching article topics upon content publication.

Input
Editorial illustration of a high-speed neural network routing data packets across servers.
Output
https://rsflowhub.com/storage/generated/img_8f9a2b1c.jpg

Creates unique article images without stock photo licensing.

E-Commerce

E-Commerce Product Mockup Staging

Stage products into realistic lifestyle backgrounds (e.g., modern living room, kitchen table).

Input
Coffee mug placed on a rustic wooden desk with warm morning sunlight.
Output
https://rsflowhub.com/storage/generated/img_mug_lifestyle.jpg

Accelerates product merchandising without booking expensive studio photo sessions.

Social Advertising

Social Media Ad Variant Generation

Produce 10+ visual creative variations for Facebook and Instagram A/B ad testing.

Input
SaaS dashboard preview with glowing neon charts on dark glass background.
Output
https://rsflowhub.com/storage/generated/img_ad_variant_3.jpg

Decreases customer acquisition costs (CAC) by identifying winning visual creatives.

AI Image Generation API vs building it yourself

The same job done three ways.

TopicRSFlowHub APIRaw LLM promptsRules / regex
Output Validated JSON fieldsFree text you have to parseFixed patterns only
Setup One POST request, no promptsWrite and maintain prompts and parsingWrite and maintain rule lists
Provider outage Automatic fallback to a backup modelYou build retries and a second vendorNot applicable
Pricing 120 credits per call, failed calls freePer token, per vendorYour own servers and upkeep
Understands context Yes, AI modelYes, AI modelNo, keywords only

Frequently asked questions

What image formats and resolutions are returned by the API?
Each image is returned as an HTTPS URL to an image file (usually JPEG; the response gives its mime_type) of about 1 megapixel (1024x1024 for 1:1, other aspect ratios keep a similar pixel count). URLs stay available for 7 days, so download and store the images you want to keep.
How long does image generation take?
Usually a few seconds per call. When you ask for several images they are generated in parallel. Set your HTTP client timeout to at least 60 seconds.
Who owns the images generated through the API?
RSFlowHub does not claim ownership of images you generate. You are responsible for how you use them under our Terms. Generated images carry an invisible digital watermark that marks them as AI-generated.
What happens if a prompt violates safety filters?
The request returns HTTP 422 with the error code CONTENT_BLOCKED and no credits are charged.
How many credits does an image generation call consume?
150 credits per generated image, plus 1 credit per image for every 1,000 prompt characters. If you ask for 4 images and only 3 are generated, you pay for 3. Image generation needs a paid plan.

Start using the AI Image Generation API

Free plan with 100 credits/month + 1,000 bonus credits when you sign in before 23 Nov. Test it in the playground first, no code needed.

RSFlowHub

Sign in to continue

You'll come straight back to this page.

Forgot password?

New to RSFlowHub? Create a free account