Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This API extracts information from a given image and user input to generate a detailed prompt description for creating a poster. Note: This API typically requires approximately 15 seconds to process and return a response.
API Endpoint
Headers
formacloud-api-key
string
Yes
API key for authentication
Request Body
user_input
string
Yes
The user’s input text describing requirements (max 200 characters)
referring_image
file
No
The image file to be used for inspiration
referring_image_url
string
No
URL of the image to be used for inspiration
Note: referring_image
and referring_image_url
cannot be provided together.
Example Request
Response
Returns a JSON object containing the generated detailed prompt description.
image_to_prompt
string
Detailed prompt text generated by the API
Example Response
This API expands a given user input into a detailed prompt description suitable for creative tasks such as designing posters, creating advertisements, and more.
API Endpoint
Headers
formacloud-api-key
string
Yes
API key for authentication
Content-Type
string
Yes
Set to application/json
Request Body
user_input
string
Yes
The user’s input text that needs to be expanded
Example Request
Response
A JSON object containing the expanded prompt description.
expanded_prompt
string
Detailed prompt text generated by the API
Example Response
The redraw_image
endpoint allows users to modify or recreate a given image using a specified mask and text prompt. This API is ideal for use cases such as creating customized visuals, refining designs, or replacing specific parts of an image while retaining its original structure.
To redraw an image, send a POST request to the following URL:
POST https://api.genaifactory.ai/v1/redraw_image
formacloud-api-key
string
Yes
API key required for authenticating your request.
The request body should be sent as form-data
and include the following fields:
user_input
string
No
A brief textual description (max 200 characters) for guiding the image redrawing process.
original_image
file
No
The original image file to be redrawn. Must not be provided with original_image_url
.
original_image_url
string
No
URL of the original image to be redrawn. Must not be provided with original_image
.
mask_image
file
No
Mask file specifying areas to be redrawn. Must not be provided with mask_image_url
.
mask_image_url
string
No
URL of the mask file specifying areas to be redrawn. Must not be provided with mask_image
.
Note: Either the file
or the url
must be provided for both the original image and the mask but not both simultaneously.
Asynchronous Response (Status Code 202)
task_id
string
Yes
The ID of the task created for redrawing the image.
tasks_ahead_count
int
Yes
Number of tasks ahead in the queue when this task is created.
estimate_image_time
int
Yes
Estimated time (in seconds) to complete the task based on recent data.
Failure Response (Status Code 4XX or 5XX)
error
string
Yes
A descriptive error message indicating what went wrong with the request.
Using curl
Command
Asynchronous Response
Failure Response
The create_images
endpoint allows you to generate custom-designed images by providing key content elements such as structured texts, free-from texts, logos, and images. This API simplifies the creation of visually appealing images for various use cases, such as marketing materials, announcements, and informational displays.
API Endpoint
To create an image, send a POST
request to the following URL:
POST https://api.genaifactory.ai/v1/create_images
Headers
Ensure that your request includes the following header:
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Request Body
The request body should be sent as form-data and include the following fields.
Name
Type
Required
Description
structured_content
object (JSON in string format)
No
Structured content for the image, including detailed sections like primary information, secondary information, features, button text, and warnings or hints. This should be passed as a string in JSON format.
freeform_content
string
No
Unstructured text content for the image. If provided, this will be used along with structured_content
. Both will be utilized; however, in case of any conflict, Primary Text will take precedence.
logo_image
file
No
The logo image file to be included on the image. This allows you to upload a file for branding the image with a company logo. While there are no specific size or dimension validations during upload, the logo image size will be restricted during usage. In the final rendered image, the logo image's size will not exceed 1/9 of the total image dimensions.
logo_url
string
No
The URL of a logo image to include in the image. Only either logo_image
or logo_url
should be provided.
main_images
file[]
No
One or more main image files that you want to include in the image. Multiple files can be uploaded, with a maximum limit of three main images. If both main_images
and main_image_urls
are provided, the uploaded main_images
will take priority.
There are no specific size or dimension validations during upload. However, when used in the final rendered image, the size of each main_image
will be adjusted to fit within the final output.
main_image_urls
array of strings (JSON in string format)
No
A list of URLs for the main images that should be included in the image. This can be used when image files are not uploaded directly. A maximum of three main images can be included.
There are no specific size or dimension validations for the images provided via URLs. However, when used in the final rendered image, the size of each main image will be adjusted to fit within the final output.
background_image
file
No
A background image file to be used for the image. Only either background_image
or background_image_url
should be provided.
background_image_url
string
No
The URL of a background image to include in the image. This will be used if no background_image
is uploaded.
style
string
No
The style of the image. The options include: "REALISTIC",""CARTOON,"ANIME","OIL_PAINTING","WATERCOLOR","PENCIL_SKETCH","INK_WASH","CHARCOAL","UKIYO_E","POP_ART","PIXEL_ART","VINTAGE","THREE_D_RENDER","CLAY","SURREALISM","SCI_FI","RANDOM".
image_count
int
No
The number of images to generate. Default is 1.
export_svg
boolean
No
If set to true
, the image will be exported as an SVG format. Default is false
.
resolution
string
No
Specifies the resolution of the image. Cannot be used together with width
and height
. Acceptable values are: RESOLUTION_512_1536
, RESOLUTION_576_1408
, RESOLUTION_576_1472
, RESOLUTION_576_1536
, RESOLUTION_640_1024
, RESOLUTION_640_1344
, RESOLUTION_640_1408
, RESOLUTION_640_1472
, RESOLUTION_640_1536
, RESOLUTION_704_1152
, RESOLUTION_704_1216
, RESOLUTION_704_1280
, RESOLUTION_704_1344
, RESOLUTION_704_1408
, RESOLUTION_704_1472
, RESOLUTION_720_1280
, RESOLUTION_736_1312
, RESOLUTION_768_1024
, RESOLUTION_768_1088
, RESOLUTION_768_1152
, RESOLUTION_768_1216
, RESOLUTION_768_1232
, RESOLUTION_768_1280
, RESOLUTION_768_1344
, RESOLUTION_832_960
, RESOLUTION_832_1024
, RESOLUTION_832_1088
, RESOLUTION_832_1152
, RESOLUTION_832_1216
, RESOLUTION_832_1248
, RESOLUTION_864_1152
, RESOLUTION_896_960
, RESOLUTION_896_1024
, RESOLUTION_896_1088
, RESOLUTION_896_1120
, RESOLUTION_896_1152
, RESOLUTION_960_832
, RESOLUTION_960_896
, RESOLUTION_960_1024
, RESOLUTION_960_1088
, RESOLUTION_1024_640
, RESOLUTION_1024_768
, RESOLUTION_1024_832
, RESOLUTION_1024_896
, RESOLUTION_1024_960
, RESOLUTION_1024_1024
, RESOLUTION_1088_768
, RESOLUTION_1088_832
, RESOLUTION_1088_896
, RESOLUTION_1088_960
, RESOLUTION_1120_896
, RESOLUTION_1152_704
, RESOLUTION_1152_768
, RESOLUTION_1152_832
, RESOLUTION_1152_864
, RESOLUTION_1152_896
, RESOLUTION_1216_704
, RESOLUTION_1216_768
, RESOLUTION_1216_832
, RESOLUTION_1232_768
, RESOLUTION_1248_832
, RESOLUTION_1280_704
, RESOLUTION_1280_720
, RESOLUTION_1280_768
, RESOLUTION_1280_800
, RESOLUTION_1312_736
, RESOLUTION_1344_640
, RESOLUTION_1344_704
, RESOLUTION_1344_768
, RESOLUTION_1408_576
, RESOLUTION_1408_640
, RESOLUTION_1408_704
, RESOLUTION_1472_576
, RESOLUTION_1472_640
, RESOLUTION_1472_704
, RESOLUTION_1536_512
, RESOLUTION_1536_576
, RESOLUTION_1536_640
, and RESOLUTION_1248_702
. If not provided, defaults to RESOLUTION_1248_702
.
width
int
No
Specifies the width of the image in pixels. Must be between 192 and 2000 if provided. Cannot be used together with resolution
.
height
int
No
Specifies the height of the image in pixels. Must be between 192 and 2000 if provided. Cannot be used together with resolution
.
create_image_without_text
boolean
No
When set to true
, this parameter instructs the system to generate an image without any text. In this mode, freeform_content
must still be provided, even though it won't appear on the image. structured_content
and any other text-related parameters are optional and will be ignored if provided. However, other non-text-related parameters (like style
, and resolution
) will still be applied to influence the visual style and layout of the image.
Structured Content Object
There are no strict character limits for any of the fields listed below. However, it is recommended to keep the total character count within 300 characters for optimal clarity and readability.
Name
Type
Required
Description
primary_text
string
Yes
The main headline or key information for the image.
secondary_text
string
No
Additional details or supporting information related to the primary info.
features
array of strings
No
A list of features or key points to be highlighted on the image. There is no strict limit on the number of features; however, it is recommended to include three or fewer for optimal clarity and impact.
action_button
string
No
The text for the call-to-action button on the image.
corner_hints
array of strings
No
A list of small hints or warning messages to be displayed on the corners of the image.There is no strict limit on the number of corner_hints; however, it is recommended to include two or fewer for optimal clarity and impact.
Response Body
Asynchronous Response (Status Code 202)
Name
Type
Required
Description
task_id
string
Yes
The ID of the task that was created. You can use this ID to retrieve the image generation results at a later time.
tasks_ahead_count
int
Yes
The number of tasks ahead of it will be returned from the time a task is created until it is executed
estimate_image_time
int
Yes
The estimated time in seconds for the task to be executed based on recent task performance data.
Failure Response (Status Code 4XX or 5XX)
Name
Type
Required
Description
error
string
Yes
A descriptive error message indicating what went wrong with the request.
Example Structured_content Request
Example Freeform_content Request
Example Create background image Request
Example Asynchronous Response
Example Failure Response
The image_history
endpoint allows you to query the history of image creation, including the input parameters, creation time, and response results (both successful and failed) within a specified period. This endpoint supports pagination to navigate through large sets of historical data.
API Endpoint
To retrieve the image creation history, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/image_history
Headers
Ensure that your request includes the following header:
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Query Parameters
You can use the following query parameters to specify the time period, pagination, and other details for retrieving the image history:
Name
Type
Required
Description
start
string
No
The start date of the history retrieval period in UTC (e.g., 2023-01-01T00:00:00Z
).
end
string
No
The end date of the history retrieval period in UTC (e.g., 2023-01-31T23:59:59Z
).
page_size
int
No
The maximum number of records to retrieve per page (default: 10).
page
int
No
The page number to retrieve (default: 1).
Response Body
The response will include a list of image creation records, each containing the following details:
Name
Type
Required
Description
create_time
string
Yes
The time when the image was created, in UTC.
input_parameters
object
Yes
The input parameters used for creating the image, including struct_content
, logo_url
, main_image_url
, and image_count
.
response_result
object
Yes
The response result of the image creation, including the success or failure response.
Example Request
Example Response
Success Response (Status Code 200)
Failure Response (Status Code 4XX)
Moonveil redefines text-to-image generation with its proprietary model, offering unparalleled 100% text accuracy in outputs. Our platform caters to all users: casual creators can export PNGs, while professionals enjoy SVG options for easy editing. With a powerful API for enterprise integration and AI-driven free-form input alongside customizable parameters, Moonveil combines precision with user-friendliness. Whether you're a hobbyist or a business professional, Moonveil is your go-to solution for turning text into stunning, accurate visuals.
Added the Redraw Image
API to allow redrawing original image.
Added the Export Image as SVG
API to allow exporting a task's output image as an SVG.
Added the estimate_image_time
parameter to the response schema. This parameter provides an estimated execution time (in seconds) for the task based on recent task performance data.
Added a note to the "Image to Prompt" API documentation indicating that this API typically requires approximately 15 seconds to return a response.
Added width
and height
parameters for Create Images
API.
Added Retrieve Recharge History
API.
Supported 16 image sytles. https://moonveil.ai/app/styles
Enabled the "Create Image without Text" feature in the Create Images API.
The get_image_result
endpoint allows you to retrieve the final result of a image generation task that was processed asynchronously. By providing the task ID returned from the create_images
endpoint when async
was set to true
, you can check the status of the task and obtain the generated images once the task is complete.
API Endpoint
To retrieve the image generation result, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/get_image_result/{task_id}
Headers
Ensure that your request includes the following header:
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Path Parameters
Name
Type
Required
Description
task_id
string
Yes
The ID of the task you received when you initially made the asynchronous request.
Response Body
Success Response (Status Code 200)
If the task has completed successfully, the response will include the generated images:
Name
Type
Required
Description
images
array of strings
Yes
A list of URLs pointing to the generated images in PNG format. Each URL corresponds to a generated image.
svg_images
array of strings
Yes
A list of URLs pointing to the generated images in SVG format. Each URL corresponds to a generated image.
Pending Response (Status Code 201)
If the task is still in queue, the response will indicate that the task does not start:
Name
Type
Required
Description
status
string
Yes
A message indicating that the task is still processing.
tasks_ahead_count
int
Yes
The number of tasks ahead of it will be returned from the time a task is created until it is executed
Running Response (Status Code 202)
If the task is still in progress, the response will indicate that the task is not yet complete:
Name
Type
Required
Description
status
string
Yes
A message indicating that the task is still processing.
images
array of strings
No
A list of URLs pointing to the generated images in PNG format. Each URL corresponds to a generated image. The images are currently retained for a maximum duration of one month.
svg_images
array of strings
No
A list of URLs pointing to the generated images in SVG format. Each URL corresponds to a generated image. The images are currently retained for a maximum duration of one month.
Failure Response (Status Code 4XX)
If there is an issue with the request, such as an invalid task ID, the response will include an error message:
Name
Type
Required
Description
error
string
Yes
A descriptive error message indicating what went wrong with the request.
images
array of strings
No
A list of URLs pointing to the generated images in PNG format. Each URL corresponds to a generated image.
svg_images
array of strings
No
A list of URLs pointing to the generated images in SVG format. Each URL corresponds to a generated image.
Example Request
Example Successful Response
Example Pending Response
Example Failure Response
This API retrieves or generates an SVG version of the output image for a specific task ID. The response includes the SVG URL of the requested image.
formacloud-api-key
string
Yes
API key for authentication.
seq
integer
No
Sequence number of the output image (default is 0).
task_id
string
Yes
The unique ID of the task to export the SVG for.
Returns a JSON object containing the SVG URL of the requested image.
Response Fields
svg_url
string
URL of the exported SVG image.
Example Response
404
TaskNotFoundError
The specified task ID does not exist.
400
InvalidInputError
The input is invalid (e.g., seq
out of range).
400
InvalidInputError
Task is not a valid POSTER
type.
The recharge_history
endpoint allows you to query the history of recharge transactions for an organization. It includes details such as the recharge amount, bonus amount, payment method, transaction ID, and creation time. This endpoint supports pagination to efficiently navigate through historical records.
To retrieve recharge history, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/recharge_history
Ensure that your request includes the following header:
You can use the following query parameters to specify the time period, pagination, and other details for retrieving the recharge history:
The response will include a list of recharge records and pagination details. Each recharge record contains the following information:
Success Response (Status Code 200)
Failure Response (Status Code 4XX)
The image_metrics
endpoint allows you to query the performance, costs, and other metrics related to the creation of images within a specified period. This information can help you evaluate the effectiveness and resource usage of the image creation process over time.
API Endpoint
To retrieve the metrics, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/image_metrics
Headers
Ensure that your request includes the following header:
Query Parameters
You can use the following query parameters to specify the time period for which you want to retrieve metrics:
Response Body
The response will include the following metrics related to image creation within the specified period:
Example Request
Example Response
Success Response (Status Code 200)
Failure Response (Status Code 4XX)
The Retrieve credit
endpoint allows you to check the total amount of credit available and how much has been used. This is useful for monitoring your API usage and ensuring you have sufficient credit for future tasks.
API Endpoint
To retrieve your credit information, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/credit
Headers
Ensure that your request includes the following header:
Response Body
The response will provide details about your credit usage:
Example Request
Example Response
Success Response (Status Code 200)
Failure Response (Status Code 4XX)
The image_costs
endpoint allows you to retrieve a breakdown of the costs associated with image generation tasks, including cloud compute costs, LLM token costs, image generation costs, and more. This endpoint supports pagination for navigating large sets of historical task data.
To retrieve image generation costs, send a GET
request to the following URL:
GET https://api.genaifactory.ai/v1/image_costs
Ensure that your request includes the following header:
You can use the following query parameters to specify pagination details for retrieving image cost history:
The response will include a list of image generation cost records, each containing the following details:
Example Request
Example Response
Success Response (Status Code 200):
Failure Response (Status Code 4XX):
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Name
Type
Required
Description
start
string
No
The start date of the history retrieval period in UTC (e.g., 2023-01-01T00:00:00Z
).
end
string
No
The end date of the history retrieval period in UTC (e.g., 2023-01-31T23:59:59Z
).
page_size
int
No
The maximum number of records to retrieve per page (default: 10).
page
int
No
The page number to retrieve (default: 0).
Name
Type
Required
Description
recharge_id
int
Yes
The unique identifier of the recharge record.
recharge_amount
decimal
Yes
The amount of money recharged.
bonus_amount
decimal
No
The bonus amount received during the recharge.
payment_method
string
No
The payment method used for the recharge (e.g., Credit Card
).
transaction_id
string
Yes
The unique transaction ID for the recharge.
note
string
No
Additional notes about the recharge.
recharge_time
string
Yes
The time when the recharge occurred, in UTC.
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Name
Type
Required
Description
start
string
No
The start date of the metrics collection period in UTC (e.g., 2023-01-01T00:00:00Z
).
end
string
No
The end date of the metrics collection period in UTC (e.g., 2023-01-31T23:59:59Z
).
Name
Type
Required
Description
total_images
int
Yes
The total number of images created within the specified period.
total_cost
number
Yes
The total cost associated with creating the images within the specified period.
average_time
number
Yes
The average time taken to create each image within the specified period, in seconds.
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Name
Type
Required
Description
start
string
No
The start date of the history retrieval period in UTC (e.g., 2023-01-01T00:00:00Z
).
end
string
No
The end date of the history retrieval period in UTC (e.g., 2023-01-31T23:59:59Z
).
page_size
int
No
The maximum number of records to retrieve per page (default: 10).
page
int
No
The page number to retrieve (default: 1).
task_id
int
Yes
Unique identifier of the image generation task.
poster_count
int
No
The number of posters created in the task.
task_status
string
Yes
Status of the task (e.g., SUCCESS, FAILED).
creation_time
string
Yes
The time when the image generation task was created (in UTC).
end_time
string
No
The time when the image generation task was completed (in UTC), if applicable.
total_cost
float
Yes
The total cost of the task.
error_msg
string
No
Error message associated with the task, if it failed.
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key required for authenticating your request.
Name
Type
Required
Description
total_credit
number
Yes
The total amount of credit allocated for tasks.
used_credit
number
Yes
The amount of credit used by tasks.