Skip to main content
POST
/
v1beta
/
models
/
gemini-2.5-flash-image-hd:generateContent
Image to Image
curl --request POST \
  --url https://gptproto.com/v1beta/models/gemini-2.5-flash-image-hd:generateContent \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "contents": [
    {}
  ],
  "generationConfig": {}
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

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

contents
array
Contents parameter
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

Success
200
Successful response
{
  "status": "success"
}

Error Responses

{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}