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",
  "response_format": "url",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A cute orange cat sitting on a windowsill, bathed in sunlight, realistic style"
          }
        ]
      }
    ]
  },
  "size": "2048*2048",
  "n": 1,
  "watermark": false
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "metadata": {}
}

Authorizations

Authorization
string
header
required

Pass Authorization: Bearer <token> in the request header.

Body

application/json
model
enum<string>
required

Text-to-image model name.

Available options:
qwen-image-2.0-pro
input
object
required
response_format
enum<string>
default:url

Unified response format.

Available options:
url,
b64_json
n
integer

Number of output images. The gateway maps this to upstream parameters.n.

Required range: 1 <= x <= 6
size
string
default:512*512

Output image resolution in widthxheight or width*height format. The gateway converts and maps this to upstream parameters.size.

negative_prompt
string

Negative prompt. The gateway maps this to upstream parameters.negative_prompt.

prompt_extend
boolean

Whether to enable smart prompt rewriting. The gateway maps this to upstream parameters.prompt_extend.

watermark
boolean
default:false

Whether to add a watermark. Explicitly passing false is preserved and mapped to upstream parameters.watermark.

seed
integer<int64>

Random seed. Explicitly passing 0 is preserved and mapped to upstream parameters.seed.

Required range: x >= 0

Response

Success. Returns the image generation result.

created
integer<int64>

Response generation timestamp.

data
object[]

List of generated image results.

metadata
object

Pass-through raw response metadata from the upstream provider.