API Doc-CometAPI
HomeDashBoardModel Marketplace
HomeDashBoardModel Marketplace
Discord_Support
  1. Gemini
  • GET START
    • Quick Start
    • Important Guidelines
    • Release Notes
  • API Reference
    • Error Codes & Handling
    • Text Models-openai format
      • Chat
      • response
      • gpt-4o-image generates image
      • Images
      • Image Editing (gpt-image-1)
      • Recognizing Images
      • Embeddings
      • Realtime
      • Models
      • Hunyuan3D
    • Anthropic Compatiable
      • Anthropic Claude
    • Image Models
      • Midjourney(images)
        • Quick Tutorial - Complete Process in One Go
        • Task Fetching API
          • List by Condition
          • Fetch Single Task (most recommended)
        • Imagine
        • Submit Video
        • Submit Editor
        • Action (UPSCALE; VARIATION; REROLL; ZOOM, etc.)
        • Blend (image -> image)
        • Describe (image -> text)
        • Modal (Area Redesign & Zoom)
      • Flux(images)
        • Generate image (replicate format)
        • Create Task - General
        • flux fine-tune images(Temporarily unavailable)
        • flux generate image(Temporarily unavailable)
        • flux query
      • Replicate(image)
        • Create Task - General
        • Create Task -flux-kontext-pro、max
        • Create Task -flux-1.1-pro
        • Create Task -flux-1.1-pro-ultra
        • replicate query
      • Recraft(images)
        • Appendix
        • Recraft Generate Image
        • Recraft Vectorize Image
        • Recraft Remove Background
        • Recraft Clarity Upscale
        • Recraft Create style
        • Recraft Generative Upscale
      • Ideogram(images)(Temporarily removed)
        • Official documentation (updated in real time)
        • Generate 3.0 (text to image)
        • Remix 3.0 (hybrid image)
        • Reframe 3.0(Reconstruction)
        • Replace Background 3.0(Background replacement)
        • Edit 3.0(Editing images)
        • ideogram Text Raw Image
        • ideogram Hybrid image
        • ideogram enlargement HD
        • ideogram describes the image
        • ideogram Edit image((legacy))
    • Music Models
      • Suno
        • Setting suno Version
        • Suno API Scenario Application Guide
        • Generate lyrics
        • Generate music clip
        • Upload clip
        • Submit concatenation
        • Full Track Audio Separation
        • Single Track Audio Separation
        • Create New Persona
        • Single task query
        • Generate mp4 mv video
        • Timing: lyrics, audio timeline
        • Get wav format file
        • Batch query tasks
      • Udio(Temporarily unavailable)
        • Generate music
        • Task query
    • Video Models
      • veo3
        • veo3-chat format
        • Submit video generation task
        • Query video generation status
      • runway(video)
        • official format
          • runway images raw video
          • Generate a video from a video
          • Generate an image from text
          • Upscale a video
          • Control a character
          • runway to get task details
        • Reverse Format
          • generate(text)
          • generate(Reference images)
          • Video to Video Style Redraw
          • Act-one Expression Migration
          • feed-get task
      • kling (video)
        • callback_url
        • testing
          • Multimodal Video Editing (In Testing)
            • Initialize Video for Editing
            • Add Video Selection
            • Delete Video Selection
            • Clear Video Selection
            • Preview Selected Video Area
            • Create Task
        • Generating images
        • Expanded
        • Text Generation Video
        • Image Generation Video
        • Multi-Image To Video
        • Multi-Image to Image
        • Video Extension
        • virtual try-on
        • lip sync
        • effects
        • Video to audio
        • Text to audio
        • Individual queries
      • bytedance
        • bytedance-video
        • bytedance-video get
        • bytedance-image-generation
        • bytedance-Image Editing
      • MiniMax Conch(video)
        • MiniMax Conch Official Documentation
        • MiniMax Conch Generation
        • MiniMax Conch Query
        • MiniMax Conch Download
      • luma (video)(temporarily dismantle)
        • Official api interface format
          • luma generate
          • luma search
      • PIKA(video)(temporarily dismantle)
        • pika feed
        • PIKA Reference Video Generation
        • PIKA Reference Image Generation
        • PIKA reference text generation
      • sora(temporarily dismantle)
        • Reverse Format
          • Create Video
          • Query Video Task
          • Create Video
    • Audio Models
      • Create speech
      • Create transcription
      • Create translation
    • Gemini
      • Gemini generates image
        POST
  • CODE EXAMPLES
    • Code example
  • Guides & Tutorials
    • Integration Guides
      • COMET API API Call Testing
      • OpenManus
      • Chatbox
      • CherryStudio
      • Cursor
      • COZE
      • Cline
      • ChatHub
      • Dify
      • LiteLLM
      • zapier
      • n8n
      • n8n Local Deployment
      • AnythingLLM
      • MAKE
      • Immersive Translation
      • NEXT CHAT (ChatGPT Next Web)
      • ChatAll Translation
      • FastGPT
      • Lobe-Chat
      • Zotero
      • LangChain
      • Open WebUI
      • OpenAI Translator
      • Pot Translation
      • Obsidian's Text Generator Plugin
      • GPT Academic Optimization (gpt_academic)
      • gptme
      • avante.nvim
      • Eudic Translation
      • librechat
      • utools-ChatGPT Friend
      • IntelliJ Translation Plugin
      • Lazy Customer Service
      • buildship
      • sillytavern
    • Best Practices
      • Claude Code Installation and Usage Guide
      • Gemini CLI Installation and Usage Guide
      • CometAPI Account Balance Query API Usage Instructions
      • Retry Logic Documentation for CometAPI and OpenAI Official API
      • Midjourney Best Practices
      • Runway Best Practices
      • Guide to calling gemini-2.5-flash-image
  • Pricing & Billing
    • About Pricing
  • Support
    • Help Center
    • Confusion about use
    • Common Misconceptions
    • Terms of service
    • Privacy policy
    • Interface Stability
  1. Gemini

Gemini generates image

Developing
POST
https://api.cometapi.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent
Maintainer:Not configured
Gemini Native Format Raw Graph
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.cometapi.com/v1beta/models/gemini-2.5-flash-image-preview: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"
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  }
}'
Response Response Example
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "![image](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABAAAAAQACAIAAADwf7zUAAAAiXpUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAAiZTYwxDgIxDAT7vOKekDjrtV1T0VHwgbtcIiEhgfh/QaDgmGl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QacLCDqhsrSFMrx3urcmJtAhDdp9CKiRlKGrhY1ogCSggCKJYE3h6KEgrJn3PbwGAVU0020fKsvSmoqYAE5xLKobBE6B18bgdHcDMYiRULXkWKJjsDWLtGpbltvbGz+vL8fwPp4/uzGR8+UC59oM7t3HedtGdwQ0AdSE4BhukGZwiDsVQEICjsFmpmrDI08pJvB6vG0/772Lmooq5NSattZ737fdRz/drH17/PrzT26fv/fsvffbahAuy2nbtnU1d2xPe1PdBaSLLmZUGT58UR1bF/cGAUcTGLA7qd6WVdWc3UzpVBGOEY5ZzMJ0Vc2H07kuSnK4qzVkECi8H3EokRsP

Request

Header Params

Body Params application/json

Examples

Responses

🟢200Success
application/json
Body

Previous
Create translation
Next
Code example
Built with