AI 服务/图像生成
异步生成图像
接口说明:异步生成图像,立即返回 logId,通过查询任务状态接口轮询结果。
调用本接口前,请先请求「图像生成模型」接口(GET /api/ai/models/image/generation),获取当前可用的模型列表及各模型支持的尺寸、质量、风格与价格,再据此填写本接口参数。
图像生成为文生图:仅通过文字提示词生成全新图像,不传入图片。如需基于已有图片进行修改(图生图),请使用「异步编辑图像」接口。
post/api/ai/image/generate/async
Request
- Base URLhttps://aitoearn.cn
- AuthAPI key in header X-Api-Key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"prompt": "A cute orange cat sitting by a window, soft natural light",
"model": "gpt-image-2",
"quality": "low",
"response_format": "url",
"size": "1024x1024"
}Response
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
Changes
No recorded changes to this operation across all 2 revisions of this API.