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

Nano-Banana Text-to-Image is Google’s lightweight yet powerful AI image generation model, built for creators who need fast, high-quality visuals from simple text prompts. It transforms words into expressive, realistic images with remarkable clarity, composition, and style diversity — all within seconds.
  • Text-to-Image: Generate high-quality images from simple or complex text descriptions.

Supported inputs & outputs :

Inputs: Text Outputs: Text and image

Authentication

This endpoint requires authentication using a Bearer token.
Authorization
string
default:"sk-***********"
required
Your API key in the format: 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 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. default 1:1
output_format
string
default:"jpeg"
Output Format parameter png, jpeg Default png
enable_sync_mode
boolean
default:"false"
If set to true, the function will wait for the result to be generated and uploaded before returning the response. It allows you to get the result directly in the response. This property is only available through the API.
enable_base64_output
boolean
default:"true"
If enabled, the output will be encoded into a BASE64 string instead of a URL. This property is only available through the API.

Text-to-Image

curl -X POST "https://gptproto.com/api/v3/google/nano-banana/text-to-image" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme",
  "aspect_ratio": "3:2",
  "output_format": "jpeg",
  "enable_sync_mode": false,
  "enable_base64_output": false
}'

Query Result

curl --location 'https://gptproto.com/api/v3/predictions/e2e61cbf-XXX/result' \
--header 'Authorization: sk-xxxx' \

Aspect ratio

The model defaults to generates 1:1 squares. The different ratios available and the size of the image generated are listed in this table:
Aspect ratioResolution
1:11024x1024
2:3832x1248
3:21248x832
3:4864x1184
4:31184x864
4:5896x1152
5:41152x896
9:16768x1344
16:91344x768
21:91536x672

Response

{
    "data": {
        "id": "e2e61cbf-xxxxx",
        "model": "gemini-2.5-flash-image",
        "outputs": [],
        "urls": {
            "get": "https://gptproto.com/api/v3/predictions/e2e61cbf-xxxx/result"
        },
        "hasNsfwContents": [],
        "status": "processing",
        "createdAt": "2025-10-23 16:26:57",
        "executionTime": 0,
        "timings": {
            "inference": 0
        }
    },
    "message": "success",
    "code": 200
}

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayArray of URLs to the generated content (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.urls.getstringURL to retrieve the prediction result
data.has_nsfw_contentsarrayArray of boolean values indicating NSFW detection for each output
data.statusstringStatus of the task: created, processing, completed, or failed
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
{
  "error": {
    "message": "Invalid signature",
    "type": "401"
  }
}