curl --request POST \
--url https://api.amux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-official",
"prompt": "一只可爱的海獭幼崽"
}
'{
"created": 1713833628,
"background": "opaque",
"data": [
{
"b64_json": "<base64-png>"
}
],
"output_format": "png",
"quality": "high",
"size": "1024x1024",
"usage": {
"input_tokens": 13,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 13
},
"output_tokens": 8232,
"total_tokens": 8245,
"output_tokens_details": {
"image_tokens": 8192,
"text_tokens": 40
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}images
生成图像
根据文本提示词生成图像。
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.amux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-official",
"prompt": "一只可爱的海獭幼崽"
}
'{
"created": 1713833628,
"background": "opaque",
"data": [
{
"b64_json": "<base64-png>"
}
],
"output_format": "png",
"quality": "high",
"size": "1024x1024",
"usage": {
"input_tokens": 13,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 13
},
"output_tokens": 8232,
"total_tokens": 8245,
"output_tokens_details": {
"image_tokens": 8192,
"text_tokens": 40
}
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Authorizations
API Key 通过 Authorization: Bearer <key> 传入。
Body
application/json
所需图像的文本描述。
Maximum string length:
32000Available options:
gpt-image-2-official 生成图像数量。
Required range:
1 <= x <= 10输出尺寸。预设:1024x1024、1536x1024、1024x1536、auto。也支持任意 宽x高:宽高均被 16 整除、宽高比在 1:3 ~ 3:1 之间、且不超过模型上限(最大 3840x2160)。
Examples:
"auto"
"1024x1024"
"1536x1024"
"1024x1536"
"1536x864"
渲染质量。
Available options:
low, medium, high, auto 背景处理。暂不支持透明背景。
Available options:
opaque, auto 输出图像格式。
Available options:
png, jpeg 压缩级别(0-100%),对 jpeg 输出生效。
Required range:
0 <= x <= 100内容审核强度。
Available options:
low, auto 用于滥用监测的终端用户标识。
Response
生成的图像。
Unix 时间戳(秒)。
Show child attributes
Show child attributes
Available options:
opaque Available options:
png, jpeg Available options:
low, medium, high 实际渲染尺寸,如 1024x1024。
Show child attributes
Show child attributes
Was this page helpful?