curl --request POST \
--url https://api.powertokens.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "image-01",
"prompt": "A cinematic sunrise over a calm harbor",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"seed": 0,
"n": 1,
"prompt_optimizer": false
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>"
}
],
"metadata": {
"provider_request_id": "<string>",
"provider_status_code": 123,
"provider_status_msg": "<string>",
"success_count": 123,
"failed_count": 123
}
}For text-to-image generation with the image-01 model.
Public fields: model, prompt, aspect_ratio, width, height, response_format, seed, n, and prompt_optimizer.
curl --request POST \
--url https://api.powertokens.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "image-01",
"prompt": "A cinematic sunrise over a calm harbor",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"seed": 0,
"n": 1,
"prompt_optimizer": false
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>"
}
],
"metadata": {
"provider_request_id": "<string>",
"provider_status_code": 123,
"provider_status_msg": "<string>",
"success_count": 123,
"failed_count": 123
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Model name used for this capability.
image-01 Image generation prompt.
Target aspect ratio.
Target width.
Target height.
Response format. Use url for temporary download links or b64_json for Base64-encoded content.
url, b64_json Random seed. Explicit 0 will be preserved.
Number of images to generate.
1 <= x <= 9Whether to enable prompt optimization. Explicit false will be preserved.