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

Text to Image

POST
/v1/aiart/text2img
The Text2Image feature in Fotor OpenAPI leverages advanced AI technology to transform your textual descriptions into realistic images. Simply input a text description, and the system quickly generates a corresponding image—no design skills required.
This feature supports a variety of styles and templates, offering fine-grained control options to help you effortlessly create diverse and creative visuals.

Key Features#

Easy to Use:
Generate images effortlessly by simply entering a text description, with an intuitive and quick process.
Diverse Styles:
Offers a wide range of artistic styles and templates, including:
Photography
Anime
Oil Painting
3D
And more, to suit various creative needs.
Precise Control:
Supports specifying:
Image dimensions
Template selection
Negative prompts for fine-tuned results
High-Quality Output:
Delivers high-resolution images with rich details, ready for commercial use.
Fast Generation:
Powered by advanced AI algorithms and optimized server architecture, ensuring quick image creation.

Text to Image Styles#

Text to Image Styles

Request

Header Params
Authorization
string 
required

Here, <your_api_key> is the API key you obtained from the Fotor Developer Platform.

Example:
Bearer <your api key>
Body Params application/json
content
string 
required
Describe the content of the image you want to generate, for example, "A cute cat playing on the grass."
sizeId
string 
required
Image dimensions, used to specify the size of the generated image. For example(1:1、4:3、3:4、16:9、9:16)。
templateId
string 
required
Template ID, used to specify the specific style template for the generated image. Refer to the template table for available options.
negativePrompt
string 
optional
Negative prompts are used to describe content you want to avoid in the generated image, such as "blurry" or "distorted." Using negative prompts helps you have better control over the output, preventing unwanted elements from appearing.
Example
{
    "content": "a boy",
    "sizeId": "6361e03bc09cb851c66328a4",
    "templateId": "7b3b1f40-60b0-41df-8280-238baae78c38",
    "negativePrompt": "girl"
}

Request 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 --request POST 'https://api-b.fotor.com/v1/aiart/text2img' \
--header 'Authorization: Bearer <your api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "content": "a boy",
    "sizeId": "6361e03bc09cb851c66328a4",
    "templateId": "7b3b1f40-60b0-41df-8280-238baae78c38",
    "negativePrompt": "girl"
}'

Responses

🟢200success
application/json
Body
code
string 
required
000: Success,999: Unknown error
Example:
000
msg
string 
required
Example:
success
data
object 
required
taskId
string 
required
Task ID, used to query task information.
Example:
e0dc194703174b6eafeacb4ee8e02850
Example
{
    "code": "000",
    "msg": "success",
    "data": {
        "taskId": "e0dc194703174b6eafeacb4ee8e02850"
    }
}
Modified at 2025-06-25 07:51:22
Previous
AI Skin Retouch
Next
Image to Image (AI Art Effects)
Built with