No Data

Getting Started

Our ImgCreator Image Editing API is a fast and efficient API that allows you to remove backgrounds, generate background, segment images, and 'AI photoshop' images in batch, which save hundreds of hours for everyone.

Quick start

Get your API Key

To get started you need first to activate the API for your account and get your API key by following this link.

Make your first HTTP Call

Swap anything of any image by running the following code in your terminal:

curl --request POST \
  --url https://open-api.zmo.ai/open/swap/anything/genSegImg \
  --header 'Content-Type: application/json' \
  --header 'accessKey: eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI5ZTI1NjU0ZDYwYzY0MDhlYjE1NGQ2ZjhjZGM5Yjg1NSIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSLEdST1VQX0FETUlOLFNZU19BRE1JTiIsImdyb3VwSWQiOiJhYmUyNzIwYjBhYTU0ZTFjOWVlNGQ0MzNkNTc0NjYzYiIsImV4cCI6MTY4OTc1NjczMn0.LnsMwrH_Bvz17e_dj_BLYwcKRLesCoXHm72x16-kqHtnoYKU4cVwYITJf4DQvSEaq5XV_ksa4WjZ1LntU2gT' \
  --data '{
    "originalImgUrl": "https://assets.imgcreator.ai/ui/img-creator-pc/examples/mask_variation/preview/1.webp"
}'

For more details for each API, please go to specific API section in below to find out more details.

Support and Help

Community Support

Ask our engineers in our community forum about how to use the ImgCreator API:

Join our Discord Community

Support for billing and payment issues

Contact us at support@zmo.com to get help on usage or payments.

Background Generation Ref Image API - English

Intro

The ImgCreator Background Generation Ref Image API uses Generative AI to instantly create realistic, professional-grade images. A reference background image needs to be provided for each product image, so AI will generate exactly what you needs for realistic product background. By integrating this API, you can save on photography costs and accelerate your time to market for product and marketing campaign launches.

Request

Basic
HTTP URL : https://open-api.zmo.ai/open/background/generate
HTTP method : POST

Request header

name type required describe
accessKey string yes value format:"accessKey" example value:

"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0OTAyYWJkMThjNGU0MjU4ODcyYjQzMTg5ODNiMDhiZiIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSIiwiZ3JvdXBJZCI6IjY1NmRjOTU4YmFjMTQ5NDY4Mjc3YmFjNDE0ZDQ4OTUwIn0.772ElUyM9wKMHvCveKliwmNndIMiJ6y9D5RU5N6tBPEAGsFhkLaEmML_FMgiet4SI3kL3jJv5m0zdmJf_9tWyw"

obtain on the platform
Content-Type string yes fixed value:"application/json; charset=utf-8"

Query parameters

name type required describe
scale String yes resolution scale example '1:1‘ '9:16' '4:3'
imageWeight Integer yes Image reference degree, the larger the value, the more like the original image, range from 0-100, example 50, range from 0-100, example 50
originalImage String yes prototype image example https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-25/16876784673968PDeqXHv_QOewPwoEzbPh1687678465401.png
referenceImg String yes background imagehttps://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-25/16876785349446wj1IhzO5sKLe4e8gN2Cq1687678534664.png

Example of request body

{
	"scale": "4:3",
	"imageWeight": 30,
	"originalImage": "https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-25/16876784673968PDeqXHv_QOewPwoEzbPh1687678465401.png",
	"referenceImg": "https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-25/16876785349446wj1IhzO5sKLe4e8gN2Cq1687678534664.png"
}

Response

Body of Response

Item Type Description
code string API response code
error_message string Error message, details see error_message
message
original
string original image
hqPreview
string high definition preview
success bool true = request successful

Response Example

{
	"code": "200",
	"error_message": "",
	"message": {
		"hqPreview": "https://image.imgcreator.ai/photoroom/bc84221fa145464ca67f8925441588f3/hq/Ref Image/f4154e4e-133d-11ee-bcc0-0242ac110007.webp",
		"original": "https://image.imgcreator.ai/photoroom/bc84221fa145464ca67f8925441588f3/ori/Ref Image/f4155682-133d-11ee-bcc0-0242ac110007.jpg"
	},
	"success": true
}

