gemini-2.5-flash-image AI 图像 API

gemini-2.5-flash-image 可通过 Flatkey 使用,适用于图像生成;Flatkey 通过 /v1/images/generations 路由此模型,供应商为 Google。$0.24/$2 per 1M tokens。

文生图参考图引导
输入 /M
$0.24/ 百万 Token-20%$0.3/ 百万 Token
缓存 /M
$0.06/ 百万 Token-20%$0.075/ 百万 Token
输出 /M
$2/ 百万 Token-20%$2.5/ 百万 Token
供应商
Google
生成器配置 · Playground(注册前可编辑)

输入

提示词查看更多864 / 10000
快捷 Prompt
参考图片
开始生成

输出

预览
图片预览

使用 Image 2 生成

请求摘要

接口
POST /v1beta/models/gemini-2.5-flash-image:generateContent
模型 ID
gemini-2.5-flash-image
画面比例
1:1
分辨率
1K

仅供预览。登录后即可向 Flatkey 提交此请求。

请求预览
{
  "model": "gemini-2.5-flash-image",
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Creative direction: Create a tall editorial travel-guide infographic for a three-day Chengdu trip. Combine friendly panda illustrations, a city skyline, Anshun Bridge and old-street scenes, local food icons, a day-one/day-two/day-three route layout, small maps, and budget-and-tips blocks. Use a clear green, orange, and cream information hierarchy with compact but legible Chinese annotations and consistent card spacing.\n\nComposition, material and finish: Build a readable vertical grid: destination overview, three daily route sections, then practical budget and tips. Keep icon outlines, corner radii and spacing consistent. Scale landmark drawings above supporting food icons; use concise Chinese labels rather than dense paragraphs. Do not let decoration cross route lines. Avoid overlapping annotations, repeated day headings, distorted maps and watermarks."
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "1:1"
    }
  }
}

API 性能

gemini-2.5-flash-image API 可靠性与可用性

当生产流量达到足够规模后,这里会显示 gemini-2.5-flash-image 的 Flatkey 实时请求遥测数据。

服务可用率
94.5%
最近 30 天
延迟
753ms
最近 30 天
请求量
255
近 30 天
成功推理趋势

API 活动

gemini-2.5-flash-image API 使用量与请求活动

查看最近统计窗口内 gemini-2.5-flash-image 的请求量和成功推理活动。

请求量
255
近 30 天
延迟
753ms
最近 30 天
可用性
94.5%
最近 30 天
成功推理趋势调用趋势

gemini-2.5-flash-image 价格

gemini-2.5-flash-image API 价格与计费

下方价格来自当前模型的 Flatkey 定价数据,以及定价 API 返回的可见分组。

Flatkey 价格

输入 /M

实时目录模型
$0.24/ 百万 Token$0.3/ 百万 Token
输入 /M
$0.24/ 百万 Token$0.3/ 百万 Token
缓存 /M
$0.06/ 百万 Token$0.075/ 百万 Token
输出 /M
$2/ 百万 Token$2.5/ 百万 Token
图像输入 /M
$0.024/ 百万 Token$0.03/ 百万 Token
先试 prompt
共用余额

充值余额

充值余额

图像、视频、音频和文本模型共用同一个 Flatkey 余额和 API Key。

模型目录
模型类型
文生图
API 接入
/v1beta/models/gemini-2.5-flash-image:generateContent
计费依据
1M tokens
输出数量
1

gemini-2.5-flash-image AI 图像生成器与 API: 核心能力

Google 的 gemini-2.5-flash-image 路由支持 文本 · 图像。目录分类:Marketing。

gemini-2.5-flash-image图像生成

通过 /v1/images/generations 将文字简报转换为图像生成结果。

gemini-2.5-flash-image参考工作流

当 gemini-2.5-flash-image 路由接受参考媒体或上下文时,可使用已有参考进行创作。

gemini-2.5-flash-image渠道适配版本

将一个创意调整为店铺、营销活动或内容流水线所需的不同版本。

gemini-2.5-flash-image生产交接

将确认后的结果从提示词探索带入可重复的 Flatkey 生成工作流。

对比

gemini-2.5-flash-image API 对比:能力与访问方式

在调整集成前,将 gemini-2.5-flash-image 的目录事实与上一代基线进行对比。

能力上一代gemini-2.5-flash-image
供应商此目录快照未验证Google
模态此目录快照未验证文本 · 图像
上下文此目录快照未验证目录未列出上下文窗口
端点此目录快照未验证/v1/images/generations
计费此目录快照未验证$0.24/$2 per 1M tokens

接入前先选对请求方式

核对支持的工作流、当前配置的实时费用,以及 Flatkey 实际使用的参数契约。

实时费用估算

当目录提供固定单价时,根据当前 Playground 配置和实时目录价格计算。

