OpenAPI 参考
Modelink API · 图像
Modelink 图像生成 API,提供基于 OpenAI 格式的同步生成与基于 Fal 格式的异步任务能力。Fal 格式接口使用 Authorization: Key {api_key};其他接口使用 Bearer 鉴权。
版本 1.0.0
文生图
常用 size :
1024x1024(square)1536x1024(landscape)1024x1536(portrait)2048x2048(2K square)2048x1152(2K landscape)3840x2160(4K landscape)2160x3840(4K portrait)auto(default)
也支持自定义 size:
最大边长必须小于或等于 3840px 两条边都必须是以下数字的倍数 16px 长边与短边之比不得超过 3:1 总像素数必须至少为 655,360,且不得超过 8,294,400
quality 支持
lowmediumhighauto(default)
prompt 长度限制
32000 characters ≈
- 英文:~5K–8K words
- 中文:~2万字左右
认证方式
在 Authorization 请求头中传入 API Key 或访问令牌,格式:Bearer {token}。
请求体
请求体属性
- modelstring, 必填
模型名称。GPT Image 2 使用
openai/gpt-image-2。 - promptstring, 必填
图片生成提示词,必填,最长 32000 个字符。
lowmediumhighauto
- sizestring
常用 size : 1024x1024 (square) 1536x1024 (landscape) 1024x1536 (portrait) 2048x2048 (2K square) 2048x1152 (2K landscape) 3840x2160 (4K landscape) 2160x3840 (4K portrait) auto (default)
请求
curl https://api.qnaigc.com/v1/images/generations \
--request POST \
--header 'Authorization: Bearer YOUR_BEARER_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-image-2",
"prompt": "可爱的少女,动漫",
"quality": "high"
}'响应
响应体属性
- createdinteger, 必填
Unix 时间戳(秒)
- b64_jsonstring, 必填
图片的 base64 数据(当前实现固定返回该字段)
- backgroundstring
可选,背景类型
pngjpegwebp
- sizestring
可选,图像尺寸
- qualitystring
可选,图像质量
- total_tokensinteger可选。
- input_tokensinteger可选。
- output_tokensinteger可选。
- ti_quantityinteger可选。
- ii_quantityinteger可选。
- mi2i_quantityinteger可选。
- req_countinteger可选。
- text_tokensinteger可选。
- image_tokensinteger可选。
- image_tokensinteger可选。
- reasoning_tokensinteger可选。
- text_tokensinteger可选。
响应
{
"created": 42,
"data": [
{
"b64_json": "string"
}
],
"background": "string",
"output_format": "png",
"size": "string",
"quality": "string",
"usage": {
"total_tokens": 42,
"input_tokens": 42,
"output_tokens": 42,
"ti_quantity": 42,
"ii_quantity": 42,
"mi2i_quantity": 42,
"req_count": 42,
"input_tokens_details": {
"text_tokens": 42,
"image_tokens": 42
}
}
}图生图
输入图片 image
image为图片数组,单个元素可以是公网可访问的图片 URL,或data:image/<格式>;base64,<数据>形式的 base64 data URI。- 单次请求最多提供 16 张图片。
- 使用
application/json时,通过 URL 提供的单张图片大小上限为 40MB。 - 支持的图片格式:
png、jpeg、webp、gif。
认证方式
在 Authorization 请求头中传入 API Key 或访问令牌,格式:Bearer {token}。
请求体
请求体属性
- modelstring, 必填
模型名称。GPT Image 2 使用
openai/gpt-image-2。 - promptstring, 必填
图片编辑提示词,必填,最长 32000 个字符。
- imagestring[], 必填
输入图片数组,每个元素为公网可访问的图片 URL 或 data:image/<格式>;base64,<数据> 形式的 base64 data URI。最多 16 张;使用 application/json 时,通过 URL 提供的单张图片大小上限为 40MB。支持 png/jpeg/webp/gif。
lowmediumhighauto
请求
curl https://api.qnaigc.com/v1/images/edits \
--request POST \
--header 'Authorization: Bearer YOUR_BEARER_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "openai/gpt-image-2",
"prompt": "图片中增加一个人",
"image": [
"https://aitoken-public.qnaigc.com/example/generate-video/running-man.jpg"
],
"quality": "low"
}'响应
响应体属性
- createdinteger, 必填
Unix 时间戳(秒)
- b64_jsonstring, 必填
图片的 base64 数据(当前实现固定返回该字段)
- backgroundstring
可选,背景类型
pngjpegwebp
- sizestring
可选,图像尺寸
- qualitystring
可选,图像质量
- total_tokensinteger可选。
- input_tokensinteger可选。
- output_tokensinteger可选。
- ti_quantityinteger可选。
- ii_quantityinteger可选。
- mi2i_quantityinteger可选。
- req_countinteger可选。
- text_tokensinteger可选。
- image_tokensinteger可选。
- image_tokensinteger可选。
- reasoning_tokensinteger可选。
- text_tokensinteger可选。
响应
{
"created": 42,
"data": [
{
"b64_json": "string"
}
],
"background": "string",
"output_format": "png",
"size": "string",
"quality": "string",
"usage": {
"total_tokens": 42,
"input_tokens": 42,
"output_tokens": 42,
"ti_quantity": 42,
"ii_quantity": 42,
"mi2i_quantity": 42,
"req_count": 42,
"input_tokens_details": {
"text_tokens": 42,
"image_tokens": 42
}
}
}创建图像生成任务
创建可灵 OmniImage 图像生成任务。支持文本提示词、参考图片的多模态输入方式。任务为异步执行,创建成功后返回任务 ID,需通过查询接口获取生成结果。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
文本提示词,使用 <<<image_1>>> 引用参考图,最大 2500 字符
- image_urlsstring<uri>[]
参考图 URL 列表,在 prompt 中用 <<<image_1>>> 引用(1-indexed),最多 10 张
1K2K1k2k
- num_imagesinteger
生成数量 1-9,默认 1
minimum: 1; maximum: 9
auto16:99:161:14:33:43:22:321:9
请求
curl 'https://api.qnaigc.com/queue/fal-ai/kling-image/o1?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "一只可爱的橘猫在阳光下打盹",
"num_images": 2,
"resolution": "2K",
"aspect_ratio": "16:9"
}'响应
服务器内部错误
响应体属性
- statusstring, 必填必填。
- request_idstring, 必填必填。
- response_urlstring, 必填必填。
- status_urlstring, 必填必填。
- cancel_urlstring, 必填必填。
响应
{
"status": "IN_QUEUE",
"request_id": "qimage-root-1770199726278452760",
"response_url": "https://api.qnaigc.com/queue/fal-ai/kling-image/requests/qimage-root-1770199726278452760",
"status_url": "https://api.qnaigc.com/queue/fal-ai/kling-image/requests/qimage-root-1770199726278452760/status",
"cancel_url": ""
}查询图像生成任务
根据任务 ID 查询图像生成任务的状态和结果。任务完成后,返回生成的图像 URL 列表。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- task_id
- Type
- string, 必填
- Description
任务 ID,由创建任务接口返回
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/kling-image/requests/{task_id}/status \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
服务器内部错误
响应体属性
- statusstring, 必填必填。
- request_idstring, 必填必填。
- response_urlstring, 必填必填。
- status_urlstring, 必填必填。
- cancel_urlstring, 必填必填。
- inference_timeinteger, 必填必填。
- urlstring, 必填必填。
- content_typestring, 必填必填。
响应
{
"status": "COMPLETED",
"request_id": "qimage-root-1770199726278452760",
"response_url": "https://api.qnaigc.com/queue/fal-ai/kling-image/requests/qimage-root-1770199726278452760",
"status_url": "https://api.qnaigc.com/queue/fal-ai/kling-image/requests/qimage-root-1770199726278452760/status",
"cancel_url": "",
"metrics": {
"inference_time": 38
},
"result": {
"images": [
{
"url": "https://aitoken-video.qnaigc.com/images/root/qimage-root-1770199726278452760/0.png?e=1770804564&token=IDB69r4gicDbMd9Fbmn9w2bWuEENg9i5_yasXqhp:QucLpFz96OaAUNr5PT0jMWGg6uw=",
"content_type": "image/png"
},
{
"url": "https://aitoken-video.qnaigc.com/images/root/qimage-root-1770199726278452760/1.png?e=1770804564&token=IDB69r4gicDbMd9Fbmn9w2bWuEENg9i5_yasXqhp:zP_T_jPES3OZAHZ0qkbe9MhK6sc=",
"content_type": "image/png"
}
]
}
}获取结果
根据任务 ID 查询图像生成任务的状态和结果。任务完成后,返回生成的图像 URL 列表。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- task_id
- Type
- string, 必填
- Description
任务 ID,由创建任务接口返回
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/kling-image/requests/{task_id} \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
服务器内部错误
响应体属性
- urlstring, 必填必填。
- content_typestring, 必填必填。
响应
{
"images": [
{
"url": "https://aitoken-video.qnaigc.com/images/root/qimage-root-1770105770654149000/0.png?e=1770710614&token=IDB69r4gicDbMd9Fbmn9w2bWuEENg9i5_yasXqhp:juaQpRC__BdIP-h8EDNgPmkk99M=",
"content_type": "image/png"
},
{
"url": "https://aitoken-video.qnaigc.com/images/root/qimage-root-1770105770654149000/1.png?e=1770710614&token=IDB69r4gicDbMd9Fbmn9w2bWuEENg9i5_yasXqhp:uB_mVes2XTcNByHqTdXPm1VGq5A=",
"content_type": "image/png"
}
]
}提交文生图任务
提交 gpt-image-2 文生图异步任务。鉴权通过后创建任务并立即返回 IN_QUEUE 状态与 request_id,实际生图在后台异步执行。可通过 query 参数 fal_webhook 配置回调。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
图片生成提示词,必填,最长 32000 个字符。
square1024×1024(1:1)
square_hd1024×1024(1:1;当前与 square 相同)
portrait_4_3768×1024(3:4 竖图)
portrait_16_9864×1536(9:16 竖图)
landscape_4_31024×768(4:3 横图)
landscape_16_91536×864(16:9 横图)
auto由模型根据提示词和输入图片自动选择尺寸。
- widthinteger, 必填
图像宽度(像素)
minimum: 1
- heightinteger, 必填
图像高度(像素)
minimum: 1
autolowmediumhigh
- num_imagesinteger
生成图片数量。默认 1,范围 1~4。
default: 1; minimum: 1; maximum: 4
jpegpngwebp
请求
curl 'https://api.qnaigc.com/queue/openai/gpt-image-2?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "a cute red panda coding on a laptop, studio lighting",
"image_size": "landscape_4_3",
"quality": "high",
"num_images": 1,
"output_format": "png"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}提交图片编辑任务
提交 gpt-image-2 图片编辑异步任务。需提供参考图 image_urls(必填),可选 mask_url 指定编辑区域。返回的状态/结果查询 URL 走 base 路径 openai/gpt-image-2/requests/{request_id}(不带 /edit)。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
图片编辑提示词,必填,最长 32000 个字符。
- image_urlsstring[], 必填
编辑所使用的参考图片 URL 列表,必填。平台当前最多接受 10 张。
- mask_urlstring<uri>
可选的遮罩图片 URL,用于指示需要编辑的区域。
square1024×1024(1:1)
square_hd1024×1024(1:1;当前与 square 相同)
portrait_4_3768×1024(3:4 竖图)
portrait_16_9864×1536(9:16 竖图)
landscape_4_31024×768(4:3 横图)
landscape_16_91536×864(16:9 横图)
auto由模型根据提示词和输入图片自动选择尺寸。
- widthinteger, 必填
图像宽度(像素)
minimum: 1
- heightinteger, 必填
图像高度(像素)
minimum: 1
autolowmediumhigh
- num_imagesinteger
生成图片数量。默认 1,范围 1~4。
default: 1; minimum: 1; maximum: 4
jpegpngwebp
请求
curl 'https://api.qnaigc.com/queue/openai/gpt-image-2/edit?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "add a wizard hat on the red panda",
"image_urls": [
"https://example.com/input.png"
],
"image_size": "auto",
"quality": "high",
"num_images": 1,
"output_format": "png"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}查询任务状态
查询文生图/编辑任务的状态(共用此端点,request_id 全局唯一)。进行中返回 HTTP 202,完成/失败返回 HTTP 200。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
任务 ID(提交接口返回的 request_id,格式 qimage-{uid}-{timestamp})
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/openai/gpt-image-2/requests/{request_id}/status \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务已完成或失败
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {},
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}获取任务结果
获取文生图/编辑任务的结果(共用此端点)。任务进行中返回 HTTP 400;任务失败返回对应错误码 + fal 错误详情;任务成功返回图片结果。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
任务 ID
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/openai/gpt-image-2/requests/{request_id} \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务失败,返回对应 HTTP 错误码和 Fal 错误详情
响应体属性
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}提交文生图任务
提交 gemini-3.1-flash-lite-image 文生图异步任务。鉴权通过后创建任务并立即返回 IN_QUEUE 状态与 request_id,实际生图在后台异步执行。可通过 query 参数 fal_webhook 配置回调。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
文本提示词(必填,最大长度 50000)
auto21:916:93:24:35:41:14:53:42:39:164:11:48:11:8
- num_imagesinteger
生成图片数量,默认为 1。
default: 1; minimum: 1; maximum: 1
jpegpngwebp
minimalhigh
123456
- system_promptstring
系统提示词。
请求
curl 'https://api.qnaigc.com/queue/google/nano-banana-2-lite?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "a cute red panda sitting on a tree branch, watercolor style",
"aspect_ratio": "1:1",
"output_format": "png"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}提交图片编辑任务
提交 gemini-3.1-flash-lite-image 图片编辑异步任务。需提供参考图 image_urls(必填)。文生图与编辑任务共用同一组状态/结果查询端点。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
编辑提示词(必填,最大长度 50000)
auto21:916:93:24:35:41:14:53:42:39:164:11:48:11:8
- num_imagesinteger
生成图片数量,默认为 1。
default: 1; minimum: 1; maximum: 1
jpegpngwebp
- image_urlsstring<uri>[], 必填
参考图 URL 列表(必填)。用于图生图或图片编辑。
minimalhigh
123456
- system_promptstring
系统提示词。
请求
curl 'https://api.qnaigc.com/queue/google/nano-banana-2-lite/edit?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "change the background to a sunset beach",
"image_urls": [
"https://example.com/input.png"
],
"aspect_ratio": "auto",
"output_format": "png"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}查询任务状态
查询文生图/编辑任务的状态(共用此端点,request_id 全局唯一)。进行中返回 HTTP 202,完成/失败返回 HTTP 200。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
任务 ID(提交接口返回的 request_id,格式 qimage-{uid}-{timestamp})
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/google/nano-banana-2-lite/requests/{request_id}/status \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务已完成或失败
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {},
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}获取任务结果
获取文生图/编辑任务的结果(共用此端点)。任务进行中返回 HTTP 400;任务失败返回对应错误码 + fal 错误详情;任务成功返回图片结果。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
任务 ID
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/google/nano-banana-2-lite/requests/{request_id} \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务失败,返回对应 HTTP 错误码和 Fal 错误详情
响应体属性
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}提交文生图任务
提交 gemini-3.0-pro-image-preview 文生图异步任务,立即返回 IN_QUEUE、request_id 与查询 URL。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
文本提示词,最大长度 50000。
auto21:916:93:24:35:41:14:53:42:39:16
1K2K4K
jpegpngwebp
123456
- system_promptstring
引导模型风格的系统提示词。
请求
curl 'https://api.qnaigc.com/queue/fal-ai/gemini-3-pro-image-preview?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "make a photo of the man driving the car down the california coastline",
"aspect_ratio": "16:9",
"resolution": "2K",
"output_format": "png"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}提交图片编辑任务
提交 gemini-3.0-pro-image-preview 图片编辑异步任务。image_urls 必填,文生图与编辑任务共用状态和结果查询路径。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
编辑提示词,最大长度 50000。
- image_urlsstring<uri>[], 必填
参考图 URL 列表,不支持 mask。
auto21:916:93:24:35:41:14:53:42:39:16
1K2K4K
jpegpngwebp
123456
- system_promptstring
引导模型风格的系统提示词。
请求
curl 'https://api.qnaigc.com/queue/fal-ai/gemini-3-pro-image-preview/edit?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "make a photo of the man driving the car down the california coastline",
"image_urls": [
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
],
"resolution": "2K"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}查询任务状态
查询文生图或图片编辑任务状态。进行中返回 HTTP 202 和 IN_QUEUE 或 IN_PROGRESS;完成或失败返回 HTTP 200 和 COMPLETED,失败详情通过 detail 提供。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
提交任务时返回的
request_id。
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/gemini-3-pro-image-preview/requests/{request_id}/status \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务已完成或失败
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {},
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}获取任务结果
获取文生图或图片编辑任务结果。任务进行中返回 HTTP 400 状态响应;参数错误返回 Fal 错误响应;任务失败返回对应错误码和 Fal 错误详情;成功返回 Fal 格式图片列表。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
提交任务时返回的
request_id。
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/gemini-3-pro-image-preview/requests/{request_id} \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务失败,返回对应 HTTP 错误码和 Fal 错误详情
响应体属性
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}提交文生图任务
提交 gemini-3.1-flash-image-preview 文生图异步任务。支持 0.5K 分辨率、极端画幅比例和 thinking_level。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
文本提示词,最大长度 50000。
auto21:916:93:24:35:41:14:53:42:39:164:11:48:11:8
0.5K1K2K4K
jpegpngwebp
minimalhigh
123456
- system_promptstring
引导模型风格的系统提示词。
请求
curl 'https://api.qnaigc.com/queue/fal-ai/gemini-3.1-flash-image-preview?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "make a photo of the man driving the car down the california coastline",
"aspect_ratio": "auto",
"resolution": "1K",
"thinking_level": "minimal"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}提交图片编辑任务
提交 gemini-3.1-flash-image-preview 图片编辑异步任务。image_urls 为参考图片 URL 列表,不支持 mask。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
查询参数
- Name
- fal_webhook
- Type
- string<uri>
- Description
可选。任务状态变化时接收 FAL 格式回调的 HTTPS 地址。详见 FAL 格式 Webhook。
请求体
请求体属性
- promptstring, 必填
编辑提示词,最大长度 50000。
- image_urlsstring<uri>[], 必填
参考图 URL 列表,不支持 mask。
auto21:916:93:24:35:41:14:53:42:39:164:11:48:11:8
0.5K1K2K4K
jpegpngwebp
minimalhigh
123456
- system_promptstring
引导模型风格的系统提示词。
请求
curl 'https://api.qnaigc.com/queue/fal-ai/gemini-3.1-flash-image-preview/edit?fal_webhook={fal_webhook}' \
--request POST \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Change this image to red",
"image_urls": [
"https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png"
],
"thinking_level": "minimal"
}'响应
任务已入队
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETEDFAILED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {}
}查询任务状态
查询文生图或图片编辑任务状态。进行中返回 HTTP 202 和 IN_QUEUE 或 IN_PROGRESS;完成或失败返回 HTTP 200 和 COMPLETED,失败详情通过 detail 提供。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
提交任务时返回的
request_id。
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/gemini-3.1-flash-image-preview/requests/{request_id}/status \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务已完成或失败
响应体属性
IN_QUEUEIN_PROGRESSCOMPLETED
- request_idstring, 必填必填。
- response_urlstring可选。
- status_urlstring可选。
- cancel_urlstring可选。
- queue_positioninteger可选。
- logsobject | null可选。
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"status": "IN_QUEUE",
"request_id": "string",
"response_url": "string",
"status_url": "string",
"cancel_url": "string",
"queue_position": 42,
"logs": {},
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}获取任务结果
获取文生图或图片编辑任务结果。任务进行中返回 HTTP 400 状态响应;参数错误返回 Fal 错误响应;任务失败返回对应错误码和 Fal 错误详情;成功返回 Fal 格式图片列表。
认证方式
Fal 格式接口鉴权方式:Authorization: Key {api_key}。
路径参数
- Name
- request_id
- Type
- string, 必填
- Description
提交任务时返回的
request_id。
请求体
暂无请求体
请求
curl https://api.qnaigc.com/queue/fal-ai/gemini-3.1-flash-image-preview/requests/{request_id} \
--header 'Authorization: YOUR_FAL_API_KEY_AUTH' \
--header 'Accept: application/json'响应
任务失败,返回对应 HTTP 错误码和 Fal 错误详情
响应体属性
- locstring[]
错误定位(fal.ai 标准错误详情,恒返回,默认 ["body"])。
- msgstring
错误信息。
- typestring
错误类型。
- urlstring
错误参考链接(fal.ai 标准错误详情,恒返回,默认空串)。
- *string可选。
响应
{
"detail": {
"loc": [
"string"
],
"msg": "string",
"type": "string",
"url": "string",
"ctx": {}
}
}对话接口 - 支持文生图、图生图和纯对话
通过 OpenAI Chat Completions 格式同步调用 Gemini 生图模型。接口支持文生图、图生图和纯对话。
调用模式:普通响应和 stream: true 的流式响应都在当前请求连接内返回结果,区别于 Fal queue 提交任务后再查询结果的异步模式。
接口特点:
- 支持流式输出:可以实时接收生成进度
- 展示思考过程:返回模型的推理过程(reasoning_content)
- 更灵活的交互:可以只聊天不生图,也可以生成图像
- 多模态支持:在对话中自然地混合文本和图像输入
不同模型支持的分辨率和画幅比例可能不同,请按所选模型的能力使用 image_config。
认证方式
在 Authorization 请求头中传入 API Key 或访问令牌,格式:Bearer {token}。
请求体
请求体属性
- modelstring, 必填
需要调用的 Gemini 生图模型名称,具体可用模型以模型列表为准。
userassistant
- oneOf[0]string
纯文本内容
text
- textstring, 必填
文本内容
image_url
- urlstring, 必填
图片 URL 或 Base64 data URI
- streamboolean
是否启用流式输出
- true:流式返回,可实时接收生成进度
- false:等待生成完成后返回完整结果
default: false
1:11:41:82:33:23:44:14:34:55:48:19:1616:921:9
5121K2K4K
- temperaturenumber<float>
生成温度,取值范围:0.0-2.0
minimum: 0; maximum: 2
- top_pnumber<float>
核采样参数,取值范围:0.0-1.0
minimum: 0; maximum: 1
- top_kinteger
Top-K 采样参数,最小值:1
minimum: 1
请求
curl https://api.qnaigc.com/v1/chat/completions \
--request POST \
--header 'Authorization: Bearer YOUR_BEARER_AUTH' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-3.0-pro-image-preview",
"stream": false,
"messages": [
{
"role": "user",
"content": "画一张电影质感的海岸公路照片"
}
],
"image_config": {
"aspect_ratio": "16:9",
"image_size": "2K"
}
}'响应
请求成功
响应体属性
- idstring, 必填
对话完成 ID
chat.completion
- createdinteger<int64>, 必填
响应创建时间戳(Unix 时间戳,秒)
- modelstring, 必填
使用的模型名称
- indexinteger
结果索引
assistant
- contentstring
文本内容(如果只是聊天)
- reasoning_contentstring
模型的思考过程和推理内容
image_url
- urlstring
Base64 data URI 格式的图像数据
- indexinteger
图像索引,从 0 开始
- finish_reasonstring
完成原因,通常为 stop
- prompt_tokensinteger
输入 token 数
- completion_tokensinteger
输出 token 数
- total_tokensinteger
总 token 数
- text_tokensinteger
文本 token 数
- reasoning_tokensinteger
推理 token 数
- image_tokensinteger
图像 token 数
响应
{
"id": "chatcmpl-2f8236e9f2b34bd391289576d0e23e72",
"object": "chat.completion",
"created": 1764574464,
"model": "gemini-3.1-flash-image-preview",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "",
"reasoning_content": "**Analyzing the Icon Redesign**\n\nI'm focused on the icon's elements...",
"images": [
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABYAAAAMACAIAAAASU1SbA.........."
},
"index": 0
}
]
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 19,
"completion_tokens": 1322,
"total_tokens": 1341,
"prompt_tokens_details": {
"text_tokens": 19
},
"completion_tokens_details": {
"reasoning_tokens": 202,
"image_tokens": 1120
}
}
}