钱多多-全链路API聚合
首页钱多多首页
首页钱多多首页
  1. Gemini
  • 发出请求
  • 完成对象
  • 模型接口
    • OpenAI
      • 基础文本对话
      • 流式响应
      • 图片理解
      • 函数调用
      • Logprobs 请求
      • 内容补全接口
      • 创建内容审核
      • 联网搜索
      • PDF文件分析
      • Codex
      • response_format
      • N测试
      • gpt-4-all(分析图片)
      • 令牌用量查询(Token Usage)
      • 列出模型
    • OpenAI(Responses)
      • 基础文本响应
      • 图像分析响应
      • 网络搜索工具
      • 文件搜索工具
      • 流式响应
      • deep-research / 深度研究
      • 函数调用
      • 推理能力
    • Anthropic Claude
      • Messages接口(推荐)
        • 文本生成
        • 图片理解
        • 文本生成 / 强制返回思考
        • 函数调用
        • 多轮函数调用
        • Web search / 联网搜索
      • OpenAI Chat接口
        • 文本生成
        • 图片理解
        • 文本生成 / 强制返回思考
        • 函数调用
        • 多轮函数调用
        • Web search / 联网搜索
    • Google Gemini
      • OpenAI 兼容接口(推荐)
        • 文本生成
        • 文本生成 / 强制返回思考
        • 图片理解
        • 函数调用
        • 全能多模态版本
        • 联网搜索
        • 文本转语音 / TTS
        • 音频理解
        • 视频理解
      • Google Gemini 接口
        • 文本生成
    • Midjourney
      • 1.文生图(Imagine)接口
      • 2.按钮点击(Action)接口
      • 3.图片融合(Blend)接口
      • 4.窗口执行(Modal)接口
      • 5.图生文(Describe)接口
      • 6.缩短提示词(Shorten)接口
      • 7.换脸(FaceSwap)接口
      • 8.上传(upload)接口
      • 9.查询接口
      • 10.批量查询接口
      • 11.获取种子(Seed)接口
      • 13.编辑图片(Edit)接口
      • 14.生成视频(Video)接口
      • 文生图 / OpenAI兼容接口
    • 图像(Image)
      • OpenAI
        • 图片生成 / gpt-image-1
        • 图片生成 / dall-e-3
        • 图片编辑 / edits接口
        • 图片编辑 / 网页版
        • 图片变体生成
        • gpt-4-all(生成图片)
      • Gemini
        • 图片生成(Nano-banana)
          POST
        • 图片生成 / Imagen 4
          POST
        • 图片编辑(Nano-banana)
          POST
        • 图片生成
          POST
        • 图片编辑
          POST
      • 豆包(Seedream 4.0)
        POST
      • xAI / OpenAI兼容接口
        POST
      • 通义千问 / OpenAI兼容接口
        POST
      • flux / OpenAI兼容接口
        POST
      • flux-kontext-pro / OpenAI兼容接口
        POST
      • stable-diffusion / OpenAI兼容接口
        POST
      • ideogram / OpenAI兼容接口
        POST
      • recraftv3 / OpenAI兼容接口
        POST
      • flux携带参考图 / OpenAI兼容接口
        POST
    • 视频(Video)
      • Sora-2
        • Sora2官方接口(异步任务)
        • 查询视频1(异步任务)
        • 查询视频2(异步任务)
        • Sora2官方接口(Chat格式)
      • 豆包(Doubao)
        • 豆包-文生视频
        • 查询视频
      • 即梦(Jimeng)
        • 即梦AI-文生视频S2.0Pro
        • 查询视频
      • 可灵AI(Kling)
        • 可灵AI-文生视频
        • 查询视频
      • Veo 3
        • Veo 3
        • 查询视频
      • Vidu
        • Vidu-文生视频
        • 查询视频
      • OpenAI兼容接口
        • veo3
        • luma
        • runway
        • 智谱清言GLM
        • 可灵
    • 音频(Audio)
      • 文本转语音 / TTS
      • 语音转文本 / whisper-1
      • 语音转文本 / gpt-4o-transcribe
      • 音频翻译
      • Audio接口 / 输出
      • Audio接口 / 输入
      • 豆包语音2.0
    • 音乐(Music)
      • Suno
        • 生成歌曲
        • 生成歌词
        • 上传音乐
        • 歌曲拼接
        • 单个查询任务
        • 批量查询任务
      • Udio
        • Udio(Chat格式)
    • 嵌入(Embeddings)
      • 创建文本嵌入(OpeniAI)
      • 批量创建嵌入(OpeniAI)
      • 创建文本嵌入(Gemini)
    • 重排序 (Rerank)
      • Jina AI 重排序格式
      • Cohere 重排序格式
      • Xinference 重排序格式
    • xAI
      • 联网搜索
      • 图片生成
    • 实时对话(Realtime)
      • Realtime API
    • GPTs 相关
      • GPTs对话
      • 搜索相关 GPTs
      • 查询 GPTs 详情
      • 批量查询 GPTs 详情
  • Python配置方式
    • Python基础对话
    • Python使用gpt-4o识别图片
    • Python使用Claude识别图片
  1. Gemini

