Overview
Google Gemini 2.5 Flash Image, a powerful new image generation and editing model with advanced features and creative control.
Inputs: Text
Outputs: Text and image
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
model
string
default: "gemini-2.5-flash-image-preview-hd"
required
The model to use for the request
The prompt for the generation.
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. default 1:1
curl -X POST "https://gptproto.com/v1/images/generations" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash-image-preview-hd",
"prompt": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
"size": "16:9"
}'
Response
{
"created" : 1762156444807 ,
"data" : [
{
"b64_json" : "image_base64"
}
],
"output_format" : "png" ,
"quality" : "high" ,
"size" : "16:9" ,
"usage" : {
"input_tokens" : 535 ,
"input_tokens_details" : {
"image_tokens" : 516 ,
"text_tokens" : 19
},
"output_tokens" : 1291 ,
"total_tokens" : 1826
}
}
401 - Invalid signature
403 - Invalid Token
403 - Insufficient balance
500 - Internal server error
503 - Content policy violation
{
"error" : {
"message" : "Invalid signature" ,
"type" : "401"
}
}