FocalAPI 文档
使用指南

创作图像模型

查询并调用当前可用的 GPT Image、Seedream、Gemini、Grok、Kling、Krea 与 Qwen 图像模型

FocalAPI 使用统一认证接入多家创作图像模型,同时保留各模型的原生参数语义。先通过 GET /v1/models 查询当前 Key 可见的模型,再用 GET /v1/models/{model} 获取该模型的实时端点与参数契约。

模型可用性、参数和价格可能随用户分组变化。实时模型详情与控制台模型广场是最终依据;不要使用模型列表中不存在的旧 ID 或别名。

统一图像接口

以下当前模型使用 POST /v1/images/generations;需要编辑图片时,按模型详情使用参考图或 POST /v1/images/edits。

系列当前模型 ID
GPT Imagegpt-image-2
Seedreamseedream-4-0-250828、seedream-4-5-251128、dola-seedream-5-0-pro-260628、seedream-5-0-260128
Grok Imaginegrok-imagine-image-quality、grok-imagine-image、grok-imagine-image-2.0
Kling Imagekling-v3
Krea 2krea-2-medium、krea-2-medium-turbo、krea-2-large
Qwen Imageqwen-image-3.0、qwen-image-3.0-pro
curl https://api.focalapi.com/v1/images/generations \
  -H "Authorization: Bearer $FOCALAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-0-260128",
    "prompt": "晨雾中的海边灯塔,电影感光影",
    "size": "2k",
    "watermark": false
  }'

按模型使用参数

不同模型不能共用一套固定参数:

系列主要参数差异
GPT Image 2size(默认 1024x1024,边长 1024–3840 且为 16 的倍数)、quality(low/medium/high,缺省按 low 计)、background(auto/opaque),n 1–8,最多 16 张参考图;mask 需要恰好 1 张参考图
Seedream4.0 默认 2048x2048(档位 1K/2K/4K,最多 10 张参考图);4.5 档位 2K/4K;5.0 Pro 仅单图生成(档位 1K/1.5K/2K);5.0(lite)最多 14 张参考图(档位 2K/3K/4K);各版本另有 watermark 与提示词优化参数
Grok Imagine 2.0aspect_ratio、resolution、quality、seed,最多生成 10 张
Kling Image 3.0aspect_ratio、negative_prompt,最多生成 9 张;参考图不能与负面提示词同时使用
Krea 2aspect_ratio、固定 1K 分辨率、creativity、风格参考图与 moodboard,每次生成 1 张
Qwen Image 3.0size、最多 3 张参考图、negative_prompt、prompt_extend、watermark,最多生成 6 张

提交前可直接查看某个模型的精确约束:

curl https://api.focalapi.com/v1/models/kling-v3 \
  -H "Authorization: Bearer $FOCALAPI_KEY"

Gemini 原生接口

Gemini 图像模型使用原生 generateContent 接口:

当前模型 ID说明
gemini-2.5-flash-image至多 1 张参考图,且必须为 inlineData(不支持 fileData);固定 1K 输出
gemini-3-pro-image参考图至多 14 张;imageSize 1K/2K/4K
gemini-3.1-flash-image参考图至多 14 张;imageSize 1K/2K/4K;aspectRatio 支持 15 档(含 1:4、4:1、1:8、8:1);支持 thinkingLevel、temperature、topP
gemini-3.1-flash-lite-image参考图至多 14 张;固定 1K 输出;aspectRatio 同样支持 15 档;支持 thinkingLevel、temperature、topP
curl 'https://api.focalapi.com/v1beta/models/gemini-3.1-flash-image:generateContent' \
  -H "Authorization: Bearer $FOCALAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "A clean product illustration of a blue ceramic mug"}]}],
    "generationConfig": {
      "responseModalities": ["IMAGE", "TEXT"],
      "responseFormat": {
        "image": {"aspectRatio": "1:1", "imageSize": "1K"}
      }
    }
  }'

图片在响应候选项的 inlineData 中返回。aspectRatio、imageSize 和采样参数是否可用,仍以所选 Gemini 模型的实时详情为准。

计费

价格由模型及图片张数、分辨率、质量档位和参考图数量等参数决定。具体单价和折扣以控制台模型广场为准。

本页目录