图片生成(Nano-banana)

主站接口①
https://api2.aigcbest.top/v1
主站接口①
https://api2.aigcbest.top/v1
POST
https://api2.aigcbest.top/v1
/chat/completions
Gemini 也提供了图像生成能力,作为一种替代方案。与 Imagen 3.0 相比,Gemini 的图像生成更适合于需要上下文理解和推理的场景,而非追求极致的艺术表现和视觉质量。
更高的视觉质量 → 相比 exp 版,图像更锐利、更丰富、更清晰。
更准确的文本呈现 → 生成的视觉中,文本更加精准、干净、易读。
显著减少过滤拦截 → 得益于更智能、宽松的过滤机制,创作时几乎不再被打断。
说明:
模型 id:gemini-2.0-flash-preview-image-generation
费率(输入→输出):
0.1
→
0.1→0.4/M tokens
需要新增参数来体验新特性 "modalities":["text","image"]
图片以 Base64 编码形式传递与输出
作为实验模型,建议明确指出 “输出图片”,否则可能只有文本
输出图片的默认高度为 1024px
python 调用需要最新的 openai sdk 支持,请先运行 pip install -U openai
了解更多请访问 Gemini 官方文档

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Header 参数

Body 参数application/json

示例
{
    "model": "gemini-2.5-flash-image",
    "messages": [
        {
            "role": "user",
            "content": "Create a highly realistic 1/7 scale commercialized figure based on the illustration’s adult character, ensuring the appearance and content are safe, healthy, and free from any inappropriate elements. Render the figure in a detailed, lifelike style and environment, placed on a shelf inside an ultra-realistic figure display cabinet, mounted on a circular transparent acrylic base without any text. Maintain highly precise details in texture, material, and paintwork to enhance realism. The cabinet scene should feature a natural depth of field with a smooth transition between foreground and background for a realistic photographic look. Lighting should appear natural and adaptive to the scene, automatically adjusting based on the overall composition instead of being locked to a specific direction, simulating the quality and reflection of real commercial photography. Other shelves in the cabinet should contain different figures which are slightly blurred due to being out of focus, enhancing spatial realism and depth"
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api2.aigcbest.top/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gemini-2.5-flash-image",
    "messages": [
        {
            "role": "user",
            "content": "Create a highly realistic 1/7 scale commercialized figure based on the illustration’s adult character, ensuring the appearance and content are safe, healthy, and free from any inappropriate elements. Render the figure in a detailed, lifelike style and environment, placed on a shelf inside an ultra-realistic figure display cabinet, mounted on a circular transparent acrylic base without any text. Maintain highly precise details in texture, material, and paintwork to enhance realism. The cabinet scene should feature a natural depth of field with a smooth transition between foreground and background for a realistic photographic look. Lighting should appear natural and adaptive to the scene, automatically adjusting based on the overall composition instead of being locked to a specific direction, simulating the quality and reflection of real commercial photography. Other shelves in the cabinet should contain different figures which are slightly blurred due to being out of focus, enhancing spatial realism and depth"
        }
    ]
}'

返回响应

🟢200OK
application/json
Body

示例
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
修改于 2025-10-18 02:04:34
上一页
gpt-4-all(生成图片)
下一页
图片生成 / Imagen 4
Built with