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/v4/content/image/createBySourcePrompt

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
promptStringtrueText prompt describing the image to generate
model_nameStringfalseModel name. Options: wavespeed-ai/flux-krea-dev-lora (text-to-image), wavespeed-ai/flux-kontext-dev (image-to-image). Auto-selected based on source_images if not provided
source_imagesArrayfalseArray of source image URLs for image-to-image transformation. When provided, automatically uses image-to-image model
scaleStringfalseAspect ratio. Options: “1:1”, “3:2”, “4:3”, “16:9”, “2:3”, “3:4”, “9:16”, “Original” (image-to-image only). Default: “1:1”
resolutionStringfalseOutput resolution. Options: “1080p”, “4k”. Default: “4k”
batch_quantityIntegerfalseNumber of images to generate (1-4). Default: 1
similarNumberfalseSimilarity strength for image-to-image (0-1). Default: 0.5. Only applicable for image-to-image model
negative_promptStringfalseNegative prompt to exclude certain elements from the generated image
webhookurlStringfalseCallback URL for receiving generation results

Response Attributes

ParameterTypeDescription
codeIntegerInterface returns business status code (1000:success)
msgStringInterface returns status information
dataObjectResponse data object (single object when batch_quantity=1, array when batch_quantity>1)
- _idStringDocument ID
- uidIntegerUser ID
- team_idStringTeam ID
- create_timeLongCreation timestamp
- promptStringThe prompt used for generation
- origin_promptStringOriginal prompt text
- source_imageStringSource image URL (for image-to-image)
- image_statusIntegerStatus: 1=queueing, 2=processing, 3=completed, 4=failed
- image_sub_statusIntegerSub-status for detailed tracking
- deduction_creditIntegerCredits deducted per image
- model_nameStringModel used for generation
- providerStringModel provider (wavespeed-ai)
- typeIntegerType identifier (4 = image generation)
- fromIntegerSource identifier (4 = v4 API)
- sub_typeIntegerSub-type: 40001=text-to-image, 40002=image-to-image
- file_nameStringGenerated file name

Supported Models

Model NameTypeDescription
wavespeed-ai/flux-krea-dev-loraText-to-ImageAkool V2 text-to-image model. Generates images from text prompts
wavespeed-ai/flux-kontext-devImage-to-ImageAkool V2 image-to-image model. Transforms existing images based on prompts

Example

Text-to-Image Request

{
  "model_name": "wavespeed-ai/flux-krea-dev-lora",
  "negative_prompt": "low quality, worst quality, blurry, out of focus",
  "prompt": "A majestic mountain landscape at sunset with golden light",
  "scale": "16:9",
  "resolution": "4k",
  "batch_quantity": 1
}

Image-to-Image Request

{
  "model_name": "wavespeed-ai/flux-kontext-dev",
  "negative_prompt": "low quality, worst quality, blurry, out of focus",
  "prompt": "Transform this into a watercolor painting style",
  "source_images": ["https://example.com/source-image.jpg"],
  "scale": "1:1",
  "resolution": "4k",
  "similar": 0.7,
  "batch_quantity": 1
}

Request

curl --location 'https://openapi.akool.com/api/open/v4/content/image/createBySourcePrompt' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "prompt": "A majestic mountain landscape at sunset with golden light",
  "scale": "16:9",
  "resolution": "4k",
  "batch_quantity": 1
}'

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "_id": "6650a1b2c3d4e5f6a7b8c9d0",
    "uid": 378337,
    "team_id": "team_123456",
    "create_time": 1716859314633,
    "prompt": "A majestic mountain landscape at sunset with golden light",
    "origin_prompt": "A majestic mountain landscape at sunset with golden light",
    "source_image": "",
    "image_status": 1,
    "image_sub_status": 1,
    "deduction_credit": 1,
    "model_name": "wavespeed-ai/flux-krea-dev-lora",
    "provider": "wavespeed-ai",
    "type": 4,
    "from": 4,
    "sub_type": 40001,
    "file_name": "ImageGenerator_1716859314633.png"
  }
}

Batch Generation Response (batch_quantity > 1)

{
  "code": 1000,
  "msg": "OK",
  "data": [
    {
      "_id": "6650a1b2c3d4e5f6a7b8c9d0",
      "uid": 378337,
      "team_id": "team_123456",
      "create_time": 1716859314633,
      "prompt": "A majestic mountain landscape at sunset with golden light",
      "image_status": 1,
      "deduction_credit": 1,
      "model_name": "wavespeed-ai/flux-krea-dev-lora",
      "type": 4,
      "from": 4,
      "sub_type": 40001
    },
    {
      "_id": "6650a1b2c3d4e5f6a7b8c9d1",
      "uid": 378337,
      "team_id": "team_123456",
      "create_time": 1716859314634,
      "prompt": "A majestic mountain landscape at sunset with golden light",
      "image_status": 1,
      "deduction_credit": 1,
      "model_name": "wavespeed-ai/flux-krea-dev-lora",
      "type": 4,
      "from": 4,
      "sub_type": 40001
    }
  ]
}

Important Notes

  • Model Auto-Selection: If model_name is not provided, the system automatically selects the appropriate model based on whether source_images is provided
  • Text-to-Image: Use wavespeed-ai/flux-krea-dev-lora or omit model_name and source_images
  • Image-to-Image: Use wavespeed-ai/flux-kontext-dev or provide source_images (first URL will be used as source)
  • Batch Generation: Set batch_quantity (1-4) to generate multiple images in one request. Each image deducts credits separately
  • Resolution: Default is “4k”. Both “1080p” and “4k” cost 1 credit per image
  • Similar Parameter: Only applicable for image-to-image model. Controls how closely the output matches the source image (0=more creative, 1=more similar)
  • 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

Response Code Description

Please note that if the value of the response code is not equal to 1000, the request has failed or encountered an error.
CodeDescription
1000Success
1003Parameter error or parameter validate error
1101Invalid authorization or the request token has expired
1102Authorization cannot be empty
1108Image generate error, please try again later
1200The account has been banned