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": "wan2.7-image-pro",
  "response_format": "url",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A flower shop with elegant windows, a beautiful wooden door, displaying flowers"
          }
        ]
      }
    ]
  },
  "size": "2K",
  "n": 1,
  "watermark": false,
  "thinking_mode": true,
  "seed": 0
}
'
{
  "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:
wan2.7-image-pro
input
object
required
response_format
enum<string>
default:url

Unified response format.

Available options:
url,
b64_json
size
string
default:1K

Output image resolution specification, e.g. 1K, 2K, 4K, or explicit width-by-height pixel values. The gateway maps this to upstream parameters.size.

n
integer

Number of output images. Range is 1-4 when sequential mode is off, 1-12 when sequential mode is on. The gateway maps this to upstream parameters.n.

Required range: 1 <= x <= 12
watermark
boolean
default:false

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

thinking_mode
boolean

Whether to enable thinking mode. The gateway maps this to upstream parameters.thinking_mode.

enable_sequential
boolean

Whether to enable sequential image generation mode. The gateway maps this to upstream parameters.enable_sequential.

color_palette
object[]

Custom color theme. The gateway maps this to upstream parameters.color_palette.

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.