图片生成请求(汇总)
POST
https://api.mindcraft.com.cn/v1/images/generations
请求参数
Header 参数
Authorization
string
认证信息
示例值:
Bearer {{api_key}}
Body 参数application/json
model
enum<string>
模型名称
枚举值:
flux-schnellflux-devflux-procogview-3-flashcogview-3-plusdall-e-3
prompt
string
图片画面描述
示例值:
1+1
size
enum<string>
可选
枚举值:
1024x1024512x1024768x512768x10241024x512768x1344864x11521344x7681152x8641440x720720x1440256x256512x5121792x10241024x1792
默认值:
1024x1024
示例值:
1024x1024
示例
{
"model": "flux-pro",
"prompt": "1+1",
"size": "1024x1024"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mindcraft.com.cn/v1/images/generations' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "flux-pro",
"prompt": "1+1",
"size": "1024x1024"
}'
返回响应
🟢200成功
application/json
Body
id
string
必需
model
string
必需
usage
object
必需
prompt_cost
integer
必需
data
array [object {3}]
必需
file_url
string
可选
image_width
integer
可选
image_height
integer
可选
示例
{
"id": "986786bbdb384181bd7ecbd85bbd8819",
"model": "CogView-3",
"usage": {
"prompt_cost": 100
},
"data": [
{
"file_url": "https://sfile.chatglm.cn/testpath/1e1987cd-7ac9-5d31-976d-b72ca6dd937d_0.png",
"image_width": 1024,
"image_height": 1024
}
]
}
修改于 2025-01-21 00:56:17