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
}
}适用于 image-01 模型的文生图能力。
公开字段:model、prompt、aspect_ratio、width、height、response_format、seed、n、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.
当前能力使用的模型名称。
image-01 图像生成提示词。
目标宽高比。
目标宽度。
目标高度。
返回格式。使用 url 获取临时下载地址,使用 b64_json 获取 Base64 编码内容。
url, b64_json 随机种子。显式传 0 会被保留。
期望返回的图片数量。
1 <= x <= 9是否启用提示词优化。显式传 false 会被保留。