
gemini-2.5-flash-image-preview
starting from
API Overview
Gemini 2.5 Flash Image is Google's latest image generation and editing model, featuring multiple core capabilities such as multi-image blending, character consistency, advanced image editing, and localized world knowledge understanding. It can meet the diverse needs of developers, businesses, and individual users when creating and customizing visual content. **Supported Features:**
- Multi-Image Blending: Allows combining multiple images to create entirely new visual effects, such as placing objects into scenes or redesigning spaces with different color schemes or textures.
- Character Consistency: Ensures consistent character appearances across various scenarios, making it ideal for brand assets, product showcases, employee badges, and other applications requiring uniform visuals.
- Image and Text Editing: Enables users to upload images and precisely edit them using natural language prompts—for example, adding/removing elements, modifying single details, adjusting styles, or fine-tuning color grading.
- High-Fidelity Text Rendering: Generates images with clear, readable text arranged in well-organized layouts, perfect for designing logos, posters, and charts. Prompt: (Design a modern, minimalist logo for a coffee shop called "The Daily Grind")
API Console
Log in to explore more features! Click to Log In
API Reference (11)
| API Description | API Endpoint | Request Method | Stability | Parameter Description |
|---|---|---|---|---|
v1beta(Official Format - Chat) | POST | Stable | View Details | |
Document Details Original format from Google Gemini Google original format documentation: https://ai.google.dev/gemini-api/docs/text-generation?hl=en Request Parameters Path ParametersmodelstringRequired Example Value: gemini-2.5-flashHeader Parametersx-goog-api-keystringRequired Example Value: {{YOUR_API_KEY}}Request Body application/jsoncontentsarray[object]Required partsarray[object]Optional textstringOptional generationConfigobjectRequired responseModalitiesarray[string]Required | ||||
v1beta (Official Format - Text-to-Image) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model
Pricing: Input 0.3 PTC/1M Tokens Output 30 PTC/1M Tokens Request Parameters Path ParametersmodelstringRequired Example Value: gemini-2.5-flash-image-previewHeader Parametersx-goog-api-keystringRequired Example Value: {{YOUR_API_KEY}}Query Parametersresponse_formatenum<string>Optional Enum Value: urlb64_jsonRequest Body application/jsoncontentsarray[object]Required partsarray[object]Optional textstringOptional generationConfigobjectRequired responseModalitiesarray[string]Required | ||||
v1beta (Official Format - Image Editing) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model
Pricing: Input 0.3 PTC/1M Tokens Output 30 PTC/1M Tokens Request Parameters Path ParametersmodelstringRequired Example Value: gemini-2.5-flash-image-previewHeader Parametersx-goog-api-keystringRequired Example Value: {{YOUR_API_KEY}}Query Parametersresponse_formatenum<string>Optional Enum Value: urlb64_jsonRequest Body application/jsoncontentsarray[object]Required partsarray[object]Optional textstringOptional image_urlstringOptional generationConfigobjectRequired responseModalitiesarray[string]Required | ||||
Chat(Image Generation) | POST | Stable | View Details | |
Document Details The newest Gemini models support both text-to-image and image-to-image generation. Simply pass an image URL using the Supported Models
Notes
For pricing, see: https://302.ai/price Request Parameters Header ParametersContent-TypestringRequired Example Value: application/jsonAcceptstringRequired Example Value: application/jsonAuthorizationstringOptional Example Value: Bearer {{YOUR_API_KEY}}Request Body application/jsonmodelstringRequired The ID of the model to be used. For detailed information on which models are applicable to the chat API, please view Model endpoint compatibility messagesarray[object]Required Generate messages in chat format for chat completions. rolestringOptional contentstringOptional temperatureintegerOptional What sampling temperature to use, ranging from 0 to 2. Higher values, such as 0.8, will make the output more random, while lower values, like 0.2, will make it more focused and deterministic. We generally recommend adjusting either this or top_pintegerOptional An alternative to temperature sampling is nucleus sampling, where the model considers tokens within the top_p probability mass. For instance, top_p = 0.1 means only tokens within the top 10% probability mass are considered. We recommend adjusting either this or nintegerOptional How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs. streambooleanOptional If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by stopstringOptional Up to 4 sequences where the API will stop generating further tokens. max_tokensintegerOptional The maximum number of tokens that can be generated in the chat completion. presence_penaltynumberOptional Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model’s likelihood to talk about new topics. frequency_penaltynumberOptional Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. See more information about frequency and presence penalties. logit_biasnullOptional Modify the likelihood of specific tokens appearing in the completion. This can be done by providing a JSON object that maps tokens (identified by their token IDs in the tokenizer) to a bias value ranging from -100 to 100. Mathematically, this bias is added to the logits generated by the model before sampling. The exact effect varies depending on the model, but values between -1 and 1 will slightly decrease or increase the likelihood of selection, while values like -100 or 100 will either ban or exclusively select the relevant token. userstringOptional A unique identifier representing your end users, which helps OpenAI monitor and detect abuse. View more | ||||
gemini-2.5-flash-image (Original Format - Text-to-Image) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Pricing: Input 0.3 PTC/1M Tokens Output 30 PTC/1M Tokens Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Query Parametersresponse_formatenum<string>Optional Enum Value: urlb64_jsonRequest Body application/jsoncontentsarray[object]Required partsarray[object]Optional textstringOptional generationConfigobjectRequired responseModalitiesarray[string]Required imageConfigobjectOptional aspect_ratioenum<string>Optional Enum Value: 1:12.33:23:44.34.55.49:1616:921:9 | ||||
gemini-2.5-flash-image(Original Format - Image Editing) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Pricing: Input 0.3 PTC/1M Tokens Output 30 PTC/1M Tokens Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Query Parametersresponse_formatenum<string>Optional Enum Value: urlb64_jsonRequest Body application/jsoncontentsarray[object]Required partsarray[object]Optional textstringOptional inline_dataobjectOptional mime_typestringRequired datastringRequired | ||||
gemini-2.5-flash-image (Pay-per-Use - Text-to-Image) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Average runtime: 5-10s Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Request Body application/jsonpromptstringRequired aspect_ratioenum<string>Optional Enum Value: 1:12.33:23:44.34.55.49:1616:921:9 | ||||
gemini-2.5-flash-image-edit (Pay-per-Use - Image Editing) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Average runtime: 5-10s Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Request Body application/jsonpromptstringRequired image_urlsarray[string]Required Support multiple images | ||||
gemini-2.5-flash-image (asynchronous per-request billing - text-to-image) | POST | Stable | View Details | |
Document Details From Google: gemini-2.5-flash-image model Price: 0.05 PTC/request Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Request Body application/jsonpromptstringRequired aspect_ratioenum<string>Optional Enum Value: 1:12.33:23:44.34.55.49:1616:921:9 | ||||
gemini-2.5-flash-image-edit (asynchronous per-request billing - image editing) | POST | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Request Body application/jsonpromptstringRequired image_urlsarray[string]Required 支持多个图片 | ||||
gemini-2.5-flash-image (asynchronous result retrieval) | GET | Stable | View Details | |
Document Details From Google’s gemini-2.5-flash-image model Price: Free Request Parameters Header ParametersAuthorizationstringRequired Example Value: Bearer {{YOUR_API_KEY}}Query Parametersrequest_idstringOptional Request Body application/x-www-form-urlencodedobject | ||||
API Pricing
| Model | Description | Context | Official Price | 302.AI Price |
|---|
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview-v1beta(Official Format - Chat)
| 32768 |
|
Input$1/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview-v1beta (Official Format - Text-to-Image) | - |
|
Input$1/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview-v1beta (Official Format - Image Editing) | - |
|
Input$1/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview(Original format - image editing) | - |
|
Input$1/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview (Original Format - Text-to-Image) | - |
|
Input$0.3/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview(Chat) | 32768 |
|
Input$0.3/ 1M Tokens Output$30/ 1M Tokens Original Price |
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview (Pay-per-Use - Text-to-Image) | - | $0.05 / call |
|
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview-edit (Pay-per-Use - Image Editing) | - | $0.05 / call |
|
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview (asynchronous per-request billing - text-to-image) | - | $0.05 / call |
|
gemini-2.5-flash-image-preview-edit | gemini-2.5-flash-image-preview-edit (asynchronous per-request billing - image editing) | - | $0.05 / call |
|
gemini-2.5-flash-image-preview | gemini-2.5-flash-image-preview (asynchronous result retrieval) | - | 0 / call |
|