curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "phota-image",
"prompt": "A portrait of a woman in a vintage library, soft natural light",
"num_outputs": 1,
"resolution": "1K",
"aspect_ratio": "3:4"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Phota
Phota 图像生成
- PHOTA 文生图模型
- 支持 1K / 4K 分辨率,可通过 prompt 中
[[profile_id]]引用 profile - 异步处理模式,使用返回的任务ID 进行查询
- 生成的图像链接,有效期为24小时,请尽快保存
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "phota-image",
"prompt": "A portrait of a woman in a vintage library, soft natural light",
"num_outputs": 1,
"resolution": "1K",
"aspect_ratio": "3:4"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}授权
所有接口均需要使用Bearer Token进行认证
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
phota-image:文生图,支持 profile 引用
示例:
"phota-image"
图像生成提示词
说明:
- 描述想要生成的图像内容
- 支持
[[profile_id]]语法引用已创建的 profile
示例:
"A portrait of a woman in a vintage library, soft natural light"
输出图片数量
说明:
- 每张图片独立计费
示例:
1
输出图像分辨率
可选值:
1K— 标准分辨率4K— 高分辨率(价格翻倍)
示例:
"1K"
输出图像宽高比
可选值:
1:1、2:3、3:2、3:4、4:3、9:16、16:9
示例:
"1:1"
响应
任务创建成功
任务创建时间戳
示例:
1757165031
任务ID
示例:
"task-unified-1757165031-uyujaw3d"
实际使用的模型名称
任务的具体类型
可用选项:
image.generation.task 任务进度百分比 (0-100)
必填范围:
0 <= x <= 100示例:
0
任务状态
可用选项:
pending, processing, completed, failed 示例:
"pending"
异步任务信息
Show child attributes
Show child attributes
任务的输出类型
可用选项:
image 示例:
"image"