Overview
This endpoint provides image to image functionality.
Authentication
This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: Bearer YOUR_API_KEY
Request Body
generationConfig
object
default:"{\"responseModalities\": [\"TEXT\", \"IMAGE\"]}"
Generationconfig parameter
Request Example
curl -X POST "gptproto/v1beta/models/gemini-2.5-flash-image-hd:generateContent" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{
"text": "Create a picture of my cat eating a nano-banana in a fancy restaurant under the Gemini constellation"
},
{
"inline_data": {
"mime_type": "image/jpeg",
"data": "base64"
}
}
]
}
],
"generationConfig": {
"responseModalities": [
"TEXT",
"IMAGE"
]
}
}'
Response
Error Responses
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}