Overview
Google Gemini 2.5 Flash Image, a powerful new image generation and editing model with advanced features and creative control.
- Text-to-Image: Generate high-quality images from simple or complex text descriptions.
Inputs: Text
Outputs: Text and image
Text-to-Image
The default output size for chat mode is 1:1 (1024x1024)
Authentication
This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: YOUR_API_KEY
Request Body
Array of message objects for the conversation
The prompt for the generation.
model
string
default:"gemini-2.5-flash-image"
required
The model to use for the request
curl -X POST "https://gptproto.com/v1/chat/completions" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme"
}
],
"model": "gemini-2.5-flash-image"
}'
Response
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "Here's your nano banana dish in a fancy restaurant with a Gemini theme! \n",
"role": "assistant"
}
}
],
"created": 1762163196,
"id": "chatcmpl-20251103174627570914749cO7T1Yq5",
"model": "gemini-2.5-flash-image",
"object": "chat.completion",
"usage": {
"completion_tokens": 1307,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens": 16,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
},
"total_tokens": 1323
}
}
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}