OpenAPI 参考
Modelink API · 图像
Modelink 图像生成 API,提供基于 OpenAI 格式的同步生成与基于 Fal 格式的异步任务能力。Fal 格式接口使用 Authorization: Key {api_key};其他接口使用 Bearer 鉴权。
版本 1.0.0
提交文生图任务
提交 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": {}
}
}