Skip to main content
POST
/
api
/
v3
/
google
/
nano-banana
/
text-to-image
Nano-banana-text-to-image
curl --request POST \
  --url https://gptproto.com/api/v3/google/nano-banana/text-to-image \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "<string>",
  "aspect_ratio": "<string>",
  "output_format": "<string>",
  "enable_sync_mode": true,
  "enable_base64_output": true
}'
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}

Overview

Image generation with Gemini (aka Nano Banana)
  • Text-to-Image: Generate high-quality images from simple or complex text descriptions.

Supported inputs & outputs :

Inputs: Text Outputs: Text and image

Text-to-Image

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

prompt
string
default:"The cat is climbing on the tree"
required
Prompt parameter
aspect_ratio
string
default:"1:1"
Aspect Ratio parameter
output_format
string
default:"jpeg"
Output Format parameter
enable_sync_mode
boolean
default:"false"
Enable Sync Mode parameter
enable_base64_output
boolean
default:"true"
Enable Base64 Output parameter

Request Example

curl -X POST "gptproto/api/v3/google/nano-banana/text-to-image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "The cat is climbing on the tree",
  "aspect_ratio": "3:2",
  "output_format": "jpeg",
  "enable_sync_mode": false,
  "enable_base64_output": true
}'

Response

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

Error Responses

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