DeerAPI-API文档
  1. Gemini
DeerAPI-API文档
  • 快速开始
    • 快速开始
    • 入门必看
    • DeerAPI 公告
  • API 参考
    • 报错状态码说明
    • OpenAI格式
      • 聊天
      • response
      • gpt-4o-image生图
      • 识图
      • 图像
      • 图像编辑(gpt-image-1)
      • 嵌入
      • Realtime
      • 获取模型列表
      • response id获取结果
      • Hunyuan3D
    • Anthropic 格式
      • Anthropic Claude
    • Gemini
      • 调用 gemini-2.5-flash-image 指南
      • Gemini生图
        POST
      • Gemini 文本对话
        POST
    • Midjourney 图像生成
      • 快速教学-完整流程一遍过
      • 任务查询
        • 分页查询
        • 指定ID获取任务
      • 提交Imagine任务
      • 提交视频任务
      • 提交编辑任务
      • 提交Action任务
      • 提交Blend任务
      • 提交Describe任务
      • 提交Modal
    • 图像生成
      • Replicate(image)
        • 创建任务-通用
        • 创建任务 -flux-kontext-pro、max
        • 创建任务-black-forest-labs/flux-1.1-pro
        • 创建任务-black-forest-labs/flux-1.1-pro-ultra
        • 查询任务
        • 创建任务
      • Replicate(test-bria)
        • 创建任务-通用
        • 创建任务-black-forest-labs/flux-1.1-pro
        • 创建任务-black-forest-labs/flux-1.1-pro-ultra
        • 查询任务
        • 创建任务
      • 豆包生图
        • seededit-image-generation
        • seededit-Image Editing
      • Flux(images)
        • 创建任务-通用
        • 生成图片
        • 微调(暂不可用)
        • 查询任务
        • 生成图片(replicate格式)
      • ideogram(暂时下架)
        • 官方文档(实时更新)
        • Generate(文生图)
        • Generate 3.0(文生图)
        • Remix(混合图)
        • Remix 3.0(混合图)
        • Upscale(放大高清)
        • Reframe 3.0(重构)
        • Describe(描述)
        • Replace Background 3.0(背景替换)
        • Edit(编辑)
        • Edit 3.0(编辑)
      • Recraft(暂时下架)
        • 附录
        • Generate Image(生成图片)
        • Vectorize Image(矢量化图片)
        • Remove Background(删除背景)
        • Clarity Upscale(清晰度提升)
        • Create style(创建样式)
        • Generative Upscale(生成高清)
    • 音乐生成
      • Suno
        • 设置 suno 版本
        • Suno API 场景应用指南
        • 生成歌词
        • 生成音乐
        • 上传音乐
        • 歌曲拼接
        • 全轨声曲分离
        • 单轨声曲分离
        • 新建 Persona
        • 查询单个任务
        • 生成 mp4 mv 视频
        • 获取 wav 格式文件
        • Timing:歌词、音频时间线
        • 批量查询任务
        • 获取 midi
      • Udio(暂不可用)
        • 生成音乐
        • 查询单个任务
    • 视频生成
      • veo3
        • veo3-chat格式
        • 提交视频生成任务-测试中
        • 查询视频生成状态-测试中
      • seedace测试中
        • 视频-测试中
          • seedance
          • seedance-video
          • seedance-video get
      • runway(video)
        • 官方格式
          • 图像生成视频
          • 视频生视频
          • 提升清晰度
          • 文生图
          • 控制角色
          • 获取任务详细信息
        • 逆向格式
          • generate(文本)
          • generate(参考图片)
          • video2video 视频转视频 风格重绘
          • Act-one 表情迁移
          • feed-获取任务
      • kling (video)
        • Callback协议
        • 多模态视频编辑
          • 初始化待编辑视频
          • 增加视频选区
          • 删减视频选区
          • 清除视频选区
          • 预览已选区视频
          • 创建任务
        • 生成图像
        • 扩图
        • 文生视频
        • 图生视频
        • 多图参考生图
        • 多图参考生视频
        • 视频特效
        • 视频延长
        • 虚拟试穿
        • 对口型
        • 文生音效
        • 视频生音效
        • 查询任务(单个)
      • MiniMax 海螺(video)
        • 官方文档
        • 视频生成
        • 查询任务
        • 文件下载
      • luma (video)
        • 官方API格式
          • 生成视频
          • 单个查询任务
      • PIKA(暂不可用)
        • 通用版
          • generate video
          • 查询视频任务
        • feed
        • generate(参考视频/扩展视频)
        • generate(参考图片)
        • generate(文本)
      • sora-2
        • sora-2视频逆向格式
    • 音频
      • 文本转音频
      • 音频转文本
      • 创建翻译
  • 代码示例
    • 代码示例
  • 集成指南
    • 应用集成指南
      • DeerAPI 本站调用
      • OpenManus
      • Chatbox
      • CherryStudio
      • COZE
      • Cursor
      • Lobe-Chat
      • NEXT CHAT (ChatGPT Next Web)
      • AnythingLLM
      • cline
      • gptme
      • LangChain
      • ChatHub
      • ChatAll
      • Dify
      • Zotero
      • librechat
      • avante.nvim
      • IntelliJ Translation Plugin
      • FastGPT
      • OpenAI Translator
      • Open WebUI
      • obsidian的text generator插件
      • STranslate
      • 沉浸式翻译
      • Pot 翻译
      • 欧陆翻译
      • GPT 学术优化(gpt_academic)
      • utools-ChatGPT 好友
      • 懒人客服
    • 最佳实践
      • Claude code 接入说明
      • Deerapi 账户余额查询API 使用说明
      • 使用 DeerAPI 和 OpenAI 官方 API 的重试逻辑说明文档
      • Midjorney调用最佳实践
      • Runway调用最佳实践
      • Gemini CLI 接入说明
      • Codex 接入说明
  • 定价计费
    • 关于价格
    • 关于分组
  • 帮助中心
    • 帮助中心
    • 接口稳定性
    • 常见误区
    • 使用困惑
    • 隐私政策
    • 服务条款
  1. Gemini

