Skip to main content

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/createbybutton

Request Headers

ParameterValueDescription
x-api-keyAPI KeyYour 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.
AuthorizationBearer {token}Your API Key used for request authorization.Get Token

Body Attributes

ParameterTypeRequiredDescription
_idStringtrueThe image _id you had generated, from the Create By Prompt API response
buttonStringtrueThe type of operation to perform. Get available values from the buttons field in Get Image Result API response. U1-U4: Generate a single 4K image based on the corresponding image. V1-V4: Generate a single variant based on the corresponding image
webhookUrlStringfalseCallback URL address based on HTTP request

Response Attributes

ParameterTypeDescription
codeIntegerInterface returns business status code (1000:success)
msgStringInterface returns status information
dataObjectResponse data object
- _idStringDocument ID for the new image
- image_content_model_idStringThe original image _id from the source generation
- create_timeLongCreation timestamp
- op_buttonStringThe operation button used
- op_buttonMessageIdStringOperation message ID
- image_statusIntegerStatus: 1=queueing, 2=processing, 3=completed, 4=failed
- deduction_creditIntegerCredits deducted
- fromIntegerSource identifier
- buttonsArrayAvailable operation buttons
- used_buttonsArrayAlready used buttons
- upscaled_urlsArrayUpscaled image URLs

Example

Request Body

{
  "_id": "65d3206b83ccf5ab7d46cdc6",
  "button": "U2",
  "webhookUrl": ""
}

Request

curl --location 'https://openapi.akool.com/api/open/v3/content/image/createbybutton' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "_id": "65d3206b83ccf5ab7d46cdc6",
  "button": "U2",
  "webhookUrl": ""
}'

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "faceswap_quality": 2,
    "deduction_credit": 2,
    "buttons": [],
    "used_buttons": [],
    "upscaled_urls": [],
    "_id": "6508292f16e5ba407d47d21b",
    "image_content_model_id": "6508288416e5ba407d47d13f",
    "create_time": 1695033647012,
    "op_button": "U2",
    "op_buttonMessageId": "kwZsk6elltno5Nt37VLj",
    "image_status": 1,
    "from": 1
  }
}

Button Operations

ButtonDescription
U1Generate a single 4K image based on image #1
U2Generate a single 4K image based on image #2
U3Generate a single 4K image based on image #3
U4Generate a single 4K image based on image #4
V1Generate a single variant based on image #1
V2Generate a single variant based on image #2
V3Generate a single variant based on image #3
V4Generate a single variant based on image #4

Important Notes

  • The _id must be from a previously generated image via the Create By Prompt API
  • Check available buttons from the buttons field in the Get Image Result API response before performing an operation
  • Once a button is used, it will move from buttons to used_buttons and cannot be used again
  • 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 new _id from the response to check image status using the Get Image Result API