Documentation Index Fetch the complete documentation index at: https://docs.akool.com/llms.txt
Use this file to discover all available pages before exploring further.
The resources (image, video, voice) generated by our API are valid for 7 days.
Please save the relevant resources as soon as possible to prevent expiration.
Endpoint
POST https://openapi.akool.com/api/open/v3/content/image/createbyprompt
Parameter Value Description x-api-key API Key Your API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded. Authorization Bearer {token} Your API Key used for request authorization.Get Token
Body Attributes
Parameter Type Required Description prompt String true Describe the information needed to generate the image scale String false The size of the generated image. Options: “1:1”, “4:3”, “3:4”, “16:9”, “9:16”, “3:2”, “2:3”. Default: “1:1” source_image String false Original image URL for image-to-image transformation. Pass this parameter to perform image-to-image operation webhookUrl String false Callback URL address based on HTTP request
Response Attributes
Parameter Type Description code Integer Interface returns business status code (1000:success) msg String Interface returns status information data Object Response data object - _id String Document ID - uid Integer User ID - create_time Long Creation timestamp - prompt String Processed prompt text - origin_prompt String Original prompt text - source_image String Source image URL (if provided) - image_status Integer Status: 1=queueing, 2=processing, 3=completed, 4=failed - deduction_credit Integer Credits deducted - type Integer Type identifier - from Integer Source identifier - buttons Array Available operation buttons - used_buttons Array Already used buttons - upscaled_urls Array Upscaled image URLs
Example
Request Body
{
"prompt" : "Sun Wukong is surrounded by heavenly soldiers and generals" ,
"scale" : "1:1" ,
"source_image" : "https://drz0f01yeq1cx.cloudfront.net/1708333063911-9cbe39b7-3c5f-4a35-894c-359a6cbb76c3-3283.png" ,
"webhookUrl" : ""
}
Request
cURL
Java
Javascript
PHP
Python
curl --location 'https://openapi.akool.com/api/open/v3/content/image/createbyprompt' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Sun Wukong is surrounded by heavenly soldiers and generals",
"scale": "1:1",
"source_image": "https://drz0f01yeq1cx.cloudfront.net/1708333063911-9cbe39b7-3c5f-4a35-894c-359a6cbb76c3-3283.png",
"webhookUrl": ""
}'
Response
{
"code" : 1000 ,
"msg" : "OK" ,
"data" : {
"faceswap_quality" : 2 ,
"deduction_credit" : 2 ,
"buttons" : [],
"used_buttons" : [],
"upscaled_urls" : [],
"_id" : "64dd82eef0b6684651e90131" ,
"uid" : 378337 ,
"create_time" : 1692238574633 ,
"origin_prompt" : "***" ,
"source_image" : "https://***.cloudfront.net/1702436829534-4a813e6c-303e-48c7-8a4e-b915ae408b78-5034.png" ,
"prompt" : "***** was a revolutionary leader who transformed *** into a powerful communist state." ,
"type" : 4 ,
"from" : 1 ,
"image_status" : 1
}
}
Important Notes
Text to Image : Simply provide a prompt without source_image to generate an image from scratch
Image to Image : Provide both prompt and source_image to transform an existing image based on the prompt
Aspect Ratio : Choose the appropriate scale for your use case (default is “1:1”)
Resource Expiration : Generated images are valid for 7 days, save them promptly
Webhook : Use webhookUrl to receive notifications when image generation is complete
Save the _id from the response to check image status using the Get Image Result API