Instructions

Code Description error_message How to fix
200 Success
401 Token validation error Unauthorized Verify token
402 Out of credits No enough credits recharge
429 Tow many requests TOW MANY REQUESTS limited flow,Reduce request
500 Internal service error nothing
1000 Scale resolution incorrect scale error. The scale must be '"1:1"','"9:16"','"4:3" Currently only 1:1 4:3 9:16 supported
1001 imageWeight wrong value imageWeight error Make sure range is integer between 0 to 100
1002 originalImage or referenceImg error originalImage url error incorrect or invalid request path/url
1004 Background remove failed/error rebmbgError
1006 Preview generated failed, task not in queue Generation failed. Please try again retry
1007 Content policy violation Your input may not meet our content policy Please check uploaded images for possible sensitive or adult content
1008 Preview geneartion timed out (180s) generate time out The task will time out after 180 seconds, please try again

Remove Background Api

Intro

The Remove Background API enables image background removal in seconds. Integrate the #1 background removal functionality into websites and applications, automating the process of image background object isolation, saving time, effort and streamlining editing costs and workflows.

Request

Basic
HTTP URL : https://open-api.zmo.ai/open/background/removePicture
HTTP method : POST

Request header

name type required describe
name type required describe
accessKey string yes value format:"accessKey" example value:

"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0OTAyYWJkMThjNGU0MjU4ODcyYjQzMTg5ODNiMDhiZiIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSIiwiZ3JvdXBJZCI6IjY1NmRjOTU4YmFjMTQ5NDY4Mjc3YmFjNDE0ZDQ4OTUwIn0.772ElUyM9wKMHvCveKliwmNndIMiJ6y9D5RU5N6tBPEAGsFhkLaEmML_FMgiet4SI3kL3jJv5m0zdmJf_9tWyw"

obtain on the platform
Content-Type string yes fixed value:"application/json; charset=utf-8"

Query parameters

name type required describe
name type required describe
originalImage String yes "originalImage": "https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-12/1686565822073GlRD4reh5AmaKDhEmVs7C"

Example of request body

{
	"originalImage": "https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/dalle/2023-06-12/1686565822073GlRD4reh5AmaKDhEmVs7C"
}

Response

Body of Response

Item Type Description
code string API response code
error_message string Error message, details see error_message
message string Cutout result URL
success bool true = request successful

Response Example

{
	"code": "200",
	"error_message": "",
	"message": "https://zmo-image.oss-accelerate.aliyuncs.com/removeBg/2023-07-02/1686565822073GlRD4reh5AmaKDhEmVs7C.png",
	"success": true
}

Instructions

Code Description error_message How to fix
200 Success
401 Token validation error Unauthorized Verify token
402 Out of credits No enough credits recharge
429 Tow many requests TOW MANY REQUESTS limited flow,Reduce request
500 Internal service error nothing
1002 originalImage or referenceImg error originalImage url error incorrect or invalid request path/url
1003 Background remove failed Generation failed. Please try again Try again
1005 Background removal timed out rebmbgError time out The task will time out after 30 seconds, please resubmit request

Query Credits Api

Intro

Query account credits

Request

Basic
HTTP URL : https://open-api.zmo.ai/open/account/credits
HTTP method : GET

Request header

name type required describe
name type required describe
accessKey string yes value format:"accessKey" example value:

"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI5NjViOTVhNDFlYmM0MTQ2YjczNGYyZTM1Y2Y0ODMwMCIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSIiwiZ3JvdXBJZCI6ImQyODQ3NWY0ZGQ4NDQ5NWRhNmI0YmMyMzM2ODkwNzg2IiwianRpIjoiZTA4ZmFjYzAtOTgzOS00YTQ4LWJkODItYjViNTRmMWJkZGFlIn0.yuOROTZX0Ssk4h1UWtR7okfPNfjQ9L0OCkfswcxE6jfN3rUaknFdO50OsyUygpmmhwsZpmFjT-QYe9bu8ZfDOg"

