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

Overview

This endpoint provides imagegenerate functionality.

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
required
Your API key in the format: Bearer YOUR_API_KEY

Request Body

contents
array
Contents parameter
generationConfig
object
Generationconfig parameter

Request Example

curl -X POST "https://gptproto.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "Hi, can you create a 3d rendered image of a pig with wings and a top hat flying over a happy futuristic scifi city with lots of greenery?"
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  }
}'

Response

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

Error Responses

{
  "error": {
    "message": "Invalid request parameters",
    "type": "invalid_request_error",
    "code": "invalid_parameters"
  }
}