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