Gemini 文本对话

POST
https://api.deerapi.com/v1beta/models/gemini-2.5-flash:generateContent
Gemini原生格式

请求参数

Header 参数

Body 参数application/json

示例

返回响应

🟢200成功
application/json
Body

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.deerapi.com/v1beta/models/gemini-2.5-flash:generateContent' \
--header 'Authorization: {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "'\''Maintain the character features in the image to generate a new portrait photo: a woman leaning on a wooden railing of a traditional Chinese building. She is wearing a blue cheongsam with pink and red floral motifs and a headdress made of colorful flowers, including roses and lilacs. Her right hand gently touches a large kite with a blue background, decorated with pink fish motifs and a pair of large eyes. The background is the interior of an old wooden building, dimly lit and cozy. The painting style is realistic, focusing on the textural details of the clothing patterns, floral headdresses, and wooden buildings"
        }
        
      ]
    }
  ]
}'
响应示例响应示例
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "Here's a detailed prompt designed to achieve that specific vision, emphasizing the requested details and style:\n\n```\n**Character:** A beautiful, serene Asian woman with delicate features, a soft, gentle expression, and dark hair elegantly styled, possibly with a few wisps framing her face. She has subtle makeup, highlighting her natural beauty.\n\n**Pose and Attire:** She is leaning gracefully and comfortably against an ornate, dark wooden railing of a traditional Chinese building. Her right hand is delicately poised, gently touching a large, vibrant kite. She wears a stunning, richly textured **deep blue silk cheongsam (qipao)**. The cheongsam is adorned with intricate and vibrant **pink and crimson red floral motifs**, likely peonies, cherry blossoms, or other traditional Chinese flowers, showcasing exquisite embroidery and subtle brocade patterns that catch the light. The fabric should show a subtle sheen and deep textural detail.\n\n**Headdress:** An elaborate and colorful **headdress crafted from fresh, vivid flowers**, including lush, velvety roses (in shades of pink and red), delicate lavender lilacs, and perhaps smaller complementary blossoms, artfully arranged in her hair. Each petal and leaf should be distinctly rendered.\n\n**Prop (Kite):** A large, traditional Chinese kite with a prominent, rich **blue background**. It is beautifully decorated with playful and detailed **pink koi fish motifs** swimming across its surface. A pair of strikingly large, expressive eyes are painted on the kite, adding a touch of whimsy. The kite's material should appear slightly translucent and textured, showing the delicate framework beneath.\n\n**Background:** The interior of an ancient, richly textured traditional Chinese wooden building. The backdrop features intricately carved wooden beams, decorative lattice windows or screens, and aged wooden wall panels. The atmosphere is **dimly lit and cozy**, with warm, soft light filtering in from unseen windows or lanterns, creating subtle highlights and deep, inviting shadows. Focus on the authentic grain of the old wood and the fine details of the carvings.\n\n**Lighting and Style:** **Hyperrealistic portrait photography, extremely high detail.** The lighting should be soft, directional, and atmospheric, emphasizing the textures. There should be a shallow depth of field, with the woman and the kite in sharp, exquisite focus, while the background gently blurs into a warm, cozy ambiance. Emphasize the tactile qualities: the smooth sheen of the cheongsam, the soft, velvety petals of the roses, the delicate, papery texture of the kite, and the aged, rough grain of the wooden structures. Cinematic lighting.\n```"
          }
        ]
      },
      "finishReason": "STOP",
      "index": 0,
      "safetyRatings": null
    }
  ],
  "promptFeedback": {
    "safetyRatings": null
  },
  "usageMetadata": {
    "promptTokenCount": 122,
    "candidatesTokenCount": 526,
    "totalTokenCount": 1976,
    "thoughtsTokenCount": 1328,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 122
      }
    ]
  }
}
修改于 2025-09-23 05:42:54
上一页
Gemini生图
下一页
快速教学-完整流程一遍过
Built with