obtain on the platform
Content-Type string yes fixed value:"application/json; charset=utf-8"

Response

Body of Response

Item Type Description
code string API response code
error_message string Error message, details see error_message
enablePoint number Credits
success bool true = request successful

Response Example

{
  "code": "200",
  "error_message": "",
  "message": {
    "enablePoint": 100
  },
  "success": true
}

Instructions

Code Description error_message How to fix
200 Success

Swap Anything Open Api

Intro

The ImgCreator Swap Anything Generation API can "AI photoshop" any image, with a single click. It allows user just select the mask area they hope to edit, and seamlessly edit the photo just using text description. After implementing the Image Segmentation API, you can get the mask selected and a detailed text description, which will be the input to Swap Anything Generation API and output desired 'AI photoshop' results to you in seconds. Now you can quickly apply all the edits to bunch of images in batch.

Part 1.Segment Image API

1.1 Request

Basic
HTTP URL: https://open-api.zmo.ai/open/swap/anything/genSegImg
HTTP method: POST

Request Headers

name type required describe
accessKey string yes value format:"accessKey" example value:

"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0OTAyYWJkMThjNGU0MjU4ODcyYjQzMTg5ODNiMDhiZiIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSIiwiZ3JvdXBJZCI6IjY1NmRjOTU4YmFjMTQ5NDY4Mjc3YmFjNDE0ZDQ4OTUwIn0.772ElUyM9wKMHvCveKliwmNndIMiJ6y9D5RU5N6tBPEAGsFhkLaEmML_FMgiet4SI3kL3jJv5m0zdmJf_9tWyw"

obtain on the platform
Content-Type string yes Fixed value: "application/json"

Query parameters

name type required describe
originalImgUrl string yes Original image link, example.:https://assets.imgcreator.ai/ui/img-creator-pc/examples/mask_variation/preview/1.webp

Example of Request Body

{
  "originalImgUrl": "https://assets.imgcreator.ai/ui/img-creator-pc/examples/mask_variation/origin/1.webp"
}

1.2 Response

Response Body

Field Type Description
code string Api Status Code
error_message string Error Message
message
imageId
string Image ID,eg:"64a929df65bcb332e9673247"
original
string The image link processed by Segment, for example:https://image.imgcreator.ai/ImgCreator/5a501437bfff4e64ad45bdc7736e9160/ori/image.png.png
taskId
string Task ID,Example:"5a501437bfff4e64ad45bdc7736e9160"
success boolean Description of whether the request was successful or not

Example of Response Body

{
  "code": "200",
  "error_message": "",
  "message": {
    "imageId": "64a929df65bcb332e9673247",
    "original": "https://image.imgcreator.ai/ImgCreator/5a501437bfff4e64ad45bdc7736e9160/ori/image.png.png",
    "taskId": "5a501437bfff4e64ad45bdc7736e9160"
  },
  "success": true
}

1.3 Instructions

Code Description **error_message** **How to fix**
200 Success
401 Token validation error Unauthorized Verify token
402 Out of credits No enough credits recharge
429 Tow many requests TOW MANY REQUESTS limited flow, Reduce request
500 Internal service error nothing
106 Preview generated failed, task not in queue Generation failed. Please try again retry
107 Content policy violation Your input may not meet our content policy Please check uploaded images for possible sensitive or adult content
108 Preview geneartion timed out (180s) generate time out The task will time out after 180 seconds, please try again

Part 2. Swap Anything Generation API

2.1 Request

Basic
HTTP URL: https://open-api.zmo.ai/open/swap/anything/genFinProdImg
HTTP method: POST

Request Headers

name type required describe
accessKey string yes value format:"accessKey" example value:

"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0OTAyYWJkMThjNGU0MjU4ODcyYjQzMTg5ODNiMDhiZiIsImF1dGhLZXkiOiJTVEFOREFSRF9VU0VSIiwiZ3JvdXBJZCI6IjY1NmRjOTU4YmFjMTQ5NDY4Mjc3YmFjNDE0ZDQ4OTUwIn0.772ElUyM9wKMHvCveKliwmNndIMiJ6y9D5RU5N6tBPEAGsFhkLaEmML_FMgiet4SI3kL3jJv5m0zdmJf_9tWyw"

