POST
/v1/images/generationsFlux 创建(OpenAI dall-e-3格式)
API Key application/json
请求示例
curl -X POST https://top.qingyuntop.ai/v1/images/generations \
-H "Authorization: Bearer ${QINGYUN_TOP_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-kontext-pro",
"prompt": "a beautiful landscape with a river and mountains",
// "size": "1024x1524",
"n": 1,
"aspect_ratio": "21:9"
}'请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
Authorization | Header | string | 否 | - | Bearer {{YOUR_API_KEY}} |
prompt | JSON body | string | 是 | 所需图像的文本描述。最大长度为 1000 个字符。 | - |
model | JSON body | string | 否 | 用于图像生成的模型。 | - |
n | JSON body | integer | 否 | 要生成的图像数。必须介于 1 和 10 之间。 | - |
quality | JSON body | string | 否 | 将生成的图像的质量。`hd`创建具有更精细细节和更高一致性的图像。此参数仅支持`dall-e-3`. | - |
response_format | JSON body | string | 否 | 返回生成的图像的格式。必须是 或url之一b64_json。 | - |
style | JSON body | string | 否 | 风格 | - |
user | JSON body | string | 否 | 生成图像的风格。必须是 或`vivid`之一`natural`。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。此参数仅支持`dall-e-3`. | - |
size | JSON body | string | 否 | 生成图像的大小。必须是256x256、512x512或 1024x1024之一。 | - |
aspect_ratio | JSON body | string | 是 | 图片比例: 枚举值Possible enum values: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21 | - |
返回响应 (200)
| 参数 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|---|
created | 响应 JSON | integer | 是 | - | - |
data | 响应 JSON | array<object> | 是 | - | - |
data[].url | 响应 JSON | string | 是 | - | - |
响应示例
{
"created": 1589478378,
"data": [
{
"url": "https://..."
},
{
"url": "https://..."
}
]
}来源原始接口定义(用于追溯)
以下内容来自 Apifox 快照,可能包含兼容层字段或旧示例;公开调用请以本页的协议说明和当前模型列表为准。
{
"id": 497673328,
"name": "Flux 创建(OpenAI dall-e-3格式)",
"type": "http",
"serverId": "",
"preProcessors": [],
"postProcessors": [
{
"type": "customScript",
"data": "// 将接口返回数据,封装成自己需要的结构\r\nvar resp = {\r\n response: pm.response.json().data[0].url\r\n}\r\n\r\n// html 模板字符\r\nvar template = `<html><img src=\"{{response}}\" /></html>`;\r\n\r\n// 设置 visualizer 数据。传模板、解析对象。\r\npm.visualizer.set(template, resp);",
"defaultEnable": true,
"enable": true,
"id": "RB85a92z4Tg5EIsmvLR5mQYPTEYSELu2"
}
],
"inheritPreProcessors": {},
"inheritPostProcessors": {},
"description": "[图片](https://platform.openai.com/docs/api-reference/images)\n\n给定提示和/或输入图像,模型将生成新图像。\n\n相关指南:[图像生成](https://platform.openai.com/docs/guides/images)\n\n根据提示创建图像。\n\n",
"operationId": "",
"sourceUrl": "",
"method": "post",
"path": "/v1/images/generations",
"tags": [],
"status": 1,
"requestBody": {
"type": "application/json",
"parameters": [],
"jsonSchema": {
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "用于图像生成的模型。"
},
"prompt": {
"type": "string",
"description": "所需图像的文本描述。最大长度为 1000 个字符。"
},
"n": {
"type": "integer",
"description": "要生成的图像数。必须介于 1 和 10 之间。"
},
"size": {
"type": "string",
"description": "生成图像的大小。必须是256x256、512x512或 1024x1024之一。"
},
"quality": {
"type": "string",
"description": "将生成的图像的质量。`hd`创建具有更精细细节和更高一致性的图像。此参数仅支持`dall-e-3`."
},
"response_format": {
"type": "string",
"description": "返回生成的图像的格式。必须是 或url之一b64_json。"
},
"style": {
"type": "string",
"description": "风格"
},
"user": {
"type": "string",
"description": "生成图像的风格。必须是 或`vivid`之一`natural`。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。此参数仅支持`dall-e-3`."
},
"aspect_ratio": {
"type": "string",
"description": "图片比例: 枚举值Possible enum values: 21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21",
"x-apifox-mock": "1:1"
}
},
"required": [
"prompt",
"aspect_ratio"
],
"x-apifox-orders": [
"prompt",
"model",
"n",
"quality",
"response_format",
"style",
"user",
"size",
"aspect_ratio"
]
},
"examples": [
{
"value": "{\n \"model\": \"flux-kontext-pro\",\n \"prompt\": \"a beautiful landscape with a river and mountains\",\n // \"size\": \"1024x1524\",\n \"n\": 1,\n \"aspect_ratio\": \"21:9\"\n}",
"mediaType": "application/json",
"description": ""
}
],
"mediaType": "",
"oasExtensions": "",
"required": false,
"additionalContentTypes": []
},
"parameters": {
"path": [],
"query": [],
"cookie": [],
"header": [
{
"id": "GTujCrB2It",
"name": "Authorization",
"required": false,
"enable": true,
"description": "",
"type": "string",
"sampleValue": "Bearer {{YOUR_API_KEY}}"
}
]
},
"commonParameters": {
"query": [],
"body": [],
"cookie": [],
"header": []
},
"auth": {
"type": "noauth"
},
"responses": [
{
"id": 122130974,
"name": "Create image",
"code": 200,
"contentType": "json",
"jsonSchema": {
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
],
"x-apifox-orders": [
"url"
]
}
}
},
"required": [
"created",
"data"
],
"x-apifox-orders": [
"created",
"data"
]
},
"itemSchema": {},
"description": "",
"mediaType": "",
"headers": [],
"oasExtensions": ""
}
],
"responseExamples": [
{
"name": "Create image",
"responseId": 122130974,
"data": "{\n \"created\": 1589478378,\n \"data\": [\n {\n \"url\": \"https://...\"\n },\n {\n \"url\": \"https://...\"\n }\n ]\n}",
"description": "",
"oasKey": "",
"oasExtensions": "",
"id": "019fd25e-4be5-7428-af98-a335dc908354"
}
],
"codeSamples": [],
"projectId": 8662722,
"moduleId": 8310462,
"folderId": 92749331,
"ordering": 0,
"responsibleId": 0,
"commonResponseStatus": {},
"advancedSettings": {
"disabledSystemHeaders": {},
"isDefaultUrlEncoding": 1
},
"customApiFields": {},
"oasExtensions": "",
"mockScript": {},
"createdAt": "2026-08-05T14:40:23.000Z",
"updatedAt": "2026-08-06T12:15:55.000Z",
"creatorId": 2863449,
"editorId": 2863449,
"creatorUserId": 2863449,
"editorUserId": 2863449,
"responseChildren": [],
"visibility": "INHERITED",
"securityScheme": {},
"callbacks": ""
}