可用模型 (7)
GPT Image 2.51k
单价20 积分 / 次
POST异步生成端点
https://api.cowboy.mom/api/generateGET任务轮询端点
https://api.cowboy.mom/api/task/{task_id}用户可上传参考文件 & 文本限制
提示词上限2000 字符 (prompt)
参考图片 (images)可传 16 张 URL
参考音频 (audios)无需/不支持
参考视频 (videos)无需/不支持
可选自定义参数
| 参数 Key | 名称 | 类型 | 可选值 / 范围 | 默认值 |
|---|---|---|---|---|
aspect_ratio | 宽高比 | select | auto | 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:3 | 5:4 | 4:5 | 2:1 | 1:2 | 21:9 | 9:21 | 21:9 |
quality | 品质 | select | max | high | low | max |
resolution | 分辨率 | select | 1K | 1K |
version | 版本 | select | sunburst | flare | sunburst |
background | 透明背景 | select | opaque | transparent | opaque |
cURL 提交示例
curl -X POST https://api.cowboy.mom/api/generate -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{
"model": "model_aslffspxme7r",
"prompt": "A cinematic scene of a cowboy under the sunset, 8k resolution, masterpiece",
"negative_prompt": "blurry, low quality, distorted",
"images": [
"https://example.com/input_reference.jpg"
],
"aspect_ratio": "auto",
"quality": "max",
"resolution": "1K",
"version": "sunburst",
"background": "opaque"
}'A. 成功提交响应
{
"success": true,
"task_id": "task_1730000000000_abc123xyz",
"status": "pending",
"cost": 20,
"balance": 9850,
"message": "Task successfully received."
}B. 轮询完成响应 (包含结果 CDN 链接)
{
"success": true,
"task": {
"id": "task_1730000000000_abc123xyz",
"model": "model_aslffspxme7r",
"prompt": "A cinematic scene of a cowboy under the sunset",
"status": "completed",
"result_url": "https://oss.cowboy.mom/api/usr_example/tasks/task_xxx/result.png",
"created_at": "2026-07-17T12:00:00.000Z",
"updated_at": "2026-07-17T12:00:15.000Z"
}
}返回结果解析说明
- result_url: 生成成功的最终文件链接(高速阿里云 OSS 转存 CDN 地址)。
- status: 任务执行状态:
pending(队列中) ➔generating(渲染中) ➔completed(已完成) ➔failed(生成失败,积分已原路退回)。