obtain on the platform
Content-Type string yes Fixed value: "application/json"

Query Parameters

name type required describe
originalImgUrl string yes Original image link, example.:https://assets.imgcreator.ai/ui/img-creator-pc/examples/mask_variation/preview/1.webp
maskedImgUrl string yes Image link with marked region.,Example:https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/selected-mask-variation/2023-07-08/1688800377399t2QV2AndVov1bf2pLA4pz1688800374391.webp
subject string optional A prompt to generate an image, Eg:"beautiful girl wears blue dress"
resolution string yes Image Resolution,Eg:"1024x1024" or "2048x2048"
numOfImages int yes Number of generated images,Default value 1, Valid value 1 or 2
categoryId string yes Category ID,Fixed value:categoryId="813d6b83c1c34686beb84d4d3ad02d3b"
imageWeight int yes Image reference degree, the larger the value, the more like the original image, range from 0-100, example 50, range from 0-100, example 50

Example of Request Body

{
  "originalImgUrl": "https://assets.imgcreator.ai/ui/img-creator-pc/examples/mask_variation/origin/1.webp",
  "maskedImgUrl": "https://zmo-image.oss-accelerate.aliyuncs.com/frontend-upload/selected-mask-variation/2023-07-08/1688800377399t2QV2AndVov1bf2pLA4pz1688800374391.webp",
  "subject": "beautiful girl wears blue dress",
  "resolution": "1024x1024",
  "numOfImages": 2,
  "categoryId": "813d6b83c1c34686beb84d4d3ad02d3b",
  "imageWeight": 50
}

2.2 Response

Response Body

Item Type Description
code string Api Status Code
error_message string Err Message
message (an array)
imageId
string Image ID,eg:"64a929df65bcb332e9673247"
original
string Original image url,eg:https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/ori/image.png_0.png_0.png
hqPreview
string Hi-Def image url,eg:https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/hq/image.png_0.png_0.webp
lqPreview
string Low-res image link,eg:https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/lq/image.png_0.png_0.webp
previous
string Segment Image API original image url,eg:https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/imageOriginal/200/image.webp
taskId
string Task ID,Eg:"5a501437bfff4e64ad45bdc7736e9160"
success boolean Description of whether the request was successful or not.

Example of Response Body

{
  "code": "200",
  "error_message": "",
  "message": [
    {
      "hqPreview": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/hq/image.png_0.png_0.webp",
      "imageId": "64ab6d3e65bcb332e96734cf",
      "lqPreview": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/lq/image.png_0.png_0.webp",
      "original": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/ori/image.png_0.png_0.png",
      "previous": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/imageOriginal/200/image.webp",
      "taskId": "93be471469d54c17849f93f704d6e27e"
    },
    {
      "hqPreview": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/hq/image.png_1.png_0.webp",
      "imageId": "64ab6d3e65bcb332e96734d0",
      "lqPreview": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/lq/image.png_1.png_0.webp",
      "original": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/ori/image.png_1.png_0.png",
      "previous": "https://image.imgcreator.ai/ImgCreator/93be471469d54c17849f93f704d6e27e/imageOriginal/200/image.webp",
      "taskId": "93be471469d54c17849f93f704d6e27e"
    }
  ],
  "success": true
}

2.3 Instructions

Code Description error_message How to fix
200 Success
400 Parameters validation error Bad Request Check Parameters, Retry
401 Token validation error Unauthorized Verify token
402 Out of credits No enough credits recharge
429 Tow many requests TOW MANY REQUESTS limited flow, Reduce request
500 Internal service error nothing
106 Preview generated failed, task not in queue Generation failed. Please try again retry
107 Content policy violation Your input may not meet our content policy Please check uploaded images for possible sensitive or adult content
108 Preview geneartion timed out (180s) generate time out The task will time out after 180 seconds, please try again

Package

Plan1 Plan2 Plan3 Plan4
Credits 1000 5000 20000 100000
Price 140 500 1600 6000
Price per credit 0.14 0.1 0.08 0.06