1. Reference
Fotor OpenAPI
  • Getting Started
    • Introduction
    • Access and Authentication
    • For Serverless Clients
    • Token Consumption
  • Reference
    • Get User Token Balance
      GET
    • Query Task Details
      GET
    • AI Upscaler API
      POST
    • AI Skin Retouch API
      POST
    • Image Generation API
      POST
    • Text to Image API
      POST
    • Image to Image (AI Art Effects) API
      POST
    • Background Remover API
      POST
    • AI Headshot API
      POST
    • Photo Colorize API
      POST
    • Photo Restoration API
      POST
    • AI Replace API
      POST
    • AI Expand API
      POST
    • AI Baby Generator API
      POST
  • Webhook
    • Webhook
  • AI Editor SDK
    • Getting Started
    • Get Sdk Temporary Token
      GET
  1. Reference

Image Generation API

POST
/v1/aiart/imagegeneration/{provider}
The AI Image Generation API allows you to generate images based on a combination of text prompts and reference images.
It supports multi-modal input, enabling scenarios such as character consistency, style transfer, composition guidance, and creative image generation.
With this API, developers can:
Generate new images purely from textual descriptions (e.g., landscapes, portraits, product shots)
Provide reference images to maintain character or object consistency
Combine multiple reference images with prompts for more precise control
Customize the output resolution via width and height parameters
Use smart reference mode (smart_reference) to automatically extract key visual features from the reference image.

Gemini 2.5 Flash Image#

Aspect RatioResolutionTokens
1:11024×10245
2:3832×12485
3:21248×8325
3:4864×11845
4:31184×8645
4:5896×11525
5:41152×8965
9:16768×13445
16:91344×7685
21:91536×6725

Gemini 3 Pro Image (Preview)#

Aspect Ratio1K Resolution1K Tokens2K Resolution2K Tokens4K Resolution4K Tokens
1:11024×1024152048×2048154096×409630
2:3848×1264151696×2528153392×505630
3:21264×848152528×1696155056×339230
3:4896×1200151792×2400153584×480030
4:31200×896152400×1792154800×358430
4:5928×1152151856×2304153712×460830
5:41152×928152304×1856154608×371230
9:16768×1376151536×2752153072×550430
16:91376×768152752×1536155504×307230
21:91584×672153168×1344156336×268830

Seedream 4.0#

ResolutionTokens
Total pixels range: [1280×720, 4096×4096]5

Qwen#

ResolutionTokens
Total pixels range: [1280×720, 2048×2048]3

Request

Path Params

Header Params

Body Params application/json

Example
{
    "content": [
        {
            "type": "text",
            "text": "Subject:\nThe human subject is reimagined as the main character in a cinematic moment, walking a loyal pet companion. Their silhouette is enhanced with soft, dramatic lighting that adds depth, presence, and storytelling. The subject’s features remain natural, recognized, and elevated with movie-grade atmosphere.\n\nOutfit:\nA stylish, film-inspired outfit adapted to the user’s daily-wear vibe — flowing coats, layered sweaters, subtle textures, or minimalist modern clothing depending on the final look. Everything is realistic, grounded, and aesthetically pleasing.\n\nPet:\nA [Dog] walking beside the subject. The pet’s form is natural, expressive, and receives soft directional lighting to match the cinematic tone. The pet behaves calmly, walking close to the subject.\n\nSetting:\nA beautifully cinematic environment such as a quiet evening street, a misty park pathway, a soft golden-hour field, or a lantern-lit city walkway. Warm or cool tones depending on the mood. Light mist, drifting particles, or soft bokeh enhance the storytelling. Nature or city elements glow gently in the background.\n\nCamera / Composition:\n4:5 vertical movie-frame\nMedium-distance shot showing the full walk\nCinematic depth, wide aperture feel, atmospheric haze\nNo text, no watermark"
        },
        {
            "type": "image_url",
            "url": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/ef3f9d2c-aa9b-4a99-96e6-c6c32d11df36.jpg",
            "role": "smart_reference"
        }
    ],
    "width": 841,
    "height": 1152
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api-b.fotor.com/v1/aiart/imagegeneration/gemini-3-pro-image-preview' \
--header 'Authorization: Bearer <your api key>' \
--header 'Content-Type: application/json' \
--data '{
    "content": [
        {
            "type": "text",
            "text": "Subject:\nThe human subject is reimagined as the main character in a cinematic moment, walking a loyal pet companion. Their silhouette is enhanced with soft, dramatic lighting that adds depth, presence, and storytelling. The subject’s features remain natural, recognized, and elevated with movie-grade atmosphere.\n\nOutfit:\nA stylish, film-inspired outfit adapted to the user’s daily-wear vibe — flowing coats, layered sweaters, subtle textures, or minimalist modern clothing depending on the final look. Everything is realistic, grounded, and aesthetically pleasing.\n\nPet:\nA [Dog] walking beside the subject. The pet’s form is natural, expressive, and receives soft directional lighting to match the cinematic tone. The pet behaves calmly, walking close to the subject.\n\nSetting:\nA beautifully cinematic environment such as a quiet evening street, a misty park pathway, a soft golden-hour field, or a lantern-lit city walkway. Warm or cool tones depending on the mood. Light mist, drifting particles, or soft bokeh enhance the storytelling. Nature or city elements glow gently in the background.\n\nCamera / Composition:\n4:5 vertical movie-frame\nMedium-distance shot showing the full walk\nCinematic depth, wide aperture feel, atmospheric haze\nNo text, no watermark"
        },
        {
            "type": "image_url",
            "url": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/ef3f9d2c-aa9b-4a99-96e6-c6c32d11df36.jpg",
            "role": "smart_reference"
        }
    ],
    "width": 841,
    "height": 1152
}'

Responses

🟢200success
application/json
Bodyapplication/json

Example
{
    "code": "000",
    "msg": "success",
    "data": {
        "taskId": "e0dc194703174b6eafeacb4ee8e02850"
    }
}
Modified at 2026-09-21 11:43:23
Previous
AI Skin Retouch API
Next
Text to Image API
Built with