Skip to main content
POST
/
v1
/
images
/
generations
curl --request POST \ --url https://api.powertokens.ai/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "qwen-image-2.0-pro", "prompt": "A cute orange cat sitting on a windowsill, sunlight shining on it, realistic style", "n": 1, "size": "1024*1024", "response_format": "url" } '
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Image generation model name.

Available options:
qwen-image-2.0-pro,
wan2.7-image-pro
prompt
string
required

Image generation prompt describing desired content, style, and composition. Supports Chinese and English, max 800 characters.

n
integer
default:1

Number of images to generate. qwen-image-2.0 series supports 1-6, other models fixed at 1.

Required range: 1 <= x <= 6
size
string

Output image resolution in format width*height. qwen-image-2.0 series: total pixels between 512512 and 20482048. qwen-image-max/plus series: supports 1664928(16:9), 14721104(4:3), 13281328(1:1), 11041472(3:4), 928*1664(9:16)

Example:

"1024*1024"

response_format
enum<string>
default:url

Response format. url returns download link, b64_json returns Base64 encoded data.

Available options:
url,
b64_json
seed
integer

Random seed, range [0, 2147483647]. Same seed produces similar results.

watermark
boolean
default:false

Whether to add watermark to the image.

prompt_extend
boolean
default:true

Whether to enable prompt intelligent rewriting.

negative_prompt
string

Negative prompt describing content to avoid. Supports Chinese and English, max 500 characters.

Response

Success, returns image generation result.

created
integer<int64>

Unix timestamp of creation time (seconds).

data
object[]

List of generated images.

metadata
object

Additional result metadata. Returned fields may vary by capability.