当前配置
1×
实时单价
$0.24
本次预估
按实际用量计费

最终费用以实际提交的请求和账户分组为准。Token 或分层计费无法简化成一个固定预估值。

工作流与 Model ID

只使用标记为可用的工作流。Flatkey 对外保持一个模型 ID,由请求体选择输入方式。

可用

文生图

通过文本提示词和输出参数生成新图片。

模型 ID
gemini-2.5-flash-image
接口
/v1beta/models/gemini-2.5-flash-image:generateContent
可用

参考图生成与编辑

用参考图片完成编辑、变体或主体与构图引导。

模型 ID
gemini-2.5-flash-image
接口
/v1beta/models/gemini-2.5-flash-image:generateContent

参数兼容矩阵

以下取值与 Playground 和请求预览使用同一份模型配置。

aspect_ratio画面比例
可选值

1:1 · 2:3 · 3:2 · 3:4 · 4:3 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9

默认值: 1:1
image参考素材上限
可选值

4 个文件

接口: /v1beta/models/gemini-2.5-flash-image:generateContent

从首次测试到生产接入

Playground 与 API 使用同一套请求契约,并明确处理参数校验、余额、任务状态和产物获取。

请求生命周期

  1. 1

    校验模型、提示词、参考素材和输出设置。

  2. 2

    使用已文档化字段提交图片请求。

  3. 3

    读取路由返回的生成结果或异步任务结果。

  4. 4

    在自己的工作流中保存生成文件和请求元数据。

生产检查项

参数校验

提交前拦截不支持的尺寸、时长、比例、格式或参考素材数量。

鉴权与余额

分别处理无效密钥、余额不足、限流和账户分组价格。

输入或策略拒绝

明确指出被拒绝的提示词或素材,让用户只替换失败的输入。

任务失败或超时

保留任务 ID,限制重试次数,且不能把超时当成生成成功。

提示词库

gemini-2.5-flash-image 图像生成提示词示例

先使用一个面向图像生成的 gemini-2.5-flash-image 提示词,再调整 Playground 中显示的请求字段。

游戏 UI 交互与装备动态切换
游戏 UI 交互与装备动态切换

使用 Image 2 生成

Scene: A 16:9 fantasy game loadout screen in mossy forest ruins. A hooded green archer stands centered with a bow; a circular equipment wheel sits around the character and alternate equipment silhouettes occupy the right panel. Keep the green-and-gold HUD, pose, ruins, and prop geometry fixed for an exact equipment-switch frame. No readable words, logos, invented stats, or watermark. Composition and rendering: Deliver one 16:9 game-interface keyframe. Separate the character, held equipment and HUD into clear depth layers; keep slot spacing and icon scale consistent, with the selected item visually dominant. Preserve the scene-specific game art style. Let material edges catch the existing light without letting interface glow obscure the silhouette. Keep all equipment fully inside the frame. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款
高逼真电视/体育赛事直播模拟
高逼真电视/体育赛事直播模拟

使用 Image 2 生成

Scene: A live basketball broadcast frame catches a blue-uniform player airborne for a dunk in a packed arena. Show the hoop, backboard, court lights, crowd depth, and an abstract blue-and-gold lower-third without readable text. Keep the camera angle, ball position, jersey colors, and contact-free action consistent; no real teams, athletes, logos, or watermark. Composition and rendering: Deliver one 16:9 broadcast still at the decisive instant. Use coherent perspective for the playing surface and equipment, readable separation between competitors, and a softer crowd behind the action. Keep the principal subject sharp, with directional blur limited to fast extremities and spray. Preserve the specified broadcast angle and reserve overlay areas clear of the action. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款
品牌商业 TVC 与电商产品无缝展示
品牌商业 TVC 与电商产品无缝展示

使用 Image 2 生成

Scene: A gray-and-black running shoe hangs at a three-quarter angle above a wet track. Its orange sole glows against a dark background while orange light trails echo the tread and the surface holds a restrained reflection. Preserve the shoe shape, lace pattern, sole, lighting, and empty copy space. No readable branding, extra products, hands, or watermark. Composition and rendering: Deliver one 16:9 commercial product still. Keep the complete product silhouette inside generous crop-safe margins. Resolve edges, seams and material transitions precisely; shape highlights to describe volume without clipping bright surfaces or crushing dark details. Align reflections with the object and light source. Retain the stated camera angle and existing negative space; add no decorative props. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款
影视级剧本角色与多视角分镜演播
影视级剧本角色与多视角分镜演播

使用 Image 2 生成

Scene: A lone astronaut stands inside a glass biodome on a red desert planet, seen from behind among glowing bioluminescent plants. A hazy red landscape and distant mountains show through the curved glass. Hold the character silhouette, plant positions, cool interior light, and wide screen direction for storyboard continuity. No readable text, logos, or watermark. Composition and rendering: Deliver one 16:9 storyboard keyframe, not a collage or an action sequence. Separate foreground, character plane and background through the existing light and atmospheric depth. Keep the stated pose and eyelines readable, and retain environmental landmarks for continuity. Match the described photographic, illustrated or puppet medium; give fabric and surfaces texture appropriate to that medium. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款
喜剧段子与物理剧情演播
喜剧段子与物理剧情演播

使用 Image 2 生成

Scene: In a bright modern kitchen, a surprised man in a light green overshirt holds an orange while paper sheets and cups burst through the air around him. Freeze the harmless cause-and-effect gag with believable trajectories, warm daylight, and clear spacing between the objects. Keep the pose and prop positions stable for a physical-comedy frame; no injury, logos, readable words, or watermark. Composition and rendering: Deliver one 16:9 physical-comedy still at the described instant. Make the cause of the gag readable through body balance, grip and object spacing. Separate the reaction from the airborne props; retain believable gravity and contact points. Keep the face and important props sharp, with only restrained directional blur on fast edges. Preserve the stated lighting and room or stage layout. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款
老旧照片修复与历史/人文动态复活
老旧照片修复与历史/人文动态复活

使用 Image 2 生成

Scene: A restored black-and-white market street shows period vendors beside baskets of fruit and folded fabric, with stone buildings and mountains behind them. Preserve the era-appropriate clothing, stalls, architecture, film grain, and stable documentary composition while repairing scratches and contrast. Do not add modern objects, readable signs, logos, identifiable public figures, or watermark. Composition and restoration: Deliver one 16:9 archival-style still. Preserve the original framing, period-specific construction and restrained tonal range; retain monochrome, sepia or faded color as described. Recover modest detail in faces, clothing and architecture without synthetic sharpening. Keep fine grain and authentic aging consistent across the frame; repair damage without replacing historical features. Avoid: warped perspective, malformed anatomy, merged objects, inconsistent shadows, excessive sharpening and watermarks. Follow the scene-specific text and branding restrictions above.

生成同款

为什么使用 gemini-2.5-flash-image API

为什么通过 Flatkey 使用 gemini-2.5-flash-image?

通过一个网关管理 gemini-2.5-flash-image、账户控制以及模型目录中的其他模型。

一个 API 使用 gemini-2.5-flash-image

明确保留 gemini-2.5-flash-image 模型 ID 和端点,同时与其他工作负载共用 Flatkey 密钥。

实时目录价格

发送请求前查看当前 gemini-2.5-flash-image 计费维度,并在账户中确认最终预估。

实用的模型交接

在公开 Playground 中测试 gemini-2.5-flash-image 提示词,再将相同设置带入经过身份验证的集成。

用量与路由控制

集中管理 gemini-2.5-flash-image 的密钥、配额和路由,无需改变应用面向供应商的工作流。

API 接入

gemini-2.5-flash-image API

四种接入方式共用同一个 Key 和模型目录,选择一种查看可运行示例。

通过兼容 OpenAI 的 API 调用任意模型。选择模型和语言,复制即可运行的示例。
继续使用熟悉的 OpenAI SDK,只需将 API 地址切换到 Flatkey。
在终端生成图片和视频,也可以交给 AI 助手完成整个流程。
一条命令接入 Codex 或 Claude Code,在现有项目中直接使用 Flatkey。
curl https://router.flatkey.ai/v1beta/models/gemini-2.5-flash-image:generateContent \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-***" \
  -d '{"model":"gemini-2.5-flash-image","contents":[{"role":"user","parts":[{"text":"使用 gemini-2.5-flash-image 制作高质量产品图:构图干净、光线精准、主体突出、细节真实。"}]}],"generationConfig":{"responseModalities":["TEXT","IMAGE"],"imageConfig":{"aspectRatio":"1:1"}}}'
文档

常见问题

gemini-2.5-flash-image API
价格、功能与使用常见问题

关于 gemini-2.5-flash-image 价格、能力、端点访问和目录限制的答案。

gemini-2.5-flash-image 用于什么任务?
gemini-2.5-flash-image 由 Google 列入图像生成目录;目录列出的模态为:文本 · 图像。
gemini-2.5-flash-image 如何计费?
输入 /M: $0.24; 缓存 /M: $0.06; 输出 /M: $2; 图像输入 /M: $0.024. 下方价格来自当前模型的 Flatkey 定价数据,以及定价 API 返回的可见分组。
调用 gemini-2.5-flash-image 使用哪个 API 端点?
Flatkey 通过 /v1/images/generations 路由此模型。将模型字段设为 gemini-2.5-flash-image,并遵循该端点支持的字段。
gemini-2.5-flash-image 有哪些上下文或输入限制?
gemini-2.5-flash-image 标注为 目录未列出上下文窗口。其他限制取决于路由和当前账户可用性,生产使用前请确认。