Skip to main content
POST
/
v1
/
images
/
generations
gemini-25-flash-image-preview-hd (create image)
curl --request POST \
  --url https://api.example.com/v1/images/generations
Gemini’s openai format for the create image API.
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",
  "prompt": "oxen and horses",
  "n": 1,
  "size": "1024x1024"
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Parameters

ParameterTypeRequiredDefaultDescription
modelstring✅ Yesgemini-2.5-flash-image-previewThe model to use for the request
promptstring✅ Yesoxen and horsesPrompt parameter
ninteger❌ No1Number of completions to generate
sizestring❌ No1024x1